Example #1
0
    private IEnumerator StageStartProcess()
    {
        // Create Map
        MapController.Instance.CreateMap(MapType.FourGimmick);

        playerManager.CreatePlayers();
        List <GameObject> characterObjects = new List <GameObject>();

        Vector2[] createPositions = TeamController.GetCharacterCreatePos(playerManager.Players.Count);
        for (int i = 0; i < playerManager.Players.Count; ++i)
        {
            Player currPlayer = playerManager.Players[i];
            CharacterManager.Instance.Create(currPlayer, TeamController.GetCharacterType(currPlayer.PlayerNumber));
            characterObjects.Add(currPlayer.TargetCharacter.gameObject);
            currPlayer.TargetCharacter.OnDestroyed       += OnCharacterDeath;
            currPlayer.TargetCharacter.transform.position = createPositions[i];
        }
        uiPlayerController.SetPlayers(playerManager.Players.ToArray());
        cameraController.SetTargets(characterObjects.ToArray());

        if (IsEditMode == false)
        {
            yield return(new WaitForSeconds(3f));
        }

        StartCoroutine(StageTimeProcess());
        BgmManager.Instance.Play(BgmType.InGame1);
        uiStageController.ShowReadyStart();

        if (IsEditMode == false)
        {
            yield return(new WaitForSeconds(3f));
        }

        IsStageProcessing = true;
        OnStageStart();
    }