Пример #1
0
 /// <summary>
 /// 添加NPC
 /// </summary>
 /// <param name="npcId"></param>
 /// <param name="view"></param>
 public void AddNpc(int npcId, INpcView view)
 {
     lock (npcLock)
     {
         if (!Npcs.ContainsKey(npcId))
         {
             Npcs.Add(npcId, view);
         }
     }
 }
Пример #2
0
    public void BindView(INpcView view)
    {
        npcView = view;
        var _npcView = view as NpcView;

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