private void Awake() { _originalLocalPosition = moveHandle.localPosition; _originalIconScales = new Vector3[iconScaleHandles.Length]; for (int i = 0; i < _originalIconScales.Length; i++) { _originalIconScales[i] = iconScaleHandles[i].localScale; } _originalBouncePositions = new Vector3[bounceHandles.Length]; for (int i = 0; i < _originalBouncePositions.Length; i++) { _originalBouncePositions[i] = bounceHandles[i].localPosition; } _originalBounceFabricColors = new Color[bounceGraphicsFabric.Length]; for (int i = 0; i < _originalBounceFabricColors.Length; i++) { _originalBounceFabricColors[i] = bounceGraphicsFabric[i].color; } _originalBounceDecalColors = new Color[bounceGraphicsDecal.Length]; for (int i = 0; i < _originalBounceDecalColors.Length; i++) { _originalBounceDecalColors[i] = bounceGraphicsDecal[i].color; } SimpleSpringInterper simpleSpringInterper = moveInterper; simpleSpringInterper.OnSpringValueChanged = (SimpleSpringInterper.SpringValueChangedHandler)Delegate.Combine(simpleSpringInterper.OnSpringValueChanged, new SimpleSpringInterper.SpringValueChangedHandler(OnMoveValueChanged)); SimpleSpringInterper simpleSpringInterper2 = scaleInterper; simpleSpringInterper2.OnSpringValueChanged = (SimpleSpringInterper.SpringValueChangedHandler)Delegate.Combine(simpleSpringInterper2.OnSpringValueChanged, new SimpleSpringInterper.SpringValueChangedHandler(OnScaleValueChanged)); scaleInterper.SetSpringGoal(INDEX_FABRIC, instant: true); setVisible(isVisible: false, instant: true); setIsFabric(isFabric: true); setupListeners(); widgetDisabler = GetComponent <ActiveSwatchWidgetDisabler>(); }
private void setVisible(bool isVisible, bool instant = false) { base.gameObject.SetActive(isVisible); _isVisible = isVisible; float springGoal = 0f; if (!_isVisible) { springGoal = 1f; } moveInterper.SetSpringGoal(springGoal, instant); }
private void Update() { if (_gameplayState == FishingGameplayStates.Catch) { _circleT += Time.deltaTime; for (int i = 0; i < _fishes.Count; i++) { FishingFish fishingFish = _fishes[i]; float t = _circleT * fishingFish.speed * config.baseFishSpeed * currentPatternConfig.baseSpeed + fishingFish.offsetT; Vector3 fishPosition = GetFishPosition(t); fishingFish.SetPosition(fishPosition); } bool flag = GetFish() != null; _bobberAnimator.SetBool(PARAM_IS_ATTACKING, flag); if (flag && !fxUnderBobber.isPlaying) { fxUnderBobber.Play(); eventDispatcher.DispatchEvent(default(FishingEvents.PulseBobberButton)); playSoundEffect("SFX/Player/FishingRod/NibbleBubbles"); } else if (!flag && fxUnderBobber.isPlaying) { fxUnderBobber.Stop(); eventDispatcher.DispatchEvent(default(FishingEvents.StopBobberButtonPulse)); } } else if (_gameplayState == FishingGameplayStates.Reel) { float num = config.baseFishReelStrength * _fishes[_reelFishIndex].reelStrength; _reelValue += Time.deltaTime * num; if (_reelValue >= config.reelExtremes.y) { reelIn(null); } reelSpring.SetSpringGoal(_reelValue); } }
public void ResetRotationWithOffset(float rotationYOffset) { StopForces(); setCurrentRotationPreventingGimbalLock(); rotateSpring.SetSpringGoal(rotationYOffset); }