Exemple #1
0
    public virtual void OnCollisionEnter2D(Collision2D coll)
    {
        //Debug.Log ("enemy hit");

        if (coll.gameObject.tag == "EnemyMoose")
        {
            //state = MooseState.Ball;
            BaseObjectFSM other = coll.gameObject.GetComponent <BaseObjectFSM> ();


            if (state == MooseState.Walk && other.state == MooseState.Walk)
            {
                return;
            }
            else
            {
                collisionStuff(coll);
            }
        }
        else if (coll.gameObject.tag == "Player")
        {
            collisionStuff(coll);
        }

        if (coll.gameObject.tag == "Wall")
        {
            soundManager.WallHit.Play();
        }
    }
Exemple #2
0
    // Use this for initialization
    public void setCharge()
    {
        BaseObjectFSM baseObject = this.gameObject.GetComponentInParent <BaseObjectFSM> ();

        baseObject.setCharged();
    }