Exemplo n.º 1
0
    public Player(int playerNum, Color color, List <Strategy> defaultStrategies, GameObject armyPrefab, Tile borderTile, Tile highlightTile, UnityAction <Player> playerLostCallback)
    {
        this.playerNum  = playerNum;
        this.color      = color;
        strategies      = defaultStrategies;
        this.armyPrefab = armyPrefab;
        playerLost.AddListener(playerLostCallback);

        InitTiles(borderTile, highlightTile);
    }
 public override void OnStateEnter(Animator animator, AnimatorStateInfo stateInfo, int layerIndex)
 {
     _nbPlayer    = 0;
     _start       = false;
     _animator    = animator;
     _playerEvent = GameManager.GetInstance().GetPlayerAddedEvent();
     _playerEvent.AddListener(OnPlayerAdded);
     _canvasTitle = GameManager.GetInstance().canvasTitle;
     _canvasTitle.SetActive(true);
     AkSoundEngine.PostEvent("Play_Music_Menu_And_Cinematic", animator.gameObject);
 }
Exemplo n.º 3
0
    void Start()
    {
        initialPosition = transform.position;
        CurrentLife     = TotalLife;
        if (OnDeath == null)
        {
            OnDeath = new PlayerEvent();
        }
        OnDeath.AddListener(Death);

        if (OnRespawn == null)
        {
            OnRespawn = new PlayerEvent();
        }
        OnRespawn.AddListener(Respawn);

        playerEffects = GetComponent <PlayerEffects>();

        if (OnDamage == null)
        {
            OnDamage = new PlayerEvent();
        }
        OnDamage.AddListener(Damage);
    }
Exemplo n.º 4
0
 public void AddCanRecieveListner(UnityAction <GameObject, bool> action)
 {
     _eventCanRecieve.AddListener(action);
 }