コード例 #1
0
    private void Start()
    {
        charactersLoader = new PlayerCharactersLoader(playerCharacters);
        GameObject player = charactersLoader.GetCharacter(CharacterSwapIndexTracker.CurrentId);

        playerRigidbody = player.GetComponent <Rigidbody>();
    }
コード例 #2
0
    private void Start()
    {
        characterLoader = new PlayerCharactersLoader(playerCharacters);
        characterLoader.SetActiveCharacter(CharacterSwapIndexTracker.CurrentId);
        GameObject player = characterLoader.GetCharacter(CharacterSwapIndexTracker.CurrentId);

        playerJump = player.GetComponent <Jump>();
    }
コード例 #3
0
    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;
    }
コード例 #4
0
 private void Start()
 {
     charactersLoader = new PlayerCharactersLoader(playerCharacters);
     target           = charactersLoader.GetCharacter(CharacterSwapIndexTracker.CurrentId).GetComponent <Transform>();
 }