/* Initialize the box. */ public void Initialize(ListPositionCtrl listPositionCtrl) { _positionCtrl = listPositionCtrl; _listBank = _positionCtrl.listBank; switch (_positionCtrl.direction) { case ListPositionCtrl.Direction.Vertical: UpdatePosition = MoveVertically; break; case ListPositionCtrl.Direction.Horizontal: UpdatePosition = MoveHorizontally; break; } _unitPos = _positionCtrl.unitPos; _lowerBoundPos = _positionCtrl.lowerBoundPos; _upperBoundPos = _positionCtrl.upperBoundPos; _changeSideLowerBoundPos = _lowerBoundPos + _unitPos * 0.5f; _changeSideUpperBoundPos = _upperBoundPos - _unitPos * 0.5f; _positionCurve = new CurveResolver( _positionCtrl.boxPositionCurve, _changeSideLowerBoundPos, _changeSideUpperBoundPos); _scaleCurve = new CurveResolver( _positionCtrl.boxScaleCurve, _changeSideLowerBoundPos, _changeSideUpperBoundPos); InitialPosition(); InitialContent(); AddClickEvent(); }
void Awake() { Instance = this; switch( Application.platform ) { case RuntimePlatform.WindowsEditor: isTouchingDevice = false; break; case RuntimePlatform.Android: isTouchingDevice = true; break; } }
void Awake() { Instance = this; switch (Application.platform) { case RuntimePlatform.WindowsEditor: isTouchingDevice = false; break; case RuntimePlatform.Android: isTouchingDevice = true; break; } }
void Awake() { Instance = this; switch (Application.platform) { case RuntimePlatform.OSXEditor: _isTouchingDevice = false; break; default: _isTouchingDevice = true; break; } }
/* Notice: ListBox will initialize its variables from ListPositionCtrl. * Make sure that the execution order of script ListPositionCtrl is prior to * ListBox. */ void Start() { main = transform.parent.GetComponent <ListPositionCtrl>(); mainBank = transform.parent.GetComponent <ListBank>(); mainControler = transform.parent.GetComponent <CircilarScrollController>(); _transform = GetComponent <RectTransform>(); _canvasMaxPos = main.canvasMaxPos_L; _unitPos = main.unitPos_L; _lowerBoundPos = main.lowerBoundPos_L; _upperBoundPos = main.upperBoundPos_L; _rangeBoundPos = main.rangeBoundPos_L; _shiftBoundPos = main.shiftBoundPos_L; _originalLocalScale = _transform.localScale; initialPosition(listBoxID); initialContent(); }
/* Notice: ListBox will initialize its variables from ListPositionCtrl. * Make sure that the execution order of script ListPositionCtrl is prior to * ListBox. */ void Start() { _positionCtrl = transform.GetComponentInParent <ListPositionCtrl>(); _listBank = _positionCtrl.listBank; _maxCurvePos = _positionCtrl.canvasMaxPos_L * _positionCtrl.listCurvature; _unitPos = _positionCtrl.unitPos_L; _lowerBoundPos = _positionCtrl.lowerBoundPos_L; _upperBoundPos = _positionCtrl.upperBoundPos_L; _changeSideLowerBoundPos = _lowerBoundPos + _unitPos * 0.3f; _changeSideUpperBoundPos = _upperBoundPos - _unitPos * 0.3f; _cosValueAdjust = _positionCtrl.positionAdjust; _initialLocalScale = transform.localScale; InitialPosition(); InitialContent(); AddClickEvent(); }
/// <summary> /// Control the position of the box whose moving direction is in one direction /// </summary> /// <param name="positionCtrl"> /// The component for controlling the list position /// </param> /// <param name="boxPositionCurve"> /// The curve specifying the passive position according to the box major position /// </param> /// <param name="boxScaleCurve"> /// The curve specifying the scale according to the box major position /// </param> /// <param name="direction">The major moving direction</param> public LinearBoxTransformCtrl( ListPositionCtrl positionCtrl, AnimationCurve boxPositionCurve, AnimationCurve boxScaleCurve, CircularScrollingList.Direction direction) { _unitPos = positionCtrl.unitPos; _lowerBoundPos = positionCtrl.lowerBoundPos; _upperBoundPos = positionCtrl.upperBoundPos; _changeSideLowerBoundPos = _lowerBoundPos + _unitPos * 0.5f; _changeSideUpperBoundPos = _upperBoundPos - _unitPos * 0.5f; _positionCurve = new RangeMappingCurve( boxPositionCurve, -1, 1, _changeSideLowerBoundPos, _changeSideUpperBoundPos); _scaleCurve = new RangeMappingCurve( boxScaleCurve, -1, 1, _changeSideLowerBoundPos, _changeSideUpperBoundPos); switch (direction) { case CircularScrollingList.Direction.Vertical: _getMajorFactor = FactorUtility.GetVector2Y; _getLocalPosition = GetLocalPositionYMajor; break; case CircularScrollingList.Direction.Horizontal: _getMajorFactor = FactorUtility.GetVector2X; _getLocalPosition = GetLocalPositionXMajor; break; } }
void Start() { positionCtrl = GetComponentInChildren <ListPositionCtrl>(); bar = pieCircle.GetComponent <RadialProgressBar>(); dataBar = pieCircle2.GetComponent <RadialProgressBar>(); }