Пример #1
0
        protected virtual void OnSpawnServerStatusChanged(SpawnStatus status)
        {
            var isStarting = status > SpawnStatus.None && status < SpawnStatus.Finalized;

            // If the game is currently starting
            if (isStarting && State != LobbyState.StartingGameServer)
            {
                State = LobbyState.StartingGameServer;
                return;
            }

            // If game is running
            if (status == SpawnStatus.Finalized)
            {
                State = LobbyState.GameInProgress;
                OnGameServerFinalized();
            }

            // If game is aborted / closed
            if (status < SpawnStatus.None)
            {
                // If game was open before
                if (State == LobbyState.StartingGameServer)
                {
                    State = Config.PlayAgainEnabled ? LobbyState.Preparations : LobbyState.FailedToStart;
                    BroadcastChatMessage("Failed to start a game server", true);
                }
                else
                {
                    State = Config.PlayAgainEnabled ? LobbyState.Preparations : LobbyState.GameOver;
                }
            }
        }
        protected void OnStatusChange(SpawnStatus status)
        {
            if (status < SpawnStatus.None)
            {
                // If game was aborted
                Msf.Events.Fire(Msf.EventNames.ShowDialogBox,
                                DialogBoxData.CreateInfo("Game creation aborted"));

                Logs.Error("Game creation aborted");

                // Hide the window
                gameObject.SetActive(false);
            }

            if (status == SpawnStatus.Finalized)
            {
                Request.GetFinalizationData((data, error) => {
                    if (data == null)
                    {
                        Msf.Events.Fire(Msf.EventNames.ShowDialogBox,
                                        DialogBoxData.CreateInfo("Failed to retrieve completion data: " + error));

                        Logs.Error("Failed to retrieve completion data: " + error);

                        Request.Abort();
                        return;
                    }

                    // Completion data received
                    OnFinalizationDataRetrieved(data);
                });
            }
        }
Пример #3
0
        protected void OnStatusChange(SpawnStatus status)
        {
            //We'll display the current status of the request
            Debug.Log(string.Format("Progress: {0}/{1} ({2})", (int)Request.Status, (int)SpawnStatus.Finalized, Request.Status));

            //If game was aborted
            if (status < SpawnStatus.None)
            {
                Debug.Log("Game creation aborted");
                return;
            }

            //Once the SpawnStatus reaches the Finalized state we can get the data from the finished request
            if (status == SpawnStatus.Finalized)
            {
                Request.GetFinalizationData((data, error) =>
                {
                    if (data == null)
                    {
                        Msf.Events.Fire(Msf.EventNames.ShowDialogBox,
                                        DialogBoxData.CreateInfo("Failed to retrieve completion data: " + error));

                        Logs.Error("Failed to retrieve completion data: " + error);

                        Request.Abort();
                        return;
                    }

                    // Completion data received
                    OnFinalizationDataRetrieved(data);
                });
            }
        }
Пример #4
0
    protected void SelectStatus(int level)  // Select SpawnStatus 的副程式
    {
        switch (level)
        {
        case 1:                                                            // 1D形狀
            spawnStatus = (byte)100 + (SpawnStatus)Random.Range(0, 6) + 1; // 1~6
            break;

        case 2:                                                            // 反向 1D形狀
            spawnStatus = (byte)150 + (SpawnStatus)Random.Range(0, 6) + 1; // 1~6
            break;

        case 3:                                                             // 2D形狀
            spawnStatus = (byte)200 + (SpawnStatus)Random.Range(0, 12) + 1; // 1~12
            break;

        case 4:                                                             // 反向 2D形狀
            spawnStatus = (byte)226 + (SpawnStatus)Random.Range(0, 12) + 1; // 1~12
            break;

        case 5:                                                            // 自訂形狀
            spawnStatus = (byte)212 + (SpawnStatus)Random.Range(0, 6) + 1; // 1~6
            break;

        case 6:                                                            // 反向 自訂
            spawnStatus = (byte)238 + (SpawnStatus)Random.Range(0, 6) + 1; // 1~6
            break;
        }
    }
Пример #5
0
    void Update()
    {
        if (spawnStatus == SpawnStatus.INACTIVE)
        {
            spawnStatus = SpawnStatus.ACTIVE;

            Invoke("Spawn", Random.Range(spawnMinTime, spawnMaxTime));
            Invoke("Inactive", Random.Range(spawnMaxTime - timeFactor, spawnMaxTime + timeFactor));
        }
    }
    void Update()
    {
        if (spawnStatus == SpawnStatus.INACTIVE)
        {
            RaycastHit2D hit = Physics2D.Raycast(transform.position, -transform.up, float.MaxValue, layerMask);

            if (hit.transform != null)
            {
                if (hit.transform.tag == "Player")
                {
                    spawnStatus = SpawnStatus.ACTIVE;

                    Invoke("Spawn", Random.Range(spawnMinTime, spawnMaxTime));
                    Invoke("Inactive", Random.Range(spawnMaxTime - timeFactor, spawnMaxTime + timeFactor));
                }
            }
        }
    }
Пример #7
0
    void Update()
    {
        if (spawnStatus == SpawnStatus.INACTIVE)
        {
            RaycastHit2D hit = Physics2D.Raycast(transform.position, -transform.up, float.MaxValue, layerMask);

            if (hit.transform != null)
            {
                if (hit.transform.tag == "Player")
                {
                    spawnStatus = SpawnStatus.ACTIVE;

                    Invoke("Spawn", Random.Range(spawnMinTime, spawnMaxTime));
                    Invoke("Inactive", Random.Range(spawnMaxTime - timeFactor, spawnMaxTime + timeFactor));
                }
            }
        }
    }
        protected void OnStatusChange(SpawnStatus status)
        {
            if (status < SpawnStatus.None)
            {
                Debug.Log("Game creation aborted");

                // Hide the window
                gameObject.SetActive(false);
            }

            if (status == SpawnStatus.Finalized)
            {
                Request.GetFinalizationData(OnFinalizationDataRetrieved, error =>
                {
                    Debug.Log("Failed to retrieve completion data: " + error);
                    Request.Abort();
                });
            }
        }
Пример #9
0
        //Hardcode tryFix
        public void onStatusChangedHardcoded(SpawnStatus s)
        {
            // Send status update
            var msg = Msf.Create.Message((short)MsfOpCodes.SpawnRequestStatusChange, new SpawnStatusUpdatePacket()
            {
                SpawnId = this.SpawnId,
                Status  = _status
            });

            foreach (IPeer p in peersInRoom)
            {
                p.SendMessage(msg);
            }

            if (_status == SpawnStatus.Finalized)
            {
                peersInRoom.Clear();
            }
        }
    private void Inactive()
    {
        spawnStatus = SpawnStatus.INACTIVE;

        CancelInvoke("Inactive");
    }
Пример #11
0
 public override void FromBinaryReader(EndianBinaryReader reader)
 {
     SpawnId = reader.ReadInt32();
     Status  = (SpawnStatus)reader.ReadInt32();
 }
    // Update is called once per frame
    void Update()
    {
        if (TimeBetweenWaves > 0)
        {
            TimeBetweenWaves -= Time.deltaTime;
            if (TimeBetweenWaves <= 0.1f)
            {
                Status = SpawnStatus.WAIT;
                int _difficultyCountDown = DifficultyIdx;

                if (DifficultyIdx != 1)
                {
                    SpawnPickables();
                }

                while (_difficultyCountDown > 0)
                {
                    if (_difficultyCountDown > _bossRate && Random.Range(0, 100) > 25)
                    {
                        if (BossPortals.Count > 0)
                        {
                            var child = Instantiate(BossPortals[Random.Range(0, BossPortals.Count)]);
                            child.transform.parent = transform;
                            _difficultyCountDown  -= _bossRate;
                        }
                    }
                    else if (_difficultyCountDown > _hardRate && Random.Range(0, 100) > 25)
                    {
                        if (HardPortals.Count > 0)
                        {
                            var child = Instantiate(HardPortals[Random.Range(0, HardPortals.Count)]);
                            child.transform.parent = transform;
                            _difficultyCountDown  -= _hardRate;
                        }
                    }
                    else if (_difficultyCountDown > _mediumRate && Random.Range(0, 100) > 25)
                    {
                        if (MediumPortals.Count > 0)
                        {
                            var child = Instantiate(MediumPortals[Random.Range(0, MediumPortals.Count)]);
                            child.transform.parent = transform;
                            _difficultyCountDown  -= _mediumRate;
                        }
                    }
                    else
                    {
                        var child = Instantiate(EasyPortals[Random.Range(0, EasyPortals.Count)], transform);
                        child.SetActive(true);
                        _difficultyCountDown -= _easyRate;
                    }
                }

                DifficultyIdx   += 1;
                TimeBetweenWaves = 0;
            }
        }
        else
        {
            if (Status == SpawnStatus.SPAWN)
            {
                TimeBetweenWaves = DefaultTimeBetweenWaves;
                foreach (var portal in GameObject.FindGameObjectsWithTag("Portal"))
                {
                    Destroy(portal.gameObject);
                }
            }
        }
    }
Пример #13
0
    private void Inactive()
    {
        spawnStatus = SpawnStatus.INACTIVE;

        CancelInvoke("Inactive");
    }
 public void Deserialize(DeserializeEvent e)
 {
     SpawnTaskID = e.Reader.ReadInt32();
     Status      = (SpawnStatus)e.Reader.ReadInt32();
 }
Пример #15
0
    /// <summary>
    /// 產生老鼠
    /// </summary>
    /// <param name="spawnStatus">產生方式</param>
    /// <param name="miceName">老鼠名稱</param>
    /// <param name="spawnTime">老鼠產生間隔</param>
    /// <param name="intervalTime">每次間隔</param>
    /// <param name="lerpTime">加速度</param>
    /// <param name="spawnCount">產生數量</param>
    /// <param name="isSkill">是否為技能調用</param>
    protected void Spawn(SpawnStatus spawnStatus, string miceName, float spawnTime, float intervalTime, float lerpTime, int spawnCount, bool isSkill)
    {
        Random.seed = unchecked ((int)System.DateTime.Now.Ticks);

        if ((byte)spawnStatus < 200)
        {
            switch (spawnStatus)              // 產生模式選擇
            {
                #region Case 1D
            case SpawnStatus.Random:
            {
                RunCoroutine(coroutine = miceSpawner.SpawnByRandom(miceName, SpawnData.aLineL, spawnTime, intervalTime, lerpTime, spawnCount, isSkill));
                break;
            }

            case SpawnStatus.LineL:
            {
                RunCoroutine(coroutine = miceSpawner.SpawnBy1D(miceName, SpawnData.aLineL, spawnTime, intervalTime, lerpTime, spawnCount, Random.Range(0, SpawnData.aLineL.Length), isSkill));
                break;
            }

            case SpawnStatus.LineR:
            {
                RunCoroutine(coroutine = miceSpawner.SpawnBy1D(miceName, SpawnData.aLineR, spawnTime, intervalTime, lerpTime, spawnCount, Random.Range(0, SpawnData.aLineR.Length), isSkill));
                break;
            }

            case SpawnStatus.LinkLineL:
            {
                RunCoroutine(coroutine = miceSpawner.SpawnBy1D(miceName, SpawnData.aLinkLineL, spawnTime, intervalTime, lerpTime, spawnCount, Random.Range(0, SpawnData.aLinkLineL.Length), isSkill));
                break;
            }

            case SpawnStatus.LinkLineR:
            {
                RunCoroutine(coroutine = miceSpawner.SpawnBy1D(miceName, SpawnData.aLinkLineR, spawnTime, intervalTime, lerpTime, spawnCount, Random.Range(0, SpawnData.aLinkLineR.Length), isSkill));
                break;
            }

            case SpawnStatus.CircleLD:
            {
                RunCoroutine(coroutine = miceSpawner.SpawnBy1D(miceName, SpawnData.aCircleLD, spawnTime, intervalTime, lerpTime, spawnCount, Random.Range(0, SpawnData.aCircleLD.Length), isSkill));
                break;
            }

            case SpawnStatus.CircleRU:
            {
                RunCoroutine(coroutine = miceSpawner.SpawnBy1D(miceName, SpawnData.aCircleRU, spawnTime, intervalTime, lerpTime, spawnCount, Random.Range(0, SpawnData.aCircleRU.Length), isSkill));
                break;
            }
                #endregion

                #region Case Opposite 1D
            case SpawnStatus.ReLineL:
            {
                RunCoroutine(coroutine = miceSpawner.ReSpawnBy1D(miceName, SpawnData.aLineL, spawnTime, intervalTime, lerpTime, spawnCount, Random.Range(0, SpawnData.aCircleRU.Length) + 1, isSkill));
                break;
            }

            case SpawnStatus.ReLineR:
            {
                RunCoroutine(coroutine = miceSpawner.ReSpawnBy1D(miceName, SpawnData.aLineR, spawnTime, intervalTime, lerpTime, spawnCount, Random.Range(0, SpawnData.aCircleRU.Length) + 1, isSkill));
                break;
            }

            case SpawnStatus.ReLinkLineL:
            {
                RunCoroutine(coroutine = miceSpawner.ReSpawnBy1D(miceName, SpawnData.aLinkLineL, spawnTime, intervalTime, lerpTime, spawnCount, Random.Range(0, SpawnData.aCircleRU.Length) + 1, isSkill));
                break;
            }

            case SpawnStatus.ReLinkLineR:
            {
                RunCoroutine(coroutine = miceSpawner.ReSpawnBy1D(miceName, SpawnData.aLinkLineR, spawnTime, intervalTime, lerpTime, spawnCount, Random.Range(0, SpawnData.aCircleRU.Length) + 1, isSkill));
                break;
            }

            case SpawnStatus.ReCircleLD:
            {
                RunCoroutine(coroutine = miceSpawner.ReSpawnBy1D(miceName, SpawnData.aCircleLD, spawnTime, intervalTime, lerpTime, spawnCount, Random.Range(0, SpawnData.aCircleRU.Length) + 1, isSkill));
                break;
            }

            case SpawnStatus.ReCircleRU:
            {
                RunCoroutine(coroutine = miceSpawner.ReSpawnBy1D(miceName, SpawnData.aCircleRU, spawnTime, intervalTime, lerpTime, spawnCount, Random.Range(0, SpawnData.aCircleRU.Length) + 1, isSkill));
                break;
            }
                #endregion
            }
        }
        else
        {
            switch (spawnStatus)              // 產生模式選擇
            {
                #region Case 2D
            case SpawnStatus.VerticalL:
            {
                RunCoroutine(coroutine = miceSpawner.SpawnBy2D(miceName, SpawnData.aVertL2D, spawnTime, intervalTime, lerpTime, spawnCount, Random.Range(0, SpawnData.aVertL2D.GetLength(0)), Random.Range(0, SpawnData.aVertL2D.GetLength(1)), isSkill));
                break;
            }

            case SpawnStatus.VerticalR:
            {
                RunCoroutine(coroutine = miceSpawner.SpawnBy2D(miceName, SpawnData.aVertR2D, spawnTime, intervalTime, lerpTime, spawnCount, Random.Range(0, SpawnData.aVertR2D.GetLength(0)), Random.Range(0, SpawnData.aVertR2D.GetLength(1)), isSkill));
                break;
            }

            case SpawnStatus.LinkVertL:
            {
                RunCoroutine(coroutine = miceSpawner.SpawnBy2D(miceName, SpawnData.aLinkVertL2D, spawnTime, intervalTime, lerpTime, spawnCount, Random.Range(0, SpawnData.aLinkVertL2D.GetLength(0)), Random.Range(0, SpawnData.aLinkVertL2D.GetLength(1)), isSkill));
                break;
            }

            case SpawnStatus.LinkVertR:
            {
                RunCoroutine(coroutine = miceSpawner.SpawnBy2D(miceName, SpawnData.aLinkVertR2D, spawnTime, intervalTime, lerpTime, spawnCount, Random.Range(0, SpawnData.aLinkVertR2D.GetLength(0)), Random.Range(0, SpawnData.aLinkVertR2D.GetLength(1)), isSkill));
                break;
            }

            case SpawnStatus.HorizontalD:
            {
                RunCoroutine(coroutine = miceSpawner.SpawnBy2D(miceName, SpawnData.aHorD2D, spawnTime, intervalTime, lerpTime, spawnCount, Random.Range(0, SpawnData.aHorD2D.GetLength(0)), Random.Range(0, SpawnData.aHorD2D.GetLength(1)), isSkill));
                break;
            }

            case SpawnStatus.HorizontalU:
            {
                RunCoroutine(coroutine = miceSpawner.SpawnBy2D(miceName, SpawnData.aHorU2D, spawnTime, intervalTime, lerpTime, spawnCount, Random.Range(0, SpawnData.aHorU2D.GetLength(0)), Random.Range(0, SpawnData.aHorU2D.GetLength(1)), isSkill));
                break;
            }

            case SpawnStatus.LinkHorD:
            {
                RunCoroutine(coroutine = miceSpawner.SpawnBy2D(miceName, SpawnData.aLinkHorD2D, spawnTime, intervalTime, lerpTime, spawnCount, Random.Range(0, SpawnData.aLinkHorD2D.GetLength(0)), Random.Range(0, SpawnData.aLinkHorD2D.GetLength(1)), isSkill));
                break;
            }

            case SpawnStatus.LinkHorU:
            {
                RunCoroutine(coroutine = miceSpawner.SpawnBy2D(miceName, SpawnData.aLinkHorU2D, spawnTime, intervalTime, lerpTime, spawnCount, Random.Range(0, SpawnData.aLinkHorU2D.GetLength(0)), Random.Range(0, SpawnData.aLinkHorU2D.GetLength(1)), isSkill));
                break;
            }

            case SpawnStatus.HorTwin:
            {
                RunCoroutine(coroutine = miceSpawner.SpawnBy2D(miceName, SpawnData.aHorTwin2D, spawnTime, intervalTime, lerpTime, spawnCount, Random.Range(0, SpawnData.aHorTwin2D.GetLength(0)), Random.Range(0, SpawnData.aHorTwin2D.GetLength(1)), isSkill));
                break;
            }

            case SpawnStatus.VertTwin:
            {
                RunCoroutine(coroutine = miceSpawner.SpawnBy2D(miceName, SpawnData.aVertTwin2D, spawnTime, intervalTime, lerpTime, spawnCount, Random.Range(0, SpawnData.aVertTwin2D.GetLength(0)), Random.Range(0, SpawnData.aVertTwin2D.GetLength(1)), isSkill));
                break;
            }

            case SpawnStatus.LinkHorTwin:
            {
                RunCoroutine(coroutine = miceSpawner.SpawnBy2D(miceName, SpawnData.aLinkHorTwin2D, spawnTime, intervalTime, lerpTime, spawnCount, Random.Range(0, SpawnData.aLinkHorTwin2D.GetLength(0)), Random.Range(0, SpawnData.aLinkHorTwin2D.GetLength(1)), isSkill));
                break;
            }

            case SpawnStatus.LinkVertTwin:
            {
                RunCoroutine(coroutine = miceSpawner.SpawnBy2D(miceName, SpawnData.aLinkVertTwin2D, spawnTime, intervalTime, lerpTime, spawnCount, Random.Range(0, SpawnData.aLinkVertTwin2D.GetLength(0)), Random.Range(0, SpawnData.aLinkVertTwin2D.GetLength(1)), isSkill));
                break;
            }
                #endregion

                #region Case Opposite 2D
            case SpawnStatus.ReVerticalL:
            {
                RunCoroutine(coroutine = miceSpawner.ReSpawnBy2D(miceName, SpawnData.aVertL2D, spawnTime, intervalTime, lerpTime, spawnCount, Random.Range(0, SpawnData.aVertL2D.GetLength(0)) + 1, Random.Range(0, SpawnData.aVertL2D.GetLength(1)) + 1, isSkill));
                break;
            }

            case SpawnStatus.ReVerticalR:
            {
                RunCoroutine(coroutine = miceSpawner.ReSpawnBy2D(miceName, SpawnData.aVertR2D, spawnTime, intervalTime, lerpTime, spawnCount, Random.Range(0, SpawnData.aVertR2D.GetLength(0)) + 1, Random.Range(0, SpawnData.aVertR2D.GetLength(1)) + 1, isSkill));
                break;
            }

            case SpawnStatus.ReLinkVertL:
            {
                RunCoroutine(coroutine = miceSpawner.ReSpawnBy2D(miceName, SpawnData.aLinkVertL2D, spawnTime, intervalTime, lerpTime, spawnCount, Random.Range(0, SpawnData.aLinkVertL2D.GetLength(0)) + 1, Random.Range(0, SpawnData.aLinkVertL2D.GetLength(1)) + 1, isSkill));
                break;
            }

            case SpawnStatus.ReLinkVertR:
            {
                RunCoroutine(coroutine = miceSpawner.ReSpawnBy2D(miceName, SpawnData.aLinkVertR2D, spawnTime, intervalTime, lerpTime, spawnCount, Random.Range(0, SpawnData.aLinkVertR2D.GetLength(0)) + 1, Random.Range(0, SpawnData.aLinkVertR2D.GetLength(1)) + 1, isSkill));
                break;
            }

            case SpawnStatus.ReHorizontalD:
            {
                RunCoroutine(coroutine = miceSpawner.ReSpawnBy2D(miceName, SpawnData.aHorD2D, spawnTime, intervalTime, lerpTime, spawnCount, Random.Range(0, SpawnData.aHorD2D.GetLength(0)) + 1, Random.Range(0, SpawnData.aHorD2D.GetLength(1)) + 1, isSkill));
                break;
            }

            case SpawnStatus.ReHorizontalU:
            {
                RunCoroutine(coroutine = miceSpawner.ReSpawnBy2D(miceName, SpawnData.aHorU2D, spawnTime, intervalTime, lerpTime, spawnCount, Random.Range(0, SpawnData.aHorU2D.GetLength(0)) + 1, Random.Range(0, SpawnData.aHorU2D.GetLength(1)) + 1, isSkill));
                break;
            }

            case SpawnStatus.ReLinkHorD:
            {
                RunCoroutine(coroutine = miceSpawner.ReSpawnBy2D(miceName, SpawnData.aLinkHorD2D, spawnTime, intervalTime, lerpTime, spawnCount, Random.Range(0, SpawnData.aLinkHorD2D.GetLength(0)) + 1, Random.Range(0, SpawnData.aLinkHorD2D.GetLength(1)) + 1, isSkill));
                break;
            }

            case SpawnStatus.ReLinkHorU:
            {
                RunCoroutine(coroutine = miceSpawner.ReSpawnBy2D(miceName, SpawnData.aLinkHorU2D, spawnTime, intervalTime, lerpTime, spawnCount, Random.Range(0, SpawnData.aLinkHorU2D.GetLength(0)) + 1, Random.Range(0, SpawnData.aLinkHorU2D.GetLength(1)) + 1, isSkill));
                break;
            }

            case SpawnStatus.ReHorTwin:
            {
                RunCoroutine(coroutine = miceSpawner.ReSpawnBy2D(miceName, SpawnData.aHorTwin2D, spawnTime, intervalTime, lerpTime, spawnCount, Random.Range(0, SpawnData.aHorTwin2D.GetLength(0)) + 1, Random.Range(0, SpawnData.aHorTwin2D.GetLength(1)) + 1, isSkill));
                break;
            }

            case SpawnStatus.ReVertTwin:
            {
                RunCoroutine(coroutine = miceSpawner.ReSpawnBy2D(miceName, SpawnData.aVertTwin2D, spawnTime, intervalTime, lerpTime, spawnCount, Random.Range(0, SpawnData.aVertTwin2D.GetLength(0)) + 1, Random.Range(0, SpawnData.aVertTwin2D.GetLength(1)) + 1, isSkill));
                break;
            }

            case SpawnStatus.ReLinkHorTwin:
            {
                RunCoroutine(coroutine = miceSpawner.ReSpawnBy2D(miceName, SpawnData.aLinkHorTwin2D, spawnTime, intervalTime, lerpTime, spawnCount, Random.Range(0, SpawnData.aLinkHorTwin2D.GetLength(0)) + 1, Random.Range(0, SpawnData.aLinkHorTwin2D.GetLength(1)) + 1, isSkill));
                break;
            }

            case SpawnStatus.ReLinkVertTwin:
            {
                RunCoroutine(coroutine = miceSpawner.ReSpawnBy2D(miceName, SpawnData.aLinkVertTwin2D, spawnTime, intervalTime, lerpTime, spawnCount, Random.Range(0, SpawnData.aLinkVertTwin2D.GetLength(0)) + 1, Random.Range(0, SpawnData.aLinkVertTwin2D.GetLength(1)) + 1, isSkill));
                break;
            }
                #endregion

                #region Case Custom
            case SpawnStatus.TriangleLD:
            {
                RunCoroutine(coroutine = miceSpawner.SpawnByCustom(miceName, SpawnData.jaTriangleLD2D, spawnTime, intervalTime, lerpTime, spawnCount, isSkill));
                break;
            }

            case SpawnStatus.TriangleLU:
            {
                RunCoroutine(coroutine = miceSpawner.SpawnByCustom(miceName, SpawnData.jaTriangleLU2D, spawnTime, intervalTime, lerpTime, spawnCount, isSkill));
                break;
            }

            case SpawnStatus.TriangleRD:
            {
                RunCoroutine(coroutine = miceSpawner.SpawnByCustom(miceName, SpawnData.jaTriangleRD2D, spawnTime, intervalTime, lerpTime, spawnCount, isSkill));
                break;
            }

            case SpawnStatus.TriangleRU:
            {
                RunCoroutine(coroutine = miceSpawner.SpawnByCustom(miceName, SpawnData.jaTriangleRU2D, spawnTime, intervalTime, lerpTime, spawnCount, isSkill));
                break;
            }

            case SpawnStatus.BevelL:
            {
                RunCoroutine(coroutine = miceSpawner.SpawnByCustom(miceName, SpawnData.jaBevelL2D, spawnTime, intervalTime, lerpTime, spawnCount, isSkill));
                break;
            }

            case SpawnStatus.BevelR:
            {
                RunCoroutine(coroutine = miceSpawner.SpawnByCustom(miceName, SpawnData.jaBevelR2D, spawnTime, intervalTime, lerpTime, spawnCount, isSkill));
                break;
            }
                #endregion

                #region Case Opposite Custom
            case SpawnStatus.ReTriangleLD:
            {
                RunCoroutine(coroutine = miceSpawner.ReSpawnByCustom(miceName, SpawnData.jaTriangleLD2D, spawnTime, intervalTime, lerpTime, spawnCount, isSkill));
                break;
            }

            case SpawnStatus.ReTriangleLU:
            {
                RunCoroutine(coroutine = miceSpawner.ReSpawnByCustom(miceName, SpawnData.jaTriangleLU2D, spawnTime, intervalTime, lerpTime, spawnCount, isSkill));
                break;
            }

            case SpawnStatus.ReTriangleRD:
            {
                RunCoroutine(coroutine = miceSpawner.ReSpawnByCustom(miceName, SpawnData.jaTriangleRD2D, spawnTime, intervalTime, lerpTime, spawnCount, isSkill));
                break;
            }

            case SpawnStatus.ReTriangleRU:
            {
                RunCoroutine(coroutine = miceSpawner.ReSpawnByCustom(miceName, SpawnData.jaTriangleRU2D, spawnTime, intervalTime, lerpTime, spawnCount, isSkill));
                break;
            }

            case SpawnStatus.ReBevelL:
            {
                RunCoroutine(coroutine = miceSpawner.ReSpawnByCustom(miceName, SpawnData.jaBevelL2D, spawnTime, intervalTime, lerpTime, spawnCount, isSkill));
                break;
            }

            case SpawnStatus.ReBevelR:
            {
                RunCoroutine(coroutine = miceSpawner.ReSpawnByCustom(miceName, SpawnData.jaBevelR2D, spawnTime, intervalTime, lerpTime, spawnCount, isSkill));
                break;
            }
                #endregion
            }
        }
    }
Пример #16
0
 /// <summary>
 /// 重複調用Spawn
 /// </summary>
 /// <param name="spawnStatus">產生方式</param>
 /// <param name="miceName">老鼠名稱</param>
 /// <param name="spawnTime">老鼠產生間隔</param>
 /// <param name="intervalTime">每次間隔</param>
 /// <param name="lerpTime">加速度</param>
 /// <param name="spawnCount">產生數量</param>
 /// <param name="isSkill">是否為技能調用</param>
 /// <param name="RepeatTime">多久調用一次</param>
 protected IEnumerator Spawn(SpawnStatus spawnStatus, string miceName, float spawnTime, float intervalTime, float lerpTime, int spawnCount, bool isSkill, float RepeatTime)
 {
     Spawn(spawnStatus, miceName, spawnTime, intervalTime, lerpTime, spawnCount, isSkill);
     yield return(new WaitForSeconds(RepeatTime));
 }