示例#1
0
    public void StartGame()
    {
        randomCharacter.SpawnCharacter();
        Game.Instance.PlayerParty.ResetCharacters();
        Game.Instance.CurrentArea = areaObject;

        fade.FadeOut(() => Game.Instance.ChangeScene(sceneTransitionName, UnityEngine.SceneManagement.LoadSceneMode.Single));
    }
    public IEnumerator EncounterCoroutine()
    {
        GameObject character = randomCharacter.SpawnCharacter();

        doorTweener.PlayTween();

        yield return(StartCoroutine(Jump.Instance.JumpCoroutine(character.transform, jumpAmount)));

        Tween outOfCell = character.transform.DOLocalJump(new Vector3(character.transform.localPosition.x, 0, character.transform.localPosition.z - outOfCellDistance), jumpStrength, 1, outOfCellSpeed).SetEase(Ease.InOutQuart);

        yield return(outOfCell.WaitForCompletion());

        character.transform.parent = Game.Instance.PlayerParty.transform;

        yield return(new WaitForSecondsRealtime(waitAfterAction));

        BattleSystem.Instance.SetupPartyPlayer();
        BattleSystem.Instance.UpdateStats();
        LevelGenerator.Instance.Regenerate();
        Game.Instance.SetWalking();
    }