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)); } } } }
public int HandleGizmoHover(Ray cameraRay) { if (_indicator != null) { return(_indicator.HandleGizmoHover(cameraRay)); } RulerIndicator local1 = _indicator; return(-1); }