Ejemplo n.º 1
0
 // Use this for initialization
 void Start()
 {
     mps = gameObject.GetComponent <ManagePlayerState>();
     if (!mps)
     {
         print("ShootBullet: Couldn't get player state!");
     }
 }
Ejemplo n.º 2
0
    // 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;
        }
    }
Ejemplo n.º 3
0
    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;
            }
        }
    }