Exemplo n.º 1
0
 public virtual void SetFocus(Interactable newFocus)
 {
     if (newFocus != _focus)
     {
         _focus            = newFocus;
         _interactDistance = _focus.GetInteractDistance(gameObject);
         _motor.FollowTarget(newFocus, _interactDistance);
     }
 }
Exemplo n.º 2
0
 /// <summary>
 /// Установка нового объекта в фокус
 /// </summary>
 /// <param name="newFocus"></param>
 protected virtual void SetFocus(Interactable newFocus)
 {
     if (newFocus == Focus)
     {
         return;
     }
     Focus = newFocus;
     Motor.FollowTarget(newFocus);
 }
Exemplo n.º 3
0
    void SetFocus(Interacteble newFocus)
    {
        if (newFocus != focus)
        {
            if (focus != null)
            {
                focus.OnDefocused();
            }
            focus = newFocus;
            motor.FollowTarget(newFocus);
        }

        newFocus.OnFocused(transform);
    }
Exemplo n.º 4
0
 public void SetFocus(Interactable newFocus)
 {
     if (!newFocus.isValidInteractor(this.GetComponent <Interactable>()))
     {
         return;
     }
     if (newFocus != focus)
     {
         //Debug.Log(this.name + " is focusing on " + newFocus);
         if (focus != null)
         {
             //Debug.Log("FOCUS is null assigning" + GetComponent<Interactable>());
             focus.OnDefocused(GetComponent <Interactable>());
             Debug.Log("OnDefocused");
         }
         focus = newFocus;
         motor.FollowTarget(newFocus);
     }
     //Debug.Log("New Focus " + GetComponent<Interactable>());
     newFocus.OnFocused(GetComponent <Interactable>());
 }