コード例 #1
0
        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;
            }
        }
コード例 #2
0
    public void ReqReborn(int pointID)
    {
        FixedSpawnPointInfo info = null;

        if (_fixedSpawnPointInfos.TryGetValue(pointID, out info))
        {
            ReqReborn(info._agent);
        }
    }
コード例 #3
0
    public void SetEntityByFixedSpId(int pointID, PeEntity entity)
    {
        FixedSpawnPointInfo info = null;

        if (_fixedSpawnPointInfos.TryGetValue(pointID, out info))
        {
            info._agent.entity = entity;
        }
    }
コード例 #4
0
    public SceneEntityPosAgent GetAgentByFixedSpId(int pointID)
    {
        FixedSpawnPointInfo info = null;

        if (_fixedSpawnPointInfos.TryGetValue(pointID, out info))
        {
            return(info._agent);
        }
        return(null);
    }
コード例 #5
0
    public PeEntity GetEntityByFixedSpId(int pointID)
    {
        FixedSpawnPointInfo info = null;

        if (_fixedSpawnPointInfos.TryGetValue(pointID, out info))
        {
            return(info._agent.entity);
        }
        return(null);
    }
コード例 #6
0
    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);
    }
コード例 #7
0
    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);
    }
コード例 #8
0
    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;
            }
        }
    }
コード例 #9
0
 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;
     }
 }
コード例 #10
0
    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);
    }
コード例 #11
0
    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);
                    }
                }
            }
        }
    }