Example #1
0
        public void ChangeModel(string modelName)
        {
            int layer = model.layer;

            GameObjectManager.DestroyGameObject(model);

            model = GameObjectManager.CreateGameObject(modelName);
            model.transform.SetParent(root.transform);
            model.transform.localPosition    = new Vector3(0, 0, 0);
            model.transform.localEulerAngles = Vector3.zero;
            model.transform.localScale       = Vector3.one;

            model.SetLayer(layer);
        }
Example #2
0
 static int DestroyGameObject(IntPtr L)
 {
     try
     {
         ToLua.CheckArgsCount(L, 1);
         UnityEngine.GameObject arg0 = (UnityEngine.GameObject)ToLua.CheckUnityObject(L, 1, typeof(UnityEngine.GameObject));
         GameObjectManager.DestroyGameObject(arg0);
         return(0);
     }
     catch (Exception e)
     {
         return(LuaDLL.toluaL_exception(L, e));
     }
 }
Example #3
0
        /// <summary>
        /// Destroys this GameObject.
        /// </summary>
        public virtual void Destroy()
        {
            for (int i = 0; i < comps.Count; i++)
            {
                comps[i].Destroy();
            }

            comps.Clear();

            updateComps.Clear();
            unInit.Clear();
            disposableComps.Clear();
            postUpdateComps.Clear();
            priorities.Clear();

            for (int i = 0; i < objRefferences.Count; i++)
            {
                objRefferences[i].Remove(this);
            }

            objRefferences.Clear();

            GameObjectManager.DestroyGameObject(this);
        }
Example #4
0
 public void Dispose()
 {
     GameObjectManager.DestroyGameObject(model);
     GameObject.Destroy(top);
 }