Пример #1
0
 public void AddNpc(long npcid, INPCView view)
 {
     lock (npcLock)
     {
         if (!Npcs.ContainsKey(npcid))
         {
             Npcs.Add(npcid, view);
         }
     }
 }
Пример #2
0
        public void BindView(INPCView view)
        {
            npcView = view;
            Type type     = view.GetType();
            var  _npcView = view as NPCView;

            if (_npcView != null)
            {
                _npcView.viewObject = this;
                _npcView.gameObject = gameObject;
            }
        }
 static int GetCurrentNpc(IntPtr L)
 {
     try
     {
         ToLua.CheckArgsCount(L, 1);
         FirClient.Manager.NPCManager obj = (FirClient.Manager.NPCManager)ToLua.CheckObject <FirClient.Manager.NPCManager>(L, 1);
         INPCView o = obj.GetCurrentNpc();
         ToLua.PushObject(L, o);
         return(1);
     }
     catch (Exception e)
     {
         return(LuaDLL.toluaL_exception(L, e));
     }
 }
 static int AddNpc(IntPtr L)
 {
     try
     {
         ToLua.CheckArgsCount(L, 3);
         FirClient.Manager.NPCManager obj = (FirClient.Manager.NPCManager)ToLua.CheckObject <FirClient.Manager.NPCManager>(L, 1);
         long     arg0 = LuaDLL.tolua_checkint64(L, 2);
         INPCView arg1 = (INPCView)ToLua.CheckObject <INPCView>(L, 3);
         obj.AddNpc(arg0, arg1);
         return(0);
     }
     catch (Exception e)
     {
         return(LuaDLL.toluaL_exception(L, e));
     }
 }
Пример #5
0
        public void BindView(INPCView view)
        {
            npcView = view;
            Type type = view.GetType();

            if (type == typeof(TankView))
            {
                viewType = ViewType.Tank;
            }
            else if (type == typeof(AnimalView))
            {
                viewType = ViewType.Animal;
            }
            var _npcView = view as NPCView;

            if (_npcView != null)
            {
                _npcView.viewObject = this;
                _npcView.transform  = transform;
                _npcView.gameObject = gameObject;
            }
        }