예제 #1
0
    protected override void OnUpdateEntity()
    {
        if (canupdate)
        {
            EffectUpdate();

            if (!combat && entityTarget == null)
            {
                if (Vector3.Distance(Main.instance.GetChar().transform.position, transform.position) <= combatDistance)
                {
                    director.AddAwake(this);
                    combat = true;
                }
            }

            if (sm != null)
            {
                sm.Update();
            }

            if (cooldown)
            {
                if (timercooldown < recallTime)
                {
                    timercooldown = timercooldown + 1 * Time.deltaTime;
                }
                else
                {
                    cooldown = false; timercooldown = 0;
                }
            }
        }
    }
예제 #2
0
 protected override void OnUpdateEntity()
 {
     stateMachine.Update();
     ChildrensUpdates();
     charAttack.Refresh();
 }