コード例 #1
0
 static public void Add(ObjectFocus objectFocus)
 {
     if (Instance.objectsInRange.Contains(objectFocus))
     {
         return;
     }
     Instance.objectsInRange.Add(objectFocus);
 }
コード例 #2
0
    public static void Add(ObjectFocus objectToAdd)
    {
        //Prevents adding more objects into the ObjectFocus List.
        if (Instance.objectsInRange.Contains(objectToAdd))
        {
            return;
        }

        Instance.objectsInRange.Add(objectToAdd);
    }
コード例 #3
0
    // Update is called once per frame
    void Update()
    {
        if (ObjectFocusManager.Instance.firstInList != null)
        {
            if (ObjectFocusManager.Instance.firstInList.isTrigger)
            {
                if (ObjectFocusManager.Instance.firstInList.Equals(lastObjectFocus))
                {
                    timer += Time.deltaTime;
                    onTouchTimerUpdate.Invoke(timerUpdateCurve.Evaluate(Mathf.InverseLerp(0, delay, timer)));
                    if (timer > delay)
                    {
                        onTouchTimerEnd.Invoke();
                    }
                }
                else
                {
                    onTouchCancel.Invoke();
                    timer = 0;
                    onTouch.Invoke();
                    lastObjectFocus = ObjectFocusManager.Instance.firstInList;
                }
            }
        }
        else
        {
            onTouchCancel.Invoke();
            timer = 0;
        }


        /*if (Input.touchCount > 0)
         * {
         * switch (Input.touches[0].phase)
         * {
         *  case TouchPhase.Began:
         *      timer = 0;
         *      onTouch.Invoke();
         *      break;
         *  case TouchPhase.Ended:
         *      onTouchCancel.Invoke();
         *      break;
         *  default:
         *      timer += Time.deltaTime;
         *      onTouchTimerUpdate.Invoke(timerUpdateCurve.Evaluate(Mathf.InverseLerp(0, delay, timer)));
         *      if(timer > delay)
         *      {
         *          onTouchTimerEnd.Invoke();
         *      }
         *      break;
         * }
         * }*/
    }
コード例 #4
0
 static public void Remove(ObjectFocus objectFocus)
 {
     Instance.objectsInRange.Remove(objectFocus);
 }