Exemplo n.º 1
0
    public virtual void Attack(float coolTime, bool useAnimationEvent = false)
    {
        //
        BulletEmitter emitter = GetComponent <BulletEmitter>();

        //
        if (emitter != null)
        {
            //
            if (!useAnimationEvent)
            {
                emitter.Shoot();
            }
            //
            mFSM.SetState(Monster_Attack.GetInstance());

            //
            AttackCoolTimeBound = coolTime;
            //
            Animator animator = GetComponent <Animator>();

            if (animator != null)
            {
                animator.SetBool("attack", true);
            }
        }
    }
Exemplo n.º 2
0
 public static Monster_Attack GetInstance()
 {
     if (instance == null)
     {
         instance = new Monster_Attack();
     }
     return(instance);
 }
Exemplo n.º 3
0
 void Start()
 {
     animator       = GetComponent <Animator>();
     currentSpeed   = wanderSpeed;
     circleCollider = GetComponent <CircleCollider2D>();
     rb2d           = GetComponent <Rigidbody2D>();
     theMonster     = GetComponent <Monster_Attack>();
     StartCoroutine(WanderRoutine());
 }