Exemplo n.º 1
0
 void Awake()
 {
     anim           = GetComponent <Animator> ();
     playerAudio    = GetComponent <AudioSource> ();
     playerMovement = GetComponent <CompleteProject.PlayerMovement> ();
     //playerShooting = GetComponentInChildren <PlayerShooting> ();
     currentHealth = startingHealth;
 }
Exemplo n.º 2
0
        PlayerMovement playerMovement;                              // Reference to the player's movement.                           // Reference to the PlayerShooting script.
       // bool isDead;                                                // Whether the player is dead.
        //bool damaged;                                               // True when the player gets damaged.
        //ParticleSystem bloodParticles;

        void Awake()
        {
            // Setting up the references.
            anim = GetComponent<Animator>();
           // playerAudio = GetComponent<AudioSource>();
            playerMovement = GetComponent<PlayerMovement>();

            // Set the initial health of the player.
            currentHealth = startingHealth;
        }
Exemplo n.º 3
0
		void Awake ()
		{
			anim = GetComponent <Animator> ();
			playerAudio = GetComponent <AudioSource> ();
			playerMovement = GetComponent <PlayerMovement> ();
			playerShooting = GetComponentInChildren <PlayerShooting> ();
			shieldBuff = GetComponent<ShieldBuff> ();
			updateSlider = healthSlider.GetComponent<UpdateSlider> ();

			currentHealth = startingHealth;
		}
        void Awake()
        {
            // Setting up the references.
            anim = GetComponent <Animator> ();
            playerAudio = GetComponents <AudioSource> ();
            playerMovement = GetComponent <PlayerMovement> ();
            playerShooting = GetComponentInChildren <PlayerShooting> ();

            // Set the initial health of the player.
            currentHealth = MAX_HEALTH;
        }
Exemplo n.º 5
0
    bool damaged;                                               // True when the player gets damaged.


    void Awake()
    {
        // Setting up the references.
        anim           = GetComponent <Animator>();
        playerAudio    = GetComponent <AudioSource>();
        playerMovement = GetComponent <CompleteProject.PlayerMovement>();
        playerShooting = GetComponentInChildren <Bombs_PlayerShooting>();

        // Set the initial health of the player.
        currentHealth = startingHealth;
    }
Exemplo n.º 6
0
        void Awake()
        {
            // Setting up the references.
            anim = GetComponent<Animator>();
            playerMovement = GetComponent<PlayerMovement>();
            playerShooting = GetComponentInChildren<PlayerShooting>();
            hurtAudio = FMOD_StudioSystem.instance.GetEvent("event:/sfx/player/playerHit");

            // Set the initial health of the player.
            currentHealth = startingHealth;
        }
Exemplo n.º 7
0
        void Awake()
        {
            // Setting up the references.
            anim = GetComponent <Animator> ();
            playerAudio = GetComponent <AudioSource> ();
            playerMovement = GetComponent <PlayerMovement> ();
            playerShooting = GetComponentInChildren <PlayerShooting> ();

            // Set the initial health of the player.
            currentHealth = startingHealth;

            playerRigidbody = GetComponent <Rigidbody> ();
        }
Exemplo n.º 8
0
    private void OnTriggerEnter(Collider other)
    {
        if (other.gameObject.name == "Player")
        {
            CompleteProject.PlayerMovement health = other.GetComponent <CompleteProject.PlayerMovement>();

            if (health != null)
            {
                health.Damage(proyectileDamage);
            }
        }
        Destroy(gameObject, 1f);
    }
Exemplo n.º 9
0
    private void InitializeVariablesAndReferences()
    {
        player        = GameObject.FindGameObjectWithTag("Player");
        enemies       = GameObject.Find("Enemies");
        healthPickups = GameObject.Find("HealthPickups");
        ammoPickups   = GameObject.Find("AmmoPickups");
        bat           = player.transform.Find("Bat").gameObject;

        ph = player.GetComponent <PlayerHealth>();
        pm = player.GetComponent <CompleteProject.PlayerMovement>();
        ps = player.transform.Find("GunBarrelEnd").gameObject.GetComponent <PlayerShooting>();

        ShouldCalculateSequence = true;
    }
Exemplo n.º 10
0
		void Awake()
		{
			playerShooting = gunBarrellEnd.GetComponent<PlayerShooting> ();
			playerMovement = player.GetComponent<PlayerMovement> ();

			gunColor = gunBarrellEnd.GetComponent<Light> ();
			startLightColor = gunColor.color;

			lineRendererMaterial = gunBarrellEnd.GetComponent<LineRenderer> ();
			startLineRendererMaterial = lineRendererMaterial.material;

			particleSystem = gunBarrellEnd.GetComponent<ParticleSystem> ();
			particleSystemStartColor = particleSystem.startColor;
		}
Exemplo n.º 11
0
    // Use this for initialization
    void Awake()
    {
        HCI_Project.Library.Avatar avatar = new HCI_Project.Library.Avatar();
        Global.Avatar = avatar;
        if (Global.Player != null)
        {
            Global.Player.EventManager.OnRemoteOperation += EventManager_OnRemoteOperation;
        }

        avatar.OnHP_Changed   += Avatar_OnHP_Changed;
        avatar.OnLevelChanged += Avatar_OnLevelChanged;

        anim             = GetComponent <Animator>();
        playerMovement   = GetComponent <CompleteProject.PlayerMovement>();
        attackController = GetComponentInChildren <AttackController>();

        StartCoroutine(Restore());
    }
Exemplo n.º 12
0
 // Use this for initialization
 void Start()
 {
     this.playerHealth   = this.GetComponentInChildren <CompleteProject.PlayerHealth>() as CompleteProject.PlayerHealth;
     this.playerMovement = this.GetComponentInChildren <CompleteProject.PlayerMovement>() as CompleteProject.PlayerMovement;
     this.playerShooting = this.GetComponentInChildren <CompleteProject.PlayerShooting>() as CompleteProject.PlayerShooting;
 }
Exemplo n.º 13
0
 public MoveCommand(CompleteProject.PlayerMovement _playerMovement, float _h, float _v)
 {
     this.playerMovement = _playerMovement;
     this.h = _h;
     this.v = _v;
 }
Exemplo n.º 14
0
 // Use this for initialization
 void Start()
 {
     this.playerHealth = this.GetComponentInChildren<CompleteProject.PlayerHealth>() as CompleteProject.PlayerHealth;
     this.playerMovement = this.GetComponentInChildren<CompleteProject.PlayerMovement>() as CompleteProject.PlayerMovement;
     this.playerShooting = this.GetComponentInChildren<CompleteProject.PlayerShooting>() as CompleteProject.PlayerShooting;
 }