Hello,
I am having a problem, I created class, it does not inherit from MonoBehavior:
using UnityEngine;
using System.Collections;
public class ProjectSettings {
//Scrolling speed
private float _baseSpeed;
public void Init(){
_baseSpeed = 2.5f;
}
public float GetBaseSpeed{
get {return _baseSpeed; }
}
}
In my main game class I declare and define an instance of this class
using UnityEngine;
using System.Collections;
using System.Collections.Generic;
public class GameMain : MonoBehaviour {
public ProjectSettings PS;
void Awake () {
PS = GetComponent<ProjectSettings>();
//PS = new ProjectSettings();
PS.Init();
}
}
Everything works, but unity says:
“Assets/Scripts/GameMain.cs(60,20): error CS0117: ProjectSettings' does not contain a definition for
Init’”
How come?
Thanks