DestroyObject() public static method

public static DestroyObject ( System obj ) : void
obj System
return void
Esempio n. 1
0
        public static void Load()
        {
            try
            {
                var uiRoot             = ToolboxGame.GameManager.m_GameManagerObj;
                var existingComponents = uiRoot.GetComponents(typeof(Component));

                foreach (var existingComponent in existingComponents)
                {
                    var componentName = existingComponent.GetType();

                    if (componentName.Name.Contains("Bootstrap"))
                    {
                        Logger.AppendLine($"Removing {componentName}");
                        var comp = uiRoot.GetComponent(componentName);
                        Object.DestroyObject(comp);
                    }
                }

                var newType = DynamicTypeGenerator.GetNewType(typeof(Bootstrap));
                uiRoot.AddComponent(newType);
            }
            catch (Exception e)
            {
                Logger.AppendLine(e.ToString());
            }
        }
Esempio n. 2
0
    static int DestroyObject(IntPtr L)
    {
        int count = LuaDLL.lua_gettop(L);

        if (count == 1)
        {
            Object arg0 = (Object)LuaScriptMgr.GetLuaObject(L, 1);
            LuaScriptMgr.__gc(L);
            Object.DestroyObject(arg0);
            return(0);
        }
        else if (count == 2)
        {
            Object arg0 = (Object)LuaScriptMgr.GetLuaObject(L, 1);
            float  arg1 = (float)LuaScriptMgr.GetNumber(L, 2);
            LuaScriptMgr.__gc(L);
            Object.DestroyObject(arg0, arg1);
            return(0);
        }
        else
        {
            LuaDLL.luaL_error(L, "invalid arguments to method: Object.DestroyObject");
        }

        return(0);
    }
Esempio n. 3
0
    static int DestroyObject(IntPtr L)
    {
        int count = LuaDLL.lua_gettop(L);

        if (count == 1)
        {
            Object arg0 = (Object)L.ToUserData(1);
            MetaMethods.__gc(L);
            Object.DestroyObject(arg0);
            return(0);
        }
        else if (count == 2)
        {
            Object arg0 = (Object)L.ToUserData(1);
            float  arg1 = (float)L.ChkNumber(2);
            Object.DestroyObject(arg0, arg1);
            return(0);
        }
        else
        {
            LuaDLL.luaL_error(L, "invalid arguments to method: Object.DestroyObject");
        }

        return(0);
    }
Esempio n. 4
0
    /// <summary>
    /// Event handler in response to a remove request
    /// </summary>
    void processRMVW(object sender, CommandProcessEventArgs args)
    {
        if (TSet != null)
        {
            TSet.Release();
        }

        Object.DestroyObject(this);
        Object.DestroyObject(this.gameObject);
    }
 public static int DestroyObject1_wrap(long L)
 {
     try
     {
         UnityObject arg0 = FCGetObj.GetObj <UnityObject>(FCLibHelper.fc_get_wrap_objptr(L, 0));
         UnityObject.DestroyObject(arg0);
     }
     catch (Exception e)
     {
         Debug.LogException(e);
     }
     return(0);
 }
Esempio n. 6
0
 public static int DestroyObject1_wrap(long L)
 {
     try
     {
         long        nThisPtr = FCLibHelper.fc_get_inport_obj_ptr(L);
         UnityObject obj      = get_obj(nThisPtr);
         UnityObject arg0     = FCGetObj.GetObj <UnityObject>(FCLibHelper.fc_get_intptr(L, 0));
         UnityObject.DestroyObject(arg0);
     }
     catch (Exception e)
     {
         Debug.LogException(e);
     }
     return(0);
 }
Esempio n. 7
0
 public static int DestroyObject_wrap(long L)
 {
     try
     {
         long        VM   = FCLibHelper.fc_get_vm_ptr(L);
         UnityObject arg0 = FCGetObj.GetObj <UnityObject>(FCLibHelper.fc_get_wrap_objptr(L, 0));
         float       arg1 = FCLibHelper.fc_get_float(L, 1);
         UnityObject.DestroyObject(arg0, arg1);
     }
     catch (Exception e)
     {
         Debug.LogException(e);
     }
     return(0);
 }
Esempio n. 8
0
        public static void Unload()
        {
            var uiRoot             = ToolboxGame.GameManager.m_GameManagerObj;
            var existingComponents = uiRoot.GetComponents(typeof(Component));

            foreach (var existingComponent in existingComponents)
            {
                var componentName = existingComponent.GetType();

                if (componentName.Name.Contains("Bootstrap"))
                {
                    Logger.AppendLine($"Removing {componentName}");
                    var comp = uiRoot.GetComponent(componentName);
                    Object.DestroyObject(comp);
                }
            }
        }
Esempio n. 9
0
    static int DestroyObject(IntPtr l)
    {
        int count = LuaDLL.lua_gettop(l);

        if (count == 1)
        {
            Object arg0 = (Object)luaMgr.GetNetObject(1);
            Object.DestroyObject(arg0);
            return(0);
        }
        else if (count == 2)
        {
            Object arg0 = (Object)luaMgr.GetNetObject(1);
            float  arg1 = (float)luaMgr.GetNumber(2);
            Object.DestroyObject(arg0, arg1);
            return(0);
        }
        else
        {
            LuaDLL.luaL_error(l, "The best overloaded method match for 'Object.DestroyObject' has some invalid arguments");
        }

        return(0);
    }
Esempio n. 10
0
        public static void DestroyObject(Object obj)
        {
            float t = 0f;

            Object.DestroyObject(obj, t);
        }
Esempio n. 11
0
 /// <summary>
 /// See <see cref="Object.DestroyObject(Object)"/>
 /// </summary>
 public static void DestroyObject(this Plugin ext, Object obj, float t = 0.00f)
 {
     CheckCriticialObject(obj);
     Object.DestroyObject(obj, t);
 }