예제 #1
0
 protected override void OnDestroy()
 {
     if (_instance == this)
     {
         _instance = null;
     }
 }
예제 #2
0
        protected override void Awake()
        {
            base.Awake();
            //Debug.Log("Instancing as child of: " + transform.parent + " as part of go " + gameObject.name);
            if (_instance != null)
            {
                Debug.LogWarning("Trying to instantiate multiple UILaserInputModule.");
                DestroyImmediate(this.gameObject);
            }

            _instance = this;

            StandaloneInputModule sim = GetComponent <StandaloneInputModule> ();

            if (sim != null)
            {
                Destroy(sim);
            }
        }