Inheritance: UIView
        public override void applicationRunOnceOnBuilding()
        {
                        #if !UNITY_EDITOR
            if (Application.isMobilePlatform)
            {
                Cursor.visible = false;                 // Once Android cursor bug is fixed, you can delete the next 3 lines.
                Texture2D cursorTexture = new Texture2D(1, 1);
                cursorTexture.SetPixel(0, 0, Color.clear);
                Cursor.SetCursor(cursorTexture, Vector2.zero, CursorMode.Auto);
            }
                        #endif
            //CCGLView
            {
                GameObject obj = new GameObject();
                obj.transform.parent = _window.transform;
                _view = obj.AddComponent <CCGLView> ();
            }
            //CCComponentsPool
            {
                GameObject obj = new GameObject();
                obj.transform.parent = this.transform;
                _factory             = obj.AddComponent <CCFactory>();
            }

            //audio
            {
                GameObject obj = new GameObject();
                obj.transform.parent = this.transform;
                _audioEngine         = obj.AddComponent <SimpleAudioEngine> ();
            }
        }
		public override void applicationRunOnceOnBuilding ()
		{
			
			#if !UNITY_EDITOR
			if(Application.isMobilePlatform) 
			{ 
				Cursor.visible = false; // Once Android cursor bug is fixed, you can delete the next 3 lines. 
				Texture2D cursorTexture = new Texture2D(1, 1); 
				cursorTexture.SetPixel(0, 0, Color.clear); 
				Cursor.SetCursor(cursorTexture, Vector2.zero, CursorMode.Auto); 
			}
			#endif
			//CCGLView
			{
				GameObject obj = new GameObject ();
				obj.transform.parent = _window.transform;
				_view = obj.AddComponent<CCGLView> ();
			}
			//CCComponentsPool
			{
				GameObject obj = new GameObject();
				obj.transform.parent = this.transform;
				_factory = obj.AddComponent<CCFactory>();
			}

			//audio
			{
				GameObject obj = new GameObject ();
				obj.transform.parent = this.transform;
				_audioEngine = obj.AddComponent<SimpleAudioEngine> ();
			}
		}
示例#3
0
		public virtual void Awake() {
			if (Application.isPlaying) {
				if (_Instance != null && _Instance != this) {
					Destroy (this.gameObject);
					return;
				} else {
					_Instance = this;
				}
			} 
			if (firstPassFlag) {
				gameObject.transform.position = Vector3.zero;
				gameObject.name = "CCGLView";
				firstPassFlag = false;
			}
		}
示例#4
0
 public virtual void Awake()
 {
     if (Application.isPlaying)
     {
         if (_Instance != null && _Instance != this)
         {
             Destroy(this.gameObject);
             return;
         }
         else
         {
             _Instance = this;
         }
     }
     if (firstPassFlag)
     {
         gameObject.transform.position = Vector3.zero;
         gameObject.name = "CCGLView";
         firstPassFlag   = false;
     }
 }