private void Start() { charactersLoader = new PlayerCharactersLoader(playerCharacters); GameObject player = charactersLoader.GetCharacter(CharacterSwapIndexTracker.CurrentId); playerRigidbody = player.GetComponent <Rigidbody>(); }
private void Start() { characterLoader = new PlayerCharactersLoader(playerCharacters); characterLoader.SetActiveCharacter(CharacterSwapIndexTracker.CurrentId); GameObject player = characterLoader.GetCharacter(CharacterSwapIndexTracker.CurrentId); playerJump = player.GetComponent <Jump>(); }
private void SpawnCharacterInMainMenu(int index) { GameObject character = charactersLoader.GetCharacter(index); charactersLoader.SetActiveCharacter(index); Rigidbody rigidBody = character.GetComponent <Rigidbody>(); rigidBody.position = new Vector3(0, 4f, 0); rigidBody.rotation = Quaternion.Euler(45f, 0, 45f); rigidBody.velocity = Vector3.zero; rigidBody.angularVelocity = Vector3.zero; }
private void Start() { charactersLoader = new PlayerCharactersLoader(playerCharacters); target = charactersLoader.GetCharacter(CharacterSwapIndexTracker.CurrentId).GetComponent <Transform>(); }