Ejemplo n.º 1
0
 // Use this for initialization
 private void Awake()
 {
     _character        = GetComponent <F3DCharacter>();
     _weaponController = GetComponent <F3DWeaponController>();
     _freezable        = GetComponent <Freezeable>();
     _rb2D             = GetComponent <Rigidbody2D>();
     _audio            = GetComponent <F3DCharacterAudio>();
 }
Ejemplo n.º 2
0
 private void Awake()
 {
     _avatar    = GetComponent <F3DCharacterAvatar>();
     _character = GetComponent <F3DCharacter>();
     _freezable = GetComponent <Freezeable>();
     BuildWeaponPaths();
     DeactivateAllWeapons();
     ActivateWeapon(DefaultWeapon);
 }
Ejemplo n.º 3
0
    private IEnumerator RespawnPlayer(GameObject player)
    {
        yield return(new WaitForSeconds(WaitTimeBeforeRespawn));

        F3DCharacter character = player.GetComponent <F3DCharacter>();

        character.RespawnAtInitialPosition();
        EquipPlayerWithWeapon(player, WeaponIdentifier.Knife);
    }
Ejemplo n.º 4
0
    void OnTriggerExit2D(Collider2D other)
    {
        GameObject otherGameObject = other.gameObject;

        if (otherGameObject.CompareTag("Player"))
        {
            F3DCharacter character = otherGameObject.GetComponent <F3DCharacter>();
            character.Suicide();
        }
    }
Ejemplo n.º 5
0
    private void SpawnAllPlayers()
    {
        for (int i = 0; i < NumberOfPlayers; i++)
        {
            Transform  spawnPoint = SpawnPoints[i];
            string     playerName = "Player" + (i + 1);
            GameObject player     = Instantiate(PlayerPrefab, spawnPoint.position, spawnPoint.rotation) as GameObject;
            Players[i]  = player;
            player.name = playerName;

            F3DCharacter playerCharacter = player.GetComponent <F3DCharacter>();
            if (i == 0)
            {
                playerCharacter.inputControllerType = F3DCharacter.InputType.KEYBOAD_MOUSE;
                playerCharacter.inputControllerName = "";
            }
            else
            {
                playerCharacter.inputControllerType = F3DCharacter.InputType.GAMING_CONTROLLER;
                playerCharacter.inputControllerName = "Gamepad" + i;
            }
            EquipPlayerWithWeapon(player, WeaponIdentifier.Knife);
        }
    }