Exemple #1
0
    protected override void Update()
    {
        base.Update();
        ConductorSM hero = MonobehaviorHandler.GetMonobeharior().GetObject <Floor>("Floor").GetHero();

        if (hero == null)
        {
            return;
        }
        CalculateIndicator();
        if (!hero.IsDragging())
        {
            StopDrag(false);
        }
        if (AttackTarget != null)
        {
            if (AttackTarget.CanNotInteract())
            {
                AttackTarget = null;
            }
        }
        _attackingDenyPeriod -= Time.deltaTime;
        if (_attackingDenyPeriod <= 0)
        {
            IsAttackingAllowed = true;
        }
        if (AttackTarget != null)
        {
            float dist = AttackTargetDistance();
            if (dist > AttackMaxDistance)
            {
                AttackTarget = null;
            }
        }
    }