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 }
internal void TeleportToPosition(Vector3 position) { currentPlayerForm.TeleportToPosition(position); }