Example #1
0
    private void Awake()
    {
        if (GMtrack == null)
        {
            GMtrack = GetComponent <GMInject>();
        }
        _gen = GMtrack.RegisterInjection <TotalGenerator>();

        _gen.initGenerators();
    }
Example #2
0
    private void Awake()
    {
        #region SingletonCheck

        if (_instance == null)
        {
            Debug.Log("GM: Registered Singleton " + this.GetInstanceID());
            _instance = this;

            SingleRegistration();
        }
        else if (this.GetInstanceID() != _instance.GetInstanceID())
        {
            Debug.Log("GM: Destroyed an Instance of GM; " + this.GetInstanceID() + " for instance = " + _instance.GetInstanceID());
            Destroy(this.gameObject);
        }
        DontDestroyOnLoad(this);

        #endregion

        //DBG Variable
        DisplayID = this.GetInstanceID();
    }