static int StopAnim(IntPtr L) { try { int count = LuaDLL.lua_gettop(L); if (count == 2 && TypeChecker.CheckTypes(L, 1, typeof(AnimData), typeof(bool))) { AnimData arg0 = (AnimData)ToLua.ToObject(L, 1); bool arg1 = LuaDLL.lua_toboolean(L, 2); AnimSystem.StopAnim(arg0, arg1); return(0); } else if (count == 2 && TypeChecker.CheckTypes(L, 1, typeof(UnityEngine.GameObject), typeof(bool))) { UnityEngine.GameObject arg0 = (UnityEngine.GameObject)ToLua.ToObject(L, 1); bool arg1 = LuaDLL.lua_toboolean(L, 2); AnimSystem.StopAnim(arg0, arg1); return(0); } else { return(LuaDLL.luaL_throw(L, "invalid arguments to method: AnimSystem.StopAnim")); } } catch (Exception e) { return(LuaDLL.toluaL_exception(L, e)); } }
// static AnimParamHash HashTemp = new AnimParamHash(); public static AnimSystem GetInstance() { if (instance == null) { GameObject animGameObject = GameObject.Find("AnimSystem"); if (animGameObject == null) { animGameObject = new GameObject(); animGameObject.name = "AnimSystem"; instance = animGameObject.AddComponent <AnimSystem>(); } if (instance == null) { instance = animGameObject.GetComponent <AnimSystem>(); } if (Application.isPlaying) { DontDestroyOnLoad(instance.gameObject); } else { //不加编译器宏会导致打包失败 #if UNITY_EDITOR EditorApplication.update += instance.Update; #endif } } return(instance); }
public void CleanAnim() { for (int i = 0; i < animDataList.Count; i++) { AnimSystem.StopAnim(animDataList[i]); } }
static int Blink(IntPtr L) { try { ToLua.CheckArgsCount(L, 9); UnityEngine.GameObject arg0 = (UnityEngine.GameObject)ToLua.CheckUnityObject(L, 1, typeof(UnityEngine.GameObject)); float arg1 = (float)LuaDLL.luaL_checknumber(L, 2); float arg2 = (float)LuaDLL.luaL_checknumber(L, 3); float arg3 = (float)LuaDLL.luaL_checknumber(L, 4); bool arg4 = LuaDLL.luaL_checkboolean(L, 5); RepeatType arg5 = (RepeatType)ToLua.CheckObject(L, 6, typeof(RepeatType)); int arg6 = (int)LuaDLL.luaL_checknumber(L, 7); AnimCallBack arg7 = null; LuaTypes funcType8 = LuaDLL.lua_type(L, 8); if (funcType8 != LuaTypes.LUA_TFUNCTION) { arg7 = (AnimCallBack)ToLua.CheckObject(L, 8, typeof(AnimCallBack)); } else { LuaFunction func = ToLua.ToLuaFunction(L, 8); arg7 = DelegateFactory.CreateDelegate(typeof(AnimCallBack), func) as AnimCallBack; } object[] arg8 = ToLua.CheckObjectArray(L, 9); AnimData o = AnimSystem.Blink(arg0, arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8); ToLua.PushObject(L, o); return(1); } catch (Exception e) { return(LuaDLL.toluaL_exception(L, e)); } }
protected void ChildMove() { for (int i = 0; i < gos_child.Length; i++) { AnimSystem.StopAnim(gos_child[i]); AnimSystem.Move(gos_child[i], null, v3s_moveTo[i], 0, ns_moveTime[i], interp: InterpType.OutQuad); } }
protected void ChildRotate() { for (int i = 0; i < gos_child.Length; i++) { AnimSystem.StopAnim(gos_child[i]); AnimSystem.Rotate(gos_child[i], gos_child[i].transform.eulerAngles, v3s_rotateTo[i], ns_rotateTime[i], 0, interp: InterpType.OutQuad); } }
public void LastPage() { currentPage -= 1; Vector3 lastPos = new Vector3(0, 1056, 0) * (currentPage);; AnimSystem.UguiMove(s_baseBoard.m_rsr.content.gameObject, null, lastPos, 0.5f); }
protected void ChildRehome() { for (int i = 0; i < gos_child.Length; i++) { AnimSystem.StopAnim(gos_child[i]); AnimSystem.Rotate(gos_child[i], null, v3s_rotateFrom[i], ns_rotateTime[i], 0, interp: InterpType.InoutQuad); } }
//UI的进入动画 public override IEnumerator EnterAnim(UIAnimCallBack l_animComplete, UICallBack l_callBack, params object[] objs) { AnimSystem.UguiSizeDelta(GetGameObject("Image"), new Vector2(1000, 0), new Vector2(1000, 100), 0.4f, interp: InterpType.OutBack); yield return(new WaitForSeconds(2)); yield return(base.EnterAnim(l_animComplete, l_callBack, objs)); }
//UI的退出动画 public override IEnumerator ExitAnim(UIAnimCallBack l_animComplete, UICallBack l_callBack, params object[] objs) { AnimSystem.UguiSizeDelta(GetGameObject("Image"), new Vector2(1000, 100), new Vector2(1000, 000), 0.3f); yield return(new WaitForSeconds(0.3f)); yield return(base.ExitAnim(l_animComplete, l_callBack, objs)); }
//UI的退出动画 public override IEnumerator ExitAnim(UIAnimCallBack l_animComplete, UICallBack l_callBack, params object[] objs) { AnimSystem.UguiAlpha(gameObject, 1, 0, 1, callBack: (object[] obj) => { base.ExitAnim(l_animComplete, l_callBack, objs); }); yield break; }
//UI的进入动画 public override IEnumerator EnterAnim(UIAnimCallBack l_animComplete, UICallBack l_callBack, params object[] objs) { AnimSystem.UguiAlpha(gameObject, 0, 1, 1, interp: InterpType.Linear, isChild: true, callBack: (object[] obj) => { l_animComplete(this, l_callBack, objs); }); yield return(new WaitForSeconds(5)); }
//UI的进入动画 public override IEnumerator EnterAnim(UIAnimCallBack l_animComplete, UICallBack l_callBack, params object[] objs) { AnimSystem.UguiAlpha(gameObject, 0, 1, 1, callBack: (object[] obj) => { base.EnterAnim(l_animComplete, l_callBack, objs); }); return(null); }
//UI的退出动画 public override IEnumerator ExitAnim(UIAnimCallBack l_animComplete, UICallBack l_callBack, params object[] objs) { AnimSystem.UguiAlpha(gameObject, null, 0, callBack: (object[] obj) => { StartCoroutine(base.ExitAnim(l_animComplete, l_callBack, objs)); }); yield return(new WaitForEndOfFrame()); }
//UI的退出动画 public override IEnumerator ExitAnim(UIAnimCallBack l_animComplete, UICallBack l_callBack, params object[] objs) { AnimSystem.UguiAlpha(gameObject, 1, 0, 1, InterpType.Linear, true, (object[] obj) => { base.ExitAnim(l_animComplete, l_callBack, objs); }); return(null); }
//UI的退出动画 public override IEnumerator ExitAnim(UIAnimCallBack l_animComplete, UICallBack l_callBack, params object[] objs) { AnimSystem.UguiMove(GetGameObject("Panel"), null, new Vector3(0, 1000, 0), interp: InterpType.InExpo); AnimSystem.UguiAlpha(gameObject, null, 0, callBack: (object[] obj) => { StartCoroutine(base.ExitAnim(l_animComplete, l_callBack, objs)); }); yield return(new WaitForEndOfFrame()); }
public void ShowAnim() { AnimSystem.UguiMove(gameObject, null, transform.position + positionOffset, 0.2f); AnimSystem.Scale(gameObject, Vector3.zero, ScaleTmp, 0.2f, InterpType.Default); AnimSystem.Scale(gameObject, ScaleTmp, Vector3.one, 0.1f, InterpType.Default, delayTime: 0.2f); AnimSystem.CustomMethodToFloat(SetAlpha, 0, 1, 0.2f); AnimSystem.CustomMethodToFloat(SetAlpha, 1, 0.3f, 0.5f, 0.3f); Timer.DelayCallBack(0.6f, DestroyThis); }
//UI的进入动画 public override IEnumerator EnterAnim(UIAnimCallBack l_animComplete, UICallBack l_callBack, params object[] objs) { AnimSystem.UguiMove(m_uiRoot, new Vector3(0, 1000, 0), Vector3.zero); AnimSystem.UguiAlpha(gameObject, 0, 1, callBack: (object[] obj) => { StartCoroutine(base.EnterAnim(l_animComplete, l_callBack, objs)); }); yield return(new WaitForEndOfFrame()); }
//UI的退出动画 public override IEnumerator ExitAnim(UIAnimCallBack animComplete, UICallBack callBack, params object[] objs) { AnimSystem.UguiAlpha(gameObject, null, 0, callBack: (object[] obj) => { StartCoroutine(base.ExitAnim(animComplete, callBack, objs)); }); AnimSystem.UguiMove(m_uiRoot, Vector3.zero, new Vector3(1000, 0, 0), time: 1, interp: InterpType.InOutBack); yield return(new WaitForEndOfFrame()); }
public override IEnumerator ExitAnim(UIAnimCallBack animComplete, UICallBack callBack, params object[] objs) { AnimSystem.UguiAlpha(gameObject, null, 0, 1, callBack: (object[] obj) => { StartCoroutine(base.ExitAnim(animComplete, callBack, objs)); }); AnimSystem.UguiMove(GetGameObject("Button"), new Vector3(0, 70, 0), new Vector3(0, 0, 0)); yield return(new WaitForEndOfFrame()); }
// 动态效果 public IEnumerator TextAnim(GameObject gameobject, float fromvalue, float tovalue) { AnimSystem.UguiAlpha(gameobject, fromvalue, tovalue, callBack: (object[] obj) => { if (m_bIsActive == true) { StartCoroutine(TextAnim(gameobject, tovalue, fromvalue)); } }); yield return(new WaitForEndOfFrame()); }
public void Btn_LevelSelect() { Debug.Log("选择关卡" + input.text); AnimSystem.Move(btn, from: null, to: Vector3.one * 10000, time: 1, callBack: (o) => { }); StartCoroutine(AssetBundleManager.LoadScene(c_levelAssetPathHead + input.text, "level_" + input.text, callBack: () => { AnimSystem.StopAnim(btn); })); }
public void NextPage() { currentPage -= 1; Vector3 nextPos = new Vector3(0, 960, 0) * (currentPage); //AnimSystem.UguiMove(s_baseBoard.m_rsr.content.gameObject, nextPos, 0.5f); AnimSystem.CustomMethodToVector3(s_baseBoard.m_rsr.SetPos, s_baseBoard.m_rsr.content.anchoredPosition3D, nextPos, 1f); }
//OnEndCallback mOnEndCallback; //private Vector3 m_cameraPos; //private Vector3 m_cameraEugle; //private void PlayAnim(string l_s_pathName, float l_s_timeScale, OnEndCallback callBack) //{ // m_cameraPos = transform.position; // m_cameraEugle = transform.eulerAngles; // GameObject l_go_path = GameObjectManager.CreateGameObjectByPool(l_s_pathName); // l_go_path.transform.position = m_cameraPos; // l_go_path.transform.eulerAngles = m_cameraEugle; // l_go_path.transform.localScale = Vector3.one; // if (l_go_path.GetComponent<MoveData>().Durations.Length > 0) // { // SplineController l_splineController = transform.GetComponent<SplineController>(); // if (l_splineController == null) // { // l_splineController = gameObject.AddComponent<SplineController>(); // } // l_splineController.Durations = l_go_path.GetComponent<MoveData>().Durations; // l_splineController.SplineRoot = l_go_path; // l_splineController.MyStart(callBack); // Time.timeScale = l_s_timeScale; // } // else // { // GameObjectManager.DestroyGameobjectByPool(l_go_path); // EnterFollowStatus(); // //Debug.LogError(l_s_skillID + "无镜头动画:" + l_s_pathName); // return; // } //} //void PlayAnimEndCallBack() //{ // EnterFollowStatus(); //} #endregion #endregion #region 自由调用部分 /// <summary> /// 一段移动 /// </summary> /// <param name="toPos"></param>目标位置 /// <param name="time"></param>时间 /// <param name="fromPos"></param>起始位置,用于预览 /// <param name="interp"></param>差值方式 /// <param name="callBack"></param>回调,缺省 public void MoveTo(Vector3 toPos, float time, Vector3?fromPos = null, InterpType interp = InterpType.Default, AnimCallBack callBack = null, object[] parameter = null) { EnterRootAnimStatus(); if (fromPos == null) { AnimSystem.Move(animObject: m_cameraRoot.gameObject, from: m_cameraRoot.position, to: toPos, time: time, interp: interp, callBack: callBack, parameter: parameter); } else { AnimSystem.Move(animObject: m_cameraRoot.gameObject, from: fromPos, to: toPos, time: time, interp: interp, callBack: callBack, parameter: parameter); } }
/// <summary> /// 一段旋转 /// </summary> public void RotateTo(Vector3 toEugle, float time, Vector3?fromPos = null, InterpType interp = InterpType.Default, AnimCallBack callBack = null, object[] parameter = null) { EnterRootAnimStatus(); Vector3 newToEugle = LimitEugle(toEugle); Vector3?newFromEugle = fromPos; if (fromPos == null) { newFromEugle = LimitEugle(m_cameraRoot.eulerAngles); } AnimSystem.Rotate(animObject: m_cameraRoot.gameObject, from: newFromEugle, to: newToEugle, time: time, interp: interp, callBack: callBack, parameter: parameter); }
public static AnimSystem GetInstance() { if (instance == null) { GameObject animGameObject = new GameObject(); animGameObject.name = "AnimSystem"; instance = animGameObject.AddComponent <AnimSystem>(); DontDestroyOnLoad(instance.gameObject); } return(instance); }
static int InitAnimData(IntPtr L) { try { ToLua.CheckArgsCount(L, 0); AnimSystem.InitAnimData(); return(0); } catch (Exception e) { return(LuaDLL.toluaL_exception(L, e)); } }
void ToggleAnim(GameObject item, bool isShow) { if (item.activeSelf != isShow) { item.SetActive(isShow); if (isShow) { AnimSystem.StopAnim(item); AnimSystem.UguiAlpha(item, 0.1f, 1, 0.4f); AnimSystem.Scale(item, Vector3.one * 4, Vector3.one, 0.4f, InterpType.OutBack); } } }
static int Update(IntPtr L) { try { ToLua.CheckArgsCount(L, 1); AnimSystem obj = (AnimSystem)ToLua.CheckObject(L, 1, typeof(AnimSystem)); obj.Update(); return(0); } catch (Exception e) { return(LuaDLL.toluaL_exception(L, e)); } }
static int ClearAllAnim(IntPtr L) { try { ToLua.CheckArgsCount(L, 1); bool arg0 = LuaDLL.luaL_checkboolean(L, 1); AnimSystem.ClearAllAnim(arg0); return(0); } catch (Exception e) { return(LuaDLL.toluaL_exception(L, e)); } }