Ejemplo n.º 1
0
    void Awake()
    {
        movementAgent    = GetComponent <PlayerMovement>();
        gun              = GetComponent <Gun>();
        blinker          = GetComponent <Blinker>();
        abilityIndicator = GetComponentInChildren <AbilityIndicator>();

        levelSetup = FindObjectOfType <LevelSetup>();
        if (levelSetup)
        {
            levelHasTeleport = levelSetup.teleportActive;
            levelHasEyes     = levelSetup.sightActive;
            levelHasGun      = levelSetup.gunActive;
        }
        else
        {
            levelHasTeleport = levelHasEyes = levelHasGun = true;
        }

        upKey         = keyBinding.moveUp;
        downKey       = keyBinding.moveDown;
        leftKey       = keyBinding.moveLeft;
        rightKey      = keyBinding.moveRight;
        shootKey      = keyBinding.shoot;
        blinkKey      = keyBinding.blink;
        stealGunKey   = keyBinding.stealGun;
        stealEyesKey  = keyBinding.stealEyes;
        stealBlinkKey = keyBinding.stealBlink;

        if (otherPlayer == null)
        {
            var allPlayers = FindObjectsOfType <PlayerInput>();
            if (allPlayers.Length > 1)
            {
                otherPlayer = allPlayers[0] == this ? allPlayers[1] : allPlayers[0];
            }
        }

        if (otherPlayer != null && otherPlayer.playerId == playerId)
        {
            Debug.LogError("SAME PLAYER ID ON PLAYERS OMG");
        }
    }
Ejemplo n.º 2
0
 public void AddAbilityIndicator(AbilityIndicator abilityIndicator)
 {
     m_AbilityIndicators.Add(abilityIndicator);
 }