Esempio n. 1
0
    void W()
    {
        ClearRange();
        selected = 'W';
        ShowRange(WRANGE);
        RF.Mouse.SetRange(3);
        GLOBAL.DrawLine(transform.position + offset, RF.Mouse.transform.position, Color.red, .1f, WRANGE);

        if (GLOBAL.LeftClickHit())
        {
            target = RF.Mouse.transform;
            CharacterPlayerNav.MoveTo(target.position);
            chasing = true;

            if (GLOBAL.HasReached(transform.position, target.position, BrandAbilities.WRANGE))
            {
                Shoot(selected);
            }
        }
    }
Esempio n. 2
0
 /// <summary>Move towards the target at maximum range.</summary>
 void MaintainDistance()
 {
     if (!PlayerNav)
     {
         throw new NullReferenceException("PlayerNav is set to null for: " + _name);
     }
     else
     if (target != null)
     {
         PlayerNav.MoveTo(target.position);
     }
 }