Ejemplo n.º 1
0
    private void DoSpawner(BattleRefreshVo br)
    {
        int        num        = -1;
        Vector3    vector     = Vector3.zero;
        Quaternion quaternion = Quaternion.identity;

        if (br.refreshWay == BattleRefreshWay.Position)
        {
            num = br.posIndex[0];
        }
        else if (br.refreshWay == BattleRefreshWay.RandomPos)
        {
            num = br.posIndex[UnityEngine.Random.Range(0, br.posIndex.Length - 1)];
        }
        else if (br.refreshWay == BattleRefreshWay.UnitPos)
        {
            vector     = ((!(StatisticsManager.S_LastedDeadUnits != null)) ? vector : StatisticsManager.S_LastedDeadUnits.transform.position);
            quaternion = ((!(StatisticsManager.S_LastedDeadUnits != null)) ? quaternion : StatisticsManager.S_LastedDeadUnits.transform.rotation);
        }
        if (num != -1)
        {
            Transform spawnPos = MapManager.Instance.GetSpawnPos(br.teamType, num);
            vector     = spawnPos.position;
            quaternion = spawnPos.rotation;
        }
        this._coroutineManager.StartCoroutine(this.DoSpawnInstance_Coroutinue(br, vector, quaternion), true);
    }
Ejemplo n.º 2
0
 private bool UpdateTimeTrigger(BattleRefreshVo br)
 {
     if (Time.time - this._startTime > br.trigerCdnFloatParam1)
     {
         br.curNumber  += Time.deltaTime;
         br.curNumber2 += Time.deltaTime;
         if (br.curNumber >= br.trigerCdnFloatParam2)
         {
             br.curNumber = 0f;
             this.DoSpawnerByTime(br);
         }
         if (br.curNumber2 >= br.trigerCdnFloatParam3 && br.trigerCdnFloatParam3 != 0f)
         {
             return(true);
         }
     }
     return(false);
 }
Ejemplo n.º 3
0
 private VTrigger CreateTriger(BattleRefreshVo br)
 {
     if (!this._battleRefreshList.ContainsKey(br.br_id))
     {
         this._battleRefreshList.Add(br.br_id, br);
         VTrigger vTrigger = null;
         if (br.trigerCdn == GameEvent.TimeTigger)
         {
             this._battleTimeTrigger.Add(br.br_id);
         }
         else
         {
             vTrigger = TriggerManager.CreateGameEventTrigger(br.trigerCdn, this.GetTriggerCondition(br), new TriggerAction(this.DoSpawnerByTrigger));
             if (vTrigger != null)
             {
                 this._battleTriggerList.Add(vTrigger.trigger_id, br.br_id);
             }
         }
         return(vTrigger);
     }
     return(null);
 }
Ejemplo n.º 4
0
    private void DoSpawnerByTrigger()
    {
        VTrigger        trigger         = TriggerManager.GetTrigger(TriggerType.GameTrigger);
        BattleRefreshVo battleRefreshVo = null;

        if (trigger != null && this._battleTriggerList.ContainsKey(trigger.trigger_id))
        {
            string key = this._battleTriggerList[trigger.trigger_id];
            if (this._battleRefreshList.ContainsKey(key))
            {
                battleRefreshVo = this._battleRefreshList[key];
            }
        }
        if (battleRefreshVo != null)
        {
            this.DoSpawner(battleRefreshVo);
            battleRefreshVo.curNumber += 1f;
            if (battleRefreshVo.curNumber >= (float)battleRefreshVo.cycleNumber && battleRefreshVo.cycleNumber != 0)
            {
                battleRefreshVo.isDestroy = true;
                this._battleRefreshList.Remove(battleRefreshVo.br_id);
            }
        }
    }
Ejemplo n.º 5
0
 private IEnumerator DoSpawnInstance_Coroutinue(BattleRefreshVo br, Vector3 position, Quaternion rotation)
 {
     BattleRefresh.< DoSpawnInstance_Coroutinue > c__Iterator1A3 <DoSpawnInstance_Coroutinue> c__Iterator1A = new BattleRefresh.< DoSpawnInstance_Coroutinue > c__Iterator1A3();
Ejemplo n.º 6
0
 private void DoSpawnerByTime(BattleRefreshVo br)
 {
     this.DoSpawner(br);
 }