Example #1
0
    // Start is called before the first frame update

    private void Awake()
    {
        //Check if instance already exists
        if (instance == null)
        {
            //if not, set instance to this
            instance = this;
        }

        //If instance already exists and it's not this:
        else if (instance != this)
        {
            //Then destroy this. This enforces our singleton pattern, meaning there can only ever be one instance of a GameManager.
            Destroy(gameObject);
        }
    }
Example #2
0
 void Start()
 {
     mechanicsManager = GameObject.Find("GameManager").GetComponent <MechanicsManager>();
 }
Example #3
0
	public Data(MechanicsManager.enumOperation operation, double left, double right)
	{
		_operation = operation;
		_left = (float)left;
		_right = (float)right;
	}