// NEED TO MAKE THIS A COROUTINE public void CloseSettingsMenu() { TweenPos.Tween(this.menuOverlayPanel.gameObject, .5f, new Vector3(Screen.width / 2, Screen.height / 2, 0), new Vector3(0, 0, 0), TweenMain.Style.Once, TweenMain.Method.EaseIn, null, Space.World); TweenScale.Tween(this.menuOverlayPanel.gameObject, .5f, new Vector3(1, 1, 1), new Vector3(0, 0, 0), TweenMain.Style.Once, TweenMain.Method.EaseIn, null); StartCoroutine(PF_GamePlay.Wait(.75f, () => { menuOverlayPanel.gameObject.SetActive(false); ToggleOpenCloseButtons(); })); }
public static void PosTween(GameObject go, float duration, Vector3 pos, int style = 0, int method = 0, LuaFunction finished = null, bool newObj = true) { UnityAction action = () => { if (finished != null) { finished.Call(); } }; TweenPos.Tween(go, duration, pos, (TweenMain.Style)style, (TweenMain.Method)method, (finished != null)?action:null, newObj); }
void InitTween() { for (int i = 0; i < LayerContainerList.Count; i++) { //UILayerContainer<AnimEntry> layerContainer = LayerContainerList[i]; UILayerContainerAnim layerContainer = LayerContainerList[i]; for (int j = 0; j < layerContainer.ChildList.Count; j++) { AnimEntry animEntry = layerContainer.ChildList[j]; UIAnimType animType = animEntry.Type; if (animType == UIAnimType.Position) { animEntry.tween = TweenPos.Tween(gameObject, animEntry.Duration, animEntry.To); } if (animType == UIAnimType.Scale) { animEntry.tween = TweenScale.Tween(gameObject, animEntry.Duration, animEntry.To); } if (animType != UIAnimType.None) { animEntry.tween.tweenFactor = 0; animEntry.tween.enabled = false; } /* * // 在这里继续添加其他类型的 */ // 这里就是让ChildList按顺序去播放 if (j > 0) { AnimEntry preAnimEntry = layerContainer.ChildList[j - 1]; AddTweenListener(preAnimEntry, animEntry); } // 添加回调,在最后一个动作回调 if (j == layerContainer.ChildList.Count - 1) { AnimEntry lastAnimEntry = layerContainer.ChildList[j]; AddLastTweenCallback(layerContainer.Type, lastAnimEntry); } } } }
public void OpenSettingsMenu() { // THIS BREAKS IF THE GO IS DISABLED!!! //Tween.Tween(this.menuOverlayPanel.gameObject, .001f, Quaternion.Euler(0,0,0) , Quaternion.Euler(0,0,15f), TweenMain.Style.PingPong, TweenMain.Method.EaseIn, null); //new Vector3(Screen.width/2, Screen.height/2, 0) menuOverlayPanel.gameObject.SetActive(true); TweenPos.Tween(this.menuOverlayPanel.gameObject, .001f, this.menuOverlayPanel.transform.position, new Vector3(0, Screen.height, 0), TweenMain.Style.Once, TweenMain.Method.Linear, null, Space.World); TweenScale.Tween(this.menuOverlayPanel.gameObject, .001f, new Vector3(1, 1, 1), new Vector3(0, 0, 0), TweenMain.Style.Once, TweenMain.Method.EaseIn, null); TweenPos.Tween(this.menuOverlayPanel.gameObject, .5f, new Vector3(0, 0, 0), new Vector3(Screen.width / 2, Screen.height / 2, 0), TweenMain.Style.Once, TweenMain.Method.EaseIn, null, Space.World); TweenScale.Tween(this.menuOverlayPanel.gameObject, .5f, new Vector3(0, 0, 0), new Vector3(1, 1, 1), TweenMain.Style.Once, TweenMain.Method.EaseIn, null); this.activeTitleId.text = PlayFab.PlayFabSettings.TitleId; ToggleOpenCloseButtons(); }
public void TurnOffArrows(UnityEvent callback = null) { DeselectArrows(); DisablePulsingButtons(); TweenPos.Tween(this.ArrowGroup.gameObject, .333f, this.initialPos, () => { this.Arrow1.btn.interactable = false; this.Arrow2.btn.interactable = false; this.Arrow3.btn.interactable = false; this.Arrow1.currentState = AnimationStates.Off; this.Arrow2.currentState = AnimationStates.Off; this.Arrow3.currentState = AnimationStates.Off; if (callback != null) { callback.Invoke(); } }, Space.World); }
public void TurnOnArrows(UnityEvent callback = null) { //Debug.Log(this.ArrowGroup.rect.width); this.selectedSlot = null; TweenPos.Tween(this.ArrowGroup.gameObject, .333f, new Vector3(445, 30, 0), () => { this.Arrow1.btn.interactable = true; this.Arrow1.currentState = AnimationStates.On; this.Arrow2.btn.interactable = true; this.Arrow2.currentState = AnimationStates.On; this.Arrow3.btn.interactable = true; this.Arrow3.currentState = AnimationStates.On; if (callback != null) { callback.Invoke(); } }, Space.Self); }