少年修仙传客户端代码仓库
client_Zxw
2018-08-30 61b5058b990da2fe7f4b76e1e61b817d4f511432
Fight/GameActor/GAMgr.cs
@@ -15,6 +15,9 @@
    public event UnityAction<uint> OnGActorRequest;
    public event UnityAction<uint> OnGActorServerDie;
    public event UnityAction<uint> OnFightNpcRequest;
    public event UnityAction<uint> OnFightNpcRelease;
    // 由角色池生成的prefab列表. 用来卸载用的.
    public List<GameObject> needDestroyPrefabList = new List<GameObject>();
    public List<GActorFight> needDieList = new List<GActorFight>();
@@ -422,6 +425,11 @@
            RuntimeLogUtility.AddLog_Green(_content, serverInstID);
#endif
            if (OnFightNpcRequest != null)
            {
                OnFightNpcRequest(npcID);
            }
        }
        return _actor as T;
@@ -566,6 +574,16 @@
    /// <param name="actor"></param>
    public void Release(GActor actor)
    {
        var _npcfight = actor as GActorNpcFight;
        if (_npcfight != null)
        {
            if (OnFightNpcRequest != null)
            {
                OnFightNpcRequest((uint)_npcfight.NpcConfig.NPCID);
            }
        }
#if UNITY_EDITOR
        string _content = string.Format("GAMgr => 对角色 SID: {0}, CID: {1} 进行了回收", actor.ServerInstID, actor.ClientInstID);
        RuntimeLogUtility.AddLog_Green(_content, actor.ServerInstID);