Inheritance: TouchScript.Layers.TouchLayer
Example #1
0
        private void Awake()
        {
            if (instance == null)
            {
                instance = this;
                DontDestroyOnLoad(gameObject);
            }

            layer = GetComponent<UILayer>();

            if (Application.loadedLevelName == "Examples" && Application.levelCount > 1)
            {
                LoadNextLevel();
            }
        }
        private void Awake()
        {
            if (instance == null)
            {
                instance = this;
                DontDestroyOnLoad(gameObject);
            }

            layer = GetComponent<UILayer>();

            if (SceneManager.GetActiveScene().name == "Examples" && SceneManager.sceneCount > 1)
            {
                LoadNextLevel();
            }
        }
Example #3
0
        private void Awake()
        {
            if (instance == null)
            {
                instance = this;
                DontDestroyOnLoad(gameObject);
            }

            layer = GetComponent<UILayer>();

#if UNITY_5_3
            if (SceneManager.GetActiveScene().name == "Examples" && SceneManager.sceneCountInBuildSettings > 1)
#else
			if (Application.loadedLevelName == "Examples" && Application.levelCount > 1)
#endif
            {
                LoadNextLevel();
            }
        }
Example #4
0
        /// <inheritdoc />
        protected override void Awake()
        {
            if (Application.isPlaying)
            {
                if (instance == null)
                {
                    instance = this;
                }
                if (instance != this)
                {
                    Debug.LogWarning("[TouchScript] Only one instance of UILayer should exist in a scene. Destroying.");
                    Destroy(this);
                    return;
                }
            }

            base.Awake();
            if (!Application.isPlaying)
            {
                return;
            }

            StartCoroutine(lateAwake());
        }
Example #5
0
        /// <inheritdoc />
        protected override void Awake()
        {
            if (Application.isPlaying)
            {
                if (instance == null) instance = this;
                if (instance != this)
                {
                    Debug.LogWarning("[TouchScript] Only one instance of UILayer should exist in a scene. Destroying.");
                    Destroy(this);
                    return;
                }
            }

            base.Awake();
            if (!Application.isPlaying) return;

            StartCoroutine(lateAwake());
        }