예제 #1
0
    public void SwitchFormNext()
    {
        Vector3 pos = currentPlayerForm.transform.position;

        currentPlayerForm.FreezePosition(true);
        currentPlayerForm.gameObject.SetActive(false);

        int currentPlayerFormIndex = playerForms.IndexOf(currentPlayerForm.transform);
        int nextPlayerFormIndex    = currentPlayerFormIndex + 1;

        if (nextPlayerFormIndex >= playerForms.Count)
        {
            nextPlayerFormIndex = 0;
        }

        currentPlayerForm = playerForms[nextPlayerFormIndex].GetComponent <PlayerForm>();

        currentPlayerForm.gameObject.SetActive(true);
        currentPlayerForm.TeleportToPosition(pos);
        currentPlayerForm.FreezePosition(false);

        Camera.main.GetComponent <MyCamera>().target = currentPlayerForm.transform;

        // TODO: merge SwichForm functions into one
    }
예제 #2
0
 internal void TeleportToPosition(Vector3 position)
 {
     currentPlayerForm.TeleportToPosition(position);
 }