Exemple #1
0
        //--------------------------------------
        //  Methods
        //--------------------------------------

        ///<summary>
        ///	 Persist Instance
        ///</summary>
        public void Awake()
        {
            //
            DontDestroyOnLoad(this);
                        #pragma warning disable
            if (SimpleGameManagerComponent.Instance == null)
            {
                SimpleGameManagerComponent dummy = SimpleGameManagerComponent.Instance;
            }
                        #pragma warning restore
        }
Exemple #2
0
        ///<summary>
        ///	Create a child GameObject by name but only if it doesn't already exist
        ///</summary>
        private static GameObject _CreateChildGameObjectIfNotAlreadyCreated(GameObject aParent_gameobject, string desiredChildGameObjectName_string)
        {
            GameObject child_gameobject = SimpleGameManagerComponent._FindChildGameObjectWithName(aParent_gameobject.name, desiredChildGameObjectName_string);

            if (child_gameobject == null)
            {
                //
                child_gameobject = new GameObject(desiredChildGameObjectName_string);
                DontDestroyOnLoad(child_gameobject);
                child_gameobject.transform.parent = aParent_gameobject.transform;
            }
            return(child_gameobject);
        }