// Use this for initialization void Start() { mps = gameObject.GetComponent <ManagePlayerState>(); if (!mps) { print("ShootBullet: Couldn't get player state!"); } }
// Use this for initialization void Start() { mps = gameObject.GetComponent <ManagePlayerState>(); if (!mps) { print("ManageAIPlayer: Couldn't get player state!"); } //opponentsManager = theOpponent.GetComponent<ManagePlayerState>(); inOffenseMode = mps.offenseMode; if (inOffenseMode) { currentAIState = eAIStates.ShootLaser; } else { currentAIState = eAIStates.ShootShield; } }
void OnCollisionEnter(Collision other) { if (other.gameObject.CompareTag("Bullet")) { Destroy(other.gameObject); if (!(!offenseMode && inSpecialMode)) { health -= 2; if (health < 0) { health = 0; } } } if (other.gameObject.CompareTag("BulletSpecial")) { Destroy(other.gameObject); if (!(!offenseMode && inSpecialMode)) { health -= 2; if (health < 0) { health = 0; } } } if (other.gameObject.CompareTag("Player")) { ManagePlayerState otherPSM = other.gameObject.GetComponent <ManagePlayerState>(); if (otherPSM.isInSpecialMode()) { health -= 20; } } }