Example #1
0
    void R()
    {
        ClearRange();
        selected = 'R';
        ShowRange(RRANGE);
        GLOBAL.DrawLine(transform.position + offset, RF.Mouse.transform.position, Color.red, .1f, RRANGE);

        if (GLOBAL.LeftClickHit())
        {
            RaycastHit h = GLOBAL.MousePosRay();
            Character  c = h.collider.GetComponent <Character>();
            if (GLOBAL.CheckCharacter(character, c))
            {
                target = h.transform;
                CharacterPlayerNav.MoveTo(c.transform.position);
                chasing = true;
            }
            else
            {
                target  = null;
                chasing = false;
            }
        }

        if (target != null && GLOBAL.HasReached(transform.position, target.position, BrandAbilities.RRANGE))
        {
            Shoot(selected);
        }
    }