private void OnPointerEnter(EBtnType btnType, bool b) { _isPointerEnter = b; if (!_isPointerDown) { RefreshBtnScale(btnType); } var index = (int)btnType; if (_cachedView.SkeletonGraphics[index].AnimationState == null) { return; } if (b) { var loop = btnType != EBtnType.Multi; _cachedView.SkeletonGraphics[index].AnimationState.SetAnimation(0, PointInAnimNames[index], loop); } else { if (btnType == EBtnType.Multi) { _cachedView.SkeletonGraphics[index].AnimationState.SetAnimation(0, "OnLineClose", false); } else { _cachedView.SkeletonGraphics[index].AnimationState.SetEmptyAnimation(0, 0.2f); // track.trackTime = track.trackEnd; } } }
private void RefreshBtnScale(EBtnType btnType) { if (_isPointerDown) { SetBtnScale(btnType, 0.98f); } else if (_isPointerEnter) { SetBtnScale(btnType, 1.03f); } else { SetBtnScale(btnType, 1); } }
private void OnPointerDown(EBtnType type, bool b) { _isPointerDown = b; RefreshBtnScale(type); }
private void SetBtnScale(EBtnType type, float scale) { _cachedView.BtnRtfs[(int)type].localScale = Vector3.one * scale; }