Пример #1
0
    void OnEntitySpawned(SceneEntityPosAgent agent)
    {
        m_MaxCount++;

        if (!EntityMonsterBeacon.IsBcnMonsterProtoId(agent.protoId))            // not encoded, unexpected agent
        {
            return;
        }

        int spType, lvl, spawnType;

        EntityMonsterBeacon.DecodeBcnMonsterProtoId(agent.protoId, out spType, out lvl, out spawnType);

        int areaType = PeGameMgr.IsStory
            ? PeMappingMgr.Instance.GetAiSpawnMapId(new Vector2(agent.Pos.x, agent.Pos.z))
            : AiUtil.GetMapID(agent.Pos);

        AISpawnTDWavesData.TDMonsterSpData data = AISpawnTDWavesData.GetMonsterSpData(false, spType, lvl, spawnType, areaType);

        float rhp = data != null ? data._rhp : 200.0f;
        float dps = data != null ? data._dps : 50.0f;

        SiegeAgent siegeAgent = new SiegeAgent(this, agent, rhp, dps);

        agent.spInfo = new SiegeAgent.AgentInfo(m_Beacon, siegeAgent);
        m_Agents.Add(siegeAgent);
    }
Пример #2
0
    void OnDeath(SiegeAgent agent)
    {
        m_Agents.Remove(agent);

        if (m_SpawnFinished && m_Agents.Count <= 0)
        {
            GameObject.Destroy(gameObject);
        }

        m_KillCount++;
    }
Пример #3
0
 public AgentInfo(EntityMonsterBeacon bcn, SiegeAgent agent) : base(bcn)
 {
     _agent = agent;
 }