Inheritance: UnityEngine.MonoBehaviour, CADisplayLink
Ejemplo n.º 1
0
		public virtual void Awake() {
			if (Application.isPlaying) {
				if (_appDelegate != null && _appDelegate != this) {
					Destroy (this.gameObject);
					return;
				} else {
					_appDelegate = this;
				}
				DontDestroyOnLoad (this.gameObject);
				_loopers = new List<NSLooper>();
				_looperCount = 0;
				registWithTarget(_window, _window.OnUpdate, _window.OnGUIUpdate);
				_doseApplicationDidFinishLaunched = false;
			} 

			if (firstPassFlag) {
				//init
				gameObject.transform.position = Vector3.zero;
				gameObject.name = "AppDelegate";

				//window
				{
					GameObject obj = new GameObject ();
					obj.transform.parent = this.transform;
					_window = obj.AddComponent<UIWindow> ();
				}

				//impl building
				applicationRunOnceOnBuilding();

				firstPassFlag = false;
			}
		}
Ejemplo n.º 2
0
        public virtual void Awake()
        {
            if (Application.isPlaying)
            {
                if (_appDelegate != null && _appDelegate != this)
                {
                    Destroy(this.gameObject);
                    return;
                }
                else
                {
                    _appDelegate = this;
                }
                DontDestroyOnLoad(this.gameObject);
                _loopers     = new List <NSLooper>();
                _looperCount = 0;
                registWithTarget(_window, _window.OnUpdate, _window.OnGUIUpdate);
                _doseApplicationDidFinishLaunched = false;
            }

            if (firstPassFlag)
            {
                //init
                gameObject.transform.position = Vector3.zero;
                gameObject.name = "AppDelegate";

                //window
                {
                    GameObject obj = new GameObject();
                    obj.transform.parent = this.transform;
                    _window = obj.AddComponent <UIWindow> ();
                }

                //impl building
                applicationRunOnceOnBuilding();

                firstPassFlag = false;
            }
        }