Ejemplo n.º 1
0
    //Assign references
    protected void Assign()
    {
        //Assigning player components
        player          = gameObject; //Since the skills will be a component to the player
        playerHealth    = player.GetComponent <PlayerHealthMult> ();
        playerSkill     = player.GetComponent <PlayerSkillMult> ();
        playerMovement  = player.GetComponent <PlayerMovementMult> ();
        skillActivation = player.GetComponent <SkillActivation> ();

        button.image.sprite = Resources.Load(imagePath, typeof(Sprite)) as Sprite;
        button.GetComponent <Button> ().onClick.AddListener(() => {
            Activate();
        });                              //Assigning skill effect to the button
    }
Ejemplo n.º 2
0
    void Awake()
    {
        GameObject[] players = GameObject.FindGameObjectsWithTag("Player");          //get all the players on the scene

        //Get the player that the enemy will track
        //It will track the player that is standing on the same 'bridge'
        for (int i = 0; i < 2; i++)
        {
            float playerLocationOffset = gameObject.transform.position.y - players[i].transform.position.y;
            if ((playerLocationOffset < Center) && (playerLocationOffset > -(Center)))
            {
                playerSkill = players[i].GetComponent <PlayerSkillMult>();
                playerScore = players[i].GetComponent <PlayerScore>();
            }
        }

        anim          = GetComponent <Animator> ();
        currentHealth = startingHealth;
        enemyMovement = GetComponent <EnemyMovementMult> ();
        enemyAttack   = GetComponent <EnemyAttackMult> ();
    }
Ejemplo n.º 3
0
 // Use this for initialization
 void Start()
 {
     playerHealth   = gameObject.GetComponent <PlayerHealthMult> ();
     playerSkill    = gameObject.GetComponent <PlayerSkillMult> ();
     playerMovement = gameObject.GetComponent <PlayerMovementMult> ();
 }