void AliveEntityDeathEvent(SkEntity arg1, SkEntity arg2)
        {
            FixedSpawnPointInfo info = null;

            if (SceneEntityCreatorArchiver.Instance._fixedSpawnPointInfos.TryGetValue(_fixedId, out info))
            {
                SceneMan.RemoveSceneObj(info._agent);

                if (info._needCD > 0.0f)
                {
                    MissionManager.Instance.PeTimeToDo(delegate(){
                        if (info._bActive)
                        {
                            SceneMan.RemoveSceneObj(info._agent);
                            SceneMan.AddSceneObj(info._agent);
                        }
                    }, info._needCD, _fixedId);
                }
                else
                {
                    SceneEntityCreatorArchiver.Instance.SetFixedSpawnPointActive(_fixedId, false);
                }
                SceneEntityCreatorArchiver.Instance.GetEntityByFixedSpId(_fixedId).aliveEntity.deathEvent -= AliveEntityDeathEvent;
            }
        }
    public void ReqReborn(int pointID)
    {
        FixedSpawnPointInfo info = null;

        if (_fixedSpawnPointInfos.TryGetValue(pointID, out info))
        {
            ReqReborn(info._agent);
        }
    }
    public void SetEntityByFixedSpId(int pointID, PeEntity entity)
    {
        FixedSpawnPointInfo info = null;

        if (_fixedSpawnPointInfos.TryGetValue(pointID, out info))
        {
            info._agent.entity = entity;
        }
    }
    public SceneEntityPosAgent GetAgentByFixedSpId(int pointID)
    {
        FixedSpawnPointInfo info = null;

        if (_fixedSpawnPointInfos.TryGetValue(pointID, out info))
        {
            return(info._agent);
        }
        return(null);
    }
    public PeEntity GetEntityByFixedSpId(int pointID)
    {
        FixedSpawnPointInfo info = null;

        if (_fixedSpawnPointInfos.TryGetValue(pointID, out info))
        {
            return(info._agent.entity);
        }
        return(null);
    }
    public bool GetEntityReviveTimeSpId(int pointID, out float cdTime)
    {
        FixedSpawnPointInfo info = null;

        if (_fixedSpawnPointInfos.TryGetValue(pointID, out info))
        {
            cdTime = info._needCD;
            return(true);
        }
        cdTime = 0;
        return(false);
    }
    public void RemoveFixedSpawnPointFromScene(List <int> pointIds)
    {
        List <SceneEntityPosAgent> agents = new List <SceneEntityPosAgent>();
        FixedSpawnPointInfo        info   = null;

        foreach (int id in pointIds)
        {
            if (_fixedSpawnPointInfos.TryGetValue(id, out info) && info._bActive)
            {
                agents.Add(info._agent);
            }
        }
        SceneMan.RemoveSceneObjs(agents);
    }
    private void SetData4FixedSpawnPoint(BinaryReader br)
    {
        FixedSpawnPointInfo info = null;
        int cnt = br.ReadInt32();

        for (int i = 0; i < cnt; i++)
        {
            int  id      = br.ReadInt32();
            bool bActive = br.ReadBoolean();
            if (_fixedSpawnPointInfos.TryGetValue(id, out info))
            {
                info._bActive = bActive;
            }
        }
    }
 private void Init4FixedSpawnPoint()
 {
     foreach (KeyValuePair <int, AISpawnPoint> pair in AISpawnPoint.s_spawnPointData)
     {
         AISpawnPoint pt      = pair.Value;
         int          protoId = pt.resId;
         if (pt.isGroup)
         {
             protoId |= EntityProto.IdGrpMask;
         }
         FixedSpawnPointInfo info = new FixedSpawnPointInfo();
         info._bActive      = pt.active;
         info._needCD       = pt.refreshtime;
         info._agent        = MonsterEntityCreator.CreateAgent(pt.Position, protoId, Vector3.one, Quaternion.Euler(pt.euler));
         info._agent.spInfo = new AgentInfo(pair.Key);
         info._agent.FixPos = pt.fixPosition;
         _fixedSpawnPointInfos[pair.Key] = info;
     }
 }
    public void AddFixedSpawnPointToScene(List <int> pointIds)
    {
        List <SceneEntityPosAgent> agents = new List <SceneEntityPosAgent>();
        FixedSpawnPointInfo        info   = null;

        foreach (int id in pointIds)
        {
            if (_fixedSpawnPointInfos.TryGetValue(id, out info) && info._bActive)
            {
                if (PeGameMgr.IsMultiStory)
                {
                    if (AISpawnPoint.s_spawnPointData[id].active == true)
                    {
                        continue;
                    }
                }
                agents.Add(info._agent);
            }
        }
        SceneMan.AddSceneObjs(agents);
    }
    public void SetFixedSpawnPointActive(int pointID, bool active)
    {
        FixedSpawnPointInfo info = null;

        if (_fixedSpawnPointInfos.TryGetValue(pointID, out info))
        {
            if (PeGameMgr.IsMultiStory)
            {
                if (PlayerNetwork.mainPlayer != null)
                {
                    PlayerNetwork.mainPlayer.RPCServer(EPacketType.PT_AI_SetFixActive, pointID, active);
                }
            }
            else
            {
                info._bActive = active;
                if (null != SceneEntityCreatorArchiver.Instance.GetEntityByFixedSpId(pointID))
                {
                    if (!active)
                    {
                        SceneMan.RemoveSceneObj(info._agent);
                    }
                    else
                    {
                        ReqReborn(info._agent);
                    }
                }
                else
                {
                    if (active)
                    {
                        info._agent.canRide = false;
                        SceneMan.AddSceneObj(info._agent);
                    }
                }
            }
        }
    }