コード例 #1
0
ファイル: EntityBehavior.cs プロジェクト: hw233/mmoclient
    public SummonBehavior CreateSummon(uint sceneid, string uid, int entityType, GameObject go)
    {
        SummonBehavior t = go.GetComponent <SummonBehavior>();

        if (t == null)
        {
            t = go.AddComponent <SummonBehavior>();
        }
        entityBehaviors.Add(uid, t);
        t.uid        = uid;
        t.entityType = entityType;
        t.sceneid    = sceneid;

        t.OnNewObject();
        return(t);
    }
コード例 #2
0
 static int CreateSummon(IntPtr L)
 {
     try
     {
         ToLua.CheckArgsCount(L, 5);
         EntityBehaviorMgr obj       = (EntityBehaviorMgr)ToLua.CheckObject(L, 1, typeof(EntityBehaviorMgr));
         uint   arg0                 = (uint)LuaDLL.luaL_checknumber(L, 2);
         string arg1                 = ToLua.CheckString(L, 3);
         int    arg2                 = (int)LuaDLL.luaL_checknumber(L, 4);
         UnityEngine.GameObject arg3 = (UnityEngine.GameObject)ToLua.CheckUnityObject(L, 5, typeof(UnityEngine.GameObject));
         SummonBehavior         o    = obj.CreateSummon(arg0, arg1, arg2, arg3);
         ToLua.Push(L, o);
         return(1);
     }
     catch (Exception e)
     {
         return(LuaDLL.toluaL_exception(L, e));
     }
 }