Inheritance: UIView
コード例 #1
0
        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> ();
            }
        }
コード例 #2
0
		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
ファイル: CCGLView.cs プロジェクト: parhelia512/cocos2d-unity
 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;
     }
 }