Exemplo n.º 1
0
 private void SetNewIndicator(int prototypeIndex, bool forceRecreate)
 {
     if ((CurrentIndicatorIndex != prototypeIndex) || forceRecreate)
     {
         if (_indicator != null)
         {
             Destroy(_indicator.gameObject);
         }
         if ((prototypeIndex < 0) || (prototypeIndex >= RulerIndicators.Length))
         {
             CurrentIndicatorIndex = -1;
         }
         else
         {
             CurrentIndicatorIndex = prototypeIndex;
             _indicator            = Instantiate <RulerIndicator>(RulerIndicators[prototypeIndex]);
             _indicator.transform.SetParent(_transform);
             _values.SetMaxHandleCount(CurrentIndicatorIndex, _indicator.Init());
             _indicator.SetActive(true);
             int num = _values.ActiveHandle(CurrentIndicatorIndex);
             for (int i = 0; i <= num; i++)
             {
                 _indicator.InitHandle(i);
                 _indicator.SetHandle(i, _values.Get(CurrentIndicatorIndex, i));
             }
         }
     }
 }
Exemplo n.º 2
0
        public int HandleGizmoHover(Ray cameraRay)
        {
            if (_indicator != null)
            {
                return(_indicator.HandleGizmoHover(cameraRay));
            }
            RulerIndicator local1 = _indicator;

            return(-1);
        }