Exemple #1
0
 void Awake()
 {
     cM            = GetComponent <characterMove>();
     pI            = GetComponent <PlayerInput>();
     cH            = GetComponent <characterHealth>();
     weaponManager = GetComponent <PlayerWeaponManager>();
 }
    void OnCollisionEnter(Collision collision)
    {
        GameObject      hit    = collision.gameObject;
        characterHealth health = hit.GetComponent <characterHealth>();

        //Instant kill player
        health.takeDamage(health.getMaxHealth());
    }
    void OnCollisionEnter(Collision collision)
    {
        GameObject      hit    = collision.gameObject;
        characterHealth health = hit.GetComponent <characterHealth>();

        health.takeDamage(projectileDamage);

        Destroy(gameObject);
    }
Exemple #4
0
 // Use this for initialization
 public virtual void Start()
 {
     if (AttackSettings.enemyAttack)
     {
         AttackSettings.enemyAttack.eAI = this;
     }
     cM             = GetComponent <characterMove>();
     cH             = GetComponent <characterHealth>();
     choiceInterval = ChoiceMakingInterval;
 }