Beispiel #1
0
 void Start()
 {
     anim            = gameObject.GetComponent <Animator>();
     masterFirePoint = this.gameObject.transform.GetChild(0).gameObject;
     mFirepoint      = masterFirePoint.GetComponent <MasterFirepoint>();
     mFirepoint.enableAttack(cadency);
 }
Beispiel #2
0
    // Update is called once per frame
    void FixedUpdate()
    {
        float prob = Random.Range(0f, 1f);

        if (prob >= 0.8f)
        {
            mFirepoint.enableAttack(cadency);
            anim.SetBool("Attacking", true);
        }
        else
        {
            anim.SetBool("Attacking", false);
            mFirepoint.disableAttack();
        }



        masterFirePoint.transform.Rotate(0f, 0f, 1f);
    }
Beispiel #3
0
    // Update is called once per frame
    void FixedUpdate()
    {
        if (Player.transform.position.x > transform.position.x)
        {
            transform.rotation = Quaternion.Euler(0f, 180f, 0f);
        }
        else
        {
            transform.rotation = Quaternion.Euler(0f, 0f, 0f);
        }
        float prob = Random.Range(0f, 1f);

        if (prob >= 0.8f)
        {
            mFirepoint.enableAttack(cadency);
            anim.SetBool("Attac", true);
        }
        else
        {
            //  anim.SetBool("Attac", false);
            mFirepoint.disableAttack();
        }
    }