/// <summary> /// 拓展CanvasGroup方法 /// </summary> /// <param name="canvasGroup"></param> /// <param name="value"></param> /// <param name="needTime"></param> public static TweenObject DOFillAlpha(this CanvasGroup canvasGroup, float value, float needTime, TweenMode tweenMode = TweenMode.UnityTimeLineImpact) { if (value > 1) { value = 1; } else if (value < 0) { value = 0; } if (canvasGroupDic.ContainsKey(canvasGroup)) { canvasGroupDic[canvasGroup].Stop(); //暂停上一个 canvasGroupDic.Remove(canvasGroup); //清除上一个 } float timeNow = Time.realtimeSinceStartup; float alpha = canvasGroup.alpha; //记录最初角度数据 float startAlpha = canvasGroup.alpha; //记录开始角度数据 float alphaSpace = Mathf.Abs(canvasGroup.alpha - value); //记录最初间隔 TweenObject tweenOgject = new TweenObject((tween) => { float fpsTimeDir = 0; switch (tweenMode) { case TweenMode.UnityTimeLineImpact: fpsTimeDir = Time.deltaTime; //直接更新时间差 break; case TweenMode.NoUnityTimeLineImpact: fpsTimeDir = Time.realtimeSinceStartup - timeNow; //与上一帧的时间差 break; default: break; } alpha = Mathf.MoveTowards(alpha, value, fpsTimeDir * alphaSpace / needTime); //没有运用动画曲线正常的值 float f = 1 - (Mathf.Abs(alpha - value) / alphaSpace); //通过正常值得出当前进度 if (canvasGroup) { canvasGroup.alpha = Mathf.LerpUnclamped(startAlpha, value, tween.GetAnimationCurveValue());//通过当前进度得到动画曲线的值 } else { tween.Stop(); } timeNow = Time.realtimeSinceStartup;//保存这一帧的时间 return(f); }); tweenOgject.OnComplete(() => { canvasGroup.alpha = value; }); canvasGroupDic.Add(canvasGroup, tweenOgject); return(tweenOgject); }
public override void Dispose() { if (!IsDisposed) { m_player = null; m_level = null; if (m_alphaMaskRT != null && !m_alphaMaskRT.IsDisposed) { m_alphaMaskRT.Dispose(); } m_alphaMaskRT = null; if (m_mapScreenRT != null && !m_mapScreenRT.IsDisposed) { m_mapScreenRT.Dispose(); } m_mapScreenRT = null; foreach (var current in m_roomSpriteList) { current.Dispose(); } m_roomSpriteList.Clear(); m_roomSpriteList = null; foreach (var current2 in m_doorSpriteList) { current2.Dispose(); } m_doorSpriteList.Clear(); m_doorSpriteList = null; foreach (var current3 in m_iconSpriteList) { current3.Dispose(); } m_iconSpriteList.Clear(); m_iconSpriteList = null; AddedRoomsList.Clear(); AddedRoomsList = null; m_roomSpritePosList.Clear(); m_roomSpritePosList = null; m_doorSpritePosList.Clear(); m_doorSpritePosList = null; m_iconSpritePosList.Clear(); m_iconSpritePosList = null; m_playerSprite.Dispose(); m_playerSprite = null; foreach (var current4 in m_teleporterList) { current4.Dispose(); } m_teleporterList.Clear(); m_teleporterList = null; m_teleporterPosList.Clear(); m_teleporterPosList = null; m_xOffsetTween = null; m_yOffsetTween = null; base.Dispose(); } }
/// <summary> /// 拓展的Transform缩放方法 /// </summary> /// <param name="obj"></param> /// <param name="targetSize"></param> /// <param name="needTime"></param> /// <param name="tweenMode"></param> /// <returns></returns> public static TweenObject DOSizeX(this Transform obj, float targetSize, float needTime, TweenMode tweenMode = TweenMode.UnityTimeLineImpact) { Vector3 _targetSize = new Vector3(targetSize, obj.localScale.y, obj.localScale.z); if (obj.localScale == _targetSize) { return(new TweenObject((tween) => { return 1; })); } if (SizeXTransformDic.ContainsKey(obj)) { SizeXTransformDic[obj].Stop(); //暂停上一个 SizeXTransformDic.Remove(obj); //清除上一个 } float timeNow = Time.realtimeSinceStartup; Vector3 size = obj.localScale; //记录最初位置 Vector3 startSize = obj.localScale; //记录开始位置 float sizeSpace = Vector3.Distance(size, _targetSize); //记录最初距离 TweenObject tweenObject = new TweenObject((tween) => { float fpsTimeDir = 0; switch (tweenMode) { case TweenMode.UnityTimeLineImpact: fpsTimeDir = Time.deltaTime; break; case TweenMode.NoUnityTimeLineImpact: fpsTimeDir = Time.realtimeSinceStartup - timeNow; break; default: break; } size = Vector3.MoveTowards(size, _targetSize, fpsTimeDir * sizeSpace / needTime); //没有运用动画曲线正常的值 float f = 1 - (Vector3.Distance(size, _targetSize) / sizeSpace); //通过正常值得出当前进度 obj.localScale = Vector3.LerpUnclamped(startSize, _targetSize, tween.GetAnimationCurveValue()); //通过当前进度得到动画曲线的值 timeNow = Time.realtimeSinceStartup; //保存这一帧的时间 return(f); }); tweenObject.onComplete += () => { obj.localScale = _targetSize; }; SizeXTransformDic.Add(obj, tweenObject); return(tweenObject); }
//----------- MonoBehaviour Methods ----------- private void Awake() { //reusable tween that allows rapid calling: _scaleTween = new TweenObject(target.localScale, target.localScale, .35f, 0, Tween.EaseOutStrong, Tween.LoopType.None, (value) => target.localScale = value, () => Debug.Log("Scale Complete"), false); Tween.Add(_scaleTween); //cache: _renderer = target.GetComponent <Renderer>(); }
/// <summary> /// 拓展的Transform移动方法 /// </summary> /// <param name="obj"></param> /// <param name="targetValue"></param> /// <param name="needTime"></param> /// <param name="tweenMode"></param> /// <returns></returns> public static TweenObject DOLocalMoveZ(this RectTransform obj, float targetValue, float needTime, TweenMode tweenMode = TweenMode.UnityTimeLineImpact) { Vector3 targetPos = obj.localPosition; targetPos.z = targetValue; if (LocalMoveZCanvasGroupDic.ContainsKey(obj)) { LocalMoveZCanvasGroupDic[obj].Stop(); //暂停上一个 LocalMoveZCanvasGroupDic.Remove(obj); //清除上一个 } float timeNow = Time.realtimeSinceStartup; float posZ = obj.localPosition.z; //记录最初角度数据 Vector3 startPos = obj.localPosition; //记录开始角度数据 float posZSpace = Mathf.Abs(obj.localPosition.z - targetValue); //记录最初间隔 TweenObject tweenObject = new TweenObject((tween) => { float fpsTimeDir = 0; switch (tweenMode) { case TweenMode.UnityTimeLineImpact: fpsTimeDir = Time.deltaTime; break; case TweenMode.NoUnityTimeLineImpact: fpsTimeDir = Time.realtimeSinceStartup - timeNow; break; default: break; } posZ = Mathf.MoveTowards(posZ, targetPos.z, fpsTimeDir * posZSpace / needTime); //没有运用动画曲线正常的值 float f = 1 - (Mathf.Abs(targetPos.z - posZ) / posZSpace); //通过正常值得出当前进度 obj.localPosition = Vector3.LerpUnclamped(startPos, targetPos, tween.GetAnimationCurveValue());//通过当前进度得到动画曲线的值 timeNow = Time.realtimeSinceStartup;//保存这一帧的时间 return(f); }); tweenObject.onComplete += () => { obj.localPosition = targetPos; }; LocalMoveZCanvasGroupDic.Add(obj, tweenObject); return(tweenObject); }
private void OnGUI() { if (GUILayout.Button("Scale Down")) { _scaleTween.startVector3 = target.localScale; _scaleTween.endVector3 = target.localScale * .75f; _scaleTween.Reset(); } if (GUILayout.Button("Scale Up")) { _scaleTween.startVector3 = target.localScale; _scaleTween.endVector3 = target.localScale * 1.25f; _scaleTween.Reset(); } if (GUILayout.Button("Move to 'endPosition'")) { Tween.Add(target.position, endPosition, 1, 0, Tween.EaseSpring, Tween.LoopType.None, HandleMoveTween); } if (GUILayout.Button("Move to 'origin'")) { Tween.Add(target.position, Vector3.zero, 1, 0, Tween.EaseBounce, Tween.LoopType.None, HandleMoveTween); } //example of a non-interruptable tween: if (GUILayout.Button("Rotate") && !_rotating) { _rotating = true; Quaternion targetRotation = target.rotation * Quaternion.AngleAxis(90, target.up); Tween.Add(target.localEulerAngles, targetRotation.eulerAngles, 1, 0, Tween.EaseInOutBack, Tween.LoopType.None, (value) => target.localEulerAngles = value, () => _rotating = false); } //loop: if (GUILayout.Button("Pulse")) { if (string.IsNullOrEmpty(_pulseTweenID)) { _pulseTweenID = Tween.Add(Color.white, Color.red, .5f, 0, Tween.EaseLinear, Tween.LoopType.PingPong, (value) => _renderer.material.color = value); } else { TweenObject pulseTween = Tween.GetTween(_pulseTweenID); pulseTween.isComplete = false; } } if (GUILayout.Button("Stop Pulse")) { TweenObject pulseTween = Tween.GetTween(_pulseTweenID); pulseTween.isComplete = true; } }
/// <summary> /// 拓展的Transform移动方法 /// </summary> /// <param name="obj"></param> /// <param name="targetPos"></param> /// <param name="needTime"></param> /// <param name="tweenMode"></param> /// <returns></returns> public static TweenObject DOLocalMove(this RectTransform obj, Vector3 targetPos, float needTime, TweenMode tweenMode = TweenMode.UnityTimeLineImpact) { if (LocalMoveCanvasGroupDic.ContainsKey(obj)) { LocalMoveCanvasGroupDic[obj].Stop(); //暂停上一个 LocalMoveCanvasGroupDic.Remove(obj); //清除上一个 } float timeNow = Time.realtimeSinceStartup; Vector3 pos = obj.localPosition; //记录最初位置 Vector3 startPos = obj.localPosition; //记录开始位置 float posSpace = Vector3.Distance(pos, targetPos); //记录最初距离 TweenObject tweenObject = new TweenObject((tween) => { float fpsTimeDir = 0; switch (tweenMode) { case TweenMode.UnityTimeLineImpact: fpsTimeDir = Time.deltaTime; break; case TweenMode.NoUnityTimeLineImpact: fpsTimeDir = Time.realtimeSinceStartup - timeNow; break; default: break; } pos = Vector3.MoveTowards(pos, targetPos, fpsTimeDir * posSpace / needTime); //没有运用动画曲线正常的值 float f = 1 - (Vector3.Distance(pos, targetPos) / posSpace); //通过正常值得出当前进度 obj.localPosition = Vector3.LerpUnclamped(startPos, obj.forward * targetPos.z, tween.GetAnimationCurveValue()); //通过当前进度得到动画曲线的值 obj.localPosition = Vector3.LerpUnclamped(startPos, obj.up * targetPos.y, tween.GetAnimationCurveValue()); //通过当前进度得到动画曲线的值 obj.localPosition = Vector3.LerpUnclamped(startPos, obj.right * targetPos.x, tween.GetAnimationCurveValue()); //通过当前进度得到动画曲线的值 timeNow = Time.realtimeSinceStartup; //保存这一帧的时间 return(f); }); tweenObject.onComplete += () => { obj.localPosition = obj.forward * targetPos.z; obj.localPosition = obj.up * targetPos.y; obj.localPosition = obj.right * targetPos.x; }; LocalMoveCanvasGroupDic.Add(obj, tweenObject); return(tweenObject); }
/// <summary> /// 拓展的Transform移动方法 /// </summary> /// <param name="obj"></param> /// <param name="targetValue"></param> /// <param name="needTime"></param> /// <param name="tweenMode"></param> /// <returns></returns> public static TweenObject DOMoveX(this Transform obj, float targetValue, float needTime, TweenMode tweenMode = TweenMode.UnityTimeLineImpact) { Vector3 targetPos = new Vector3(targetValue, obj.position.y, obj.position.z); if (MoveXTransformDic.ContainsKey(obj)) { MoveXTransformDic[obj].Stop(); //暂停上一个 MoveXTransformDic.Remove(obj); //清除上一个 } float timeNow = Time.realtimeSinceStartup; Vector3 pos = obj.position; //记录最初位置 Vector3 startPos = obj.position; //记录开始位置 float posSpace = Vector3.Distance(pos, targetPos); //记录最初距离 TweenObject tweenObject = new TweenObject((tween) => { float fpsTimeDir = 0; switch (tweenMode) { case TweenMode.UnityTimeLineImpact: fpsTimeDir = Time.deltaTime; break; case TweenMode.NoUnityTimeLineImpact: fpsTimeDir = Time.realtimeSinceStartup - timeNow; break; default: break; } pos = Vector3.MoveTowards(pos, targetPos, fpsTimeDir * posSpace / needTime); //没有运用动画曲线正常的值 float f = 1 - (Vector3.Distance(pos, targetPos) / posSpace); //通过正常值得出当前进度 obj.position = Vector3.LerpUnclamped(startPos, targetPos, tween.GetAnimationCurveValue()); //通过当前进度得到动画曲线的值 timeNow = Time.realtimeSinceStartup; //保存这一帧的时间 return(f); }); tweenObject.onComplete += () => { obj.position = targetPos; }; MoveXTransformDic.Add(obj, tweenObject); return(tweenObject); }
public override void Dispose() { if (!IsDisposed) { Console.WriteLine("Disposing Lineage Screen"); m_titleText.Dispose(); m_titleText = null; m_selectedLineageObj = null; foreach (var current in m_currentBranchArray) { current.Dispose(); } m_currentBranchArray.Clear(); m_currentBranchArray = null; foreach (var current2 in m_masterArray) { if (!current2.IsDisposed) { current2.Dispose(); } } m_masterArray.Clear(); m_masterArray = null; if (m_startingLineageObj != null) { m_startingLineageObj.Dispose(); } m_startingLineageObj = null; m_background.Dispose(); m_background = null; m_bgShadow.Dispose(); m_bgShadow = null; m_selectTween = null; m_descriptionPlate.Dispose(); m_descriptionPlate = null; m_confirmText.Dispose(); m_confirmText = null; m_navigationText.Dispose(); m_navigationText = null; m_rerollText.Dispose(); m_rerollText = null; base.Dispose(); } }
public void CentreAroundPos(Vector2 pos, bool tween = false) { if (!tween) { CameraOffset.X = m_alphaMaskRect.X + m_alphaMaskRect.Width / 2f - pos.X / 1320f * 60f; CameraOffset.Y = m_alphaMaskRect.Y + m_alphaMaskRect.Height / 2f - pos.Y / 720f * 32f; return; } if (m_xOffsetTween != null && m_xOffsetTween.TweenedObject == this) { m_xOffsetTween.StopTween(false); } if (m_yOffsetTween != null && m_yOffsetTween.TweenedObject == this) { m_yOffsetTween.StopTween(false); } m_xOffsetTween = Tween.To(this, 0.3f, Quad.EaseOut, "CameraOffsetX", (m_alphaMaskRect.X + m_alphaMaskRect.Width / 2f - pos.X / 1320f * 60f).ToString()); m_yOffsetTween = Tween.To(this, 0.3f, Quad.EaseOut, "CameraOffsetY", (m_alphaMaskRect.Y + m_alphaMaskRect.Height / 2f - pos.Y / 720f * 32f).ToString()); }
public void PreviousMenu(Tweener menuTweener) { if (menuTweener.IsPlaying) { return; } ReductLayer(); TweenObject to = menuTweener.tweenObjects[0]; to.onCompleteTweenReverseEvent.RemoveAllListeners(); to.onCompleteTweenReverseEvent.AddListener(() => { registeredBackMenu[layer].interactable = true; registeredButton[layer].Select(); registeredButton[layer].GetComponent <EventTrigger>().enabled = true; }); menuTweener.PlayTweenReversed(); menuTweener.GetComponentInParent <CanvasGroup>().interactable = false; }
public override void Dispose() { if (!base.IsDisposed) { this.m_player = null; this.m_level = null; if (this.m_alphaMaskRT != null && !this.m_alphaMaskRT.IsDisposed) { this.m_alphaMaskRT.Dispose(); } this.m_alphaMaskRT = null; if (this.m_mapScreenRT != null && !this.m_mapScreenRT.IsDisposed) { this.m_mapScreenRT.Dispose(); } this.m_mapScreenRT = null; foreach (SpriteObj current in this.m_roomSpriteList) { current.Dispose(); } this.m_roomSpriteList.Clear(); this.m_roomSpriteList = null; foreach (SpriteObj current2 in this.m_doorSpriteList) { current2.Dispose(); } this.m_doorSpriteList.Clear(); this.m_doorSpriteList = null; foreach (SpriteObj current3 in this.m_iconSpriteList) { current3.Dispose(); } this.m_iconSpriteList.Clear(); this.m_iconSpriteList = null; this.m_addedRooms.Clear(); this.m_addedRooms = null; this.m_roomSpritePosList.Clear(); this.m_roomSpritePosList = null; this.m_doorSpritePosList.Clear(); this.m_doorSpritePosList = null; this.m_iconSpritePosList.Clear(); this.m_iconSpritePosList = null; this.m_playerSprite.Dispose(); this.m_playerSprite = null; foreach (SpriteObj current4 in this.m_teleporterList) { current4.Dispose(); } this.m_teleporterList.Clear(); this.m_teleporterList = null; this.m_teleporterPosList.Clear(); this.m_teleporterPosList = null; this.m_xOffsetTween = null; this.m_yOffsetTween = null; base.Dispose(); } }
public void CentreAroundPos(Vector2 pos, bool tween = false) { if (!tween) { this.CameraOffset.X = (float)this.m_alphaMaskRect.X + (float)this.m_alphaMaskRect.Width / 2f - pos.X / 1320f * 60f; this.CameraOffset.Y = (float)this.m_alphaMaskRect.Y + (float)this.m_alphaMaskRect.Height / 2f - pos.Y / 720f * 32f; return; } if (this.m_xOffsetTween != null && this.m_xOffsetTween.TweenedObject == this) { this.m_xOffsetTween.StopTween(false); } if (this.m_yOffsetTween != null && this.m_yOffsetTween.TweenedObject == this) { this.m_yOffsetTween.StopTween(false); } this.m_xOffsetTween = Tween.To(this, 0.3f, new Easing(Quad.EaseOut), new string[] { "CameraOffsetX", ((float)this.m_alphaMaskRect.X + (float)this.m_alphaMaskRect.Width / 2f - pos.X / 1320f * 60f).ToString() }); this.m_yOffsetTween = Tween.To(this, 0.3f, new Easing(Quad.EaseOut), new string[] { "CameraOffsetY", ((float)this.m_alphaMaskRect.Y + (float)this.m_alphaMaskRect.Height / 2f - pos.Y / 720f * 32f).ToString() }); }
public override void HandleInput() { if (!m_lockControls && (m_selectTween == null || (m_selectTween != null && !m_selectTween.Active))) { var selectedLineageObj = m_selectedLineageObj; var selectedLineageIndex = m_selectedLineageIndex; if (Game.GlobalInput.JustPressed(9) && SkillSystem.GetSkill(SkillType.Randomize_Children).ModifierAmount > 0f && !Game.PlayerStats.RerolledChildren) { m_lockControls = true; SoundManager.PlaySound("frame_woosh_01", "frame_woosh_02"); if (m_xShift != 0) { m_xShift = 0; Tween.By(m_descriptionPlate, 0.2f, Back.EaseOut, "delay", "0.2", "X", "-600"); m_selectTween = Tween.To(Camera, 0.3f, Quad.EaseOut, "delay", "0.2", "X", (m_masterArray.Count * m_xPosOffset).ToString()); } (ScreenManager as RCScreenManager).StartWipeTransition(); Tween.RunFunction(0.2f, this, "RerollCurrentBranch"); } if (Game.GlobalInput.Pressed(20) || Game.GlobalInput.Pressed(21)) { if (Camera.X > m_masterArray[0].X + 10f) { SoundManager.PlaySound("frame_swoosh_01"); m_selectTween = Tween.By(Camera, 0.3f, Quad.EaseOut, "X", (-m_xPosOffset).ToString()); if (m_xShift == 0) { Tween.By(m_descriptionPlate, 0.2f, Back.EaseIn, "X", "600"); } m_xShift--; } } else if ((Game.GlobalInput.Pressed(22) || Game.GlobalInput.Pressed(23)) && m_xShift < 0) { SoundManager.PlaySound("frame_swoosh_01"); m_selectTween = Tween.By(Camera, 0.3f, Quad.EaseOut, "X", m_xPosOffset.ToString()); m_xShift++; if (m_xShift == 0) { Tween.By(m_descriptionPlate, 0.2f, Back.EaseOut, "X", "-600"); } } if (m_xShift == 0) { if (Game.GlobalInput.JustPressed(16) || Game.GlobalInput.JustPressed(17)) { if (m_selectedLineageIndex > 0) { SoundManager.PlaySound("frame_swap"); } m_selectedLineageIndex--; if (m_selectedLineageIndex < 0) { m_selectedLineageIndex = 0; } if (m_selectedLineageIndex != selectedLineageIndex) { UpdateDescriptionPlate(); m_selectTween = Tween.By(m_currentBranchArray[0], 0.3f, Quad.EaseOut, "Y", "450"); Tween.By(m_currentBranchArray[1], 0.3f, Quad.EaseOut, "Y", "450"); Tween.By(m_currentBranchArray[2], 0.3f, Quad.EaseOut, "Y", "450"); } } else if (Game.GlobalInput.JustPressed(18) || Game.GlobalInput.JustPressed(19)) { if (m_selectedLineageIndex < m_currentBranchArray.Count - 1) { SoundManager.PlaySound("frame_swap"); } m_selectedLineageIndex++; if (m_selectedLineageIndex > m_currentBranchArray.Count - 1) { m_selectedLineageIndex = m_currentBranchArray.Count - 1; } if (m_selectedLineageIndex != selectedLineageIndex) { UpdateDescriptionPlate(); m_selectTween = Tween.By(m_currentBranchArray[0], 0.3f, Quad.EaseOut, "Y", "-450"); Tween.By(m_currentBranchArray[1], 0.3f, Quad.EaseOut, "Y", "-450"); Tween.By(m_currentBranchArray[2], 0.3f, Quad.EaseOut, "Y", "-450"); } } } m_selectedLineageObj = m_currentBranchArray[m_selectedLineageIndex]; if (Game.GlobalInput.JustPressed(0) || Game.GlobalInput.JustPressed(1)) { if (m_xShift == 0) { if (selectedLineageObj == m_selectedLineageObj) { var rCScreenManager = ScreenManager as RCScreenManager; rCScreenManager.DialogueScreen.SetDialogue("LineageChoiceWarning"); rCScreenManager.DialogueScreen.SetDialogueChoice("ConfirmTest1"); rCScreenManager.DialogueScreen.SetConfirmEndHandler(this, "StartGame"); rCScreenManager.DialogueScreen.SetCancelEndHandler(typeof(Console), "WriteLine", "Canceling Selection"); (ScreenManager as RCScreenManager).DisplayScreen(13, true); } } else { m_xShift = 0; SoundManager.PlaySound("frame_woosh_01", "frame_woosh_02"); Tween.By(m_descriptionPlate, 0.2f, Back.EaseOut, "X", "-600"); m_selectTween = Tween.To(Camera, 0.3f, Quad.EaseOut, "X", (m_masterArray.Count * m_xPosOffset).ToString()); } } base.HandleInput(); } }
public override void Dispose() { if (!base.IsDisposed) { Console.WriteLine("Disposing Procedural Level Screen"); Tween.StopAll(false); this.m_currentRoom = null; this.DisposeRTs(); foreach (RoomObj current in this.m_roomList) { current.Dispose(); } this.m_roomList.Clear(); this.m_roomList = null; this.m_enemyStartPositions.Clear(); this.m_enemyStartPositions = null; this.m_tempEnemyStartPositions.Clear(); this.m_tempEnemyStartPositions = null; this.m_textManager.Dispose(); this.m_textManager = null; this.m_physicsManager = null; this.m_projectileManager.Dispose(); this.m_projectileManager = null; this.m_itemDropManager.Dispose(); this.m_itemDropManager = null; this.m_currentRoom = null; this.m_miniMapDisplay.Dispose(); this.m_miniMapDisplay = null; this.m_mapBG.Dispose(); this.m_mapBG = null; this.m_inputMap.Dispose(); this.m_inputMap = null; this.m_lastEnemyHit = null; this.m_playerHUD.Dispose(); this.m_playerHUD = null; this.m_player = null; this.m_enemyHUD.Dispose(); this.m_enemyHUD = null; this.m_impactEffectPool.Dispose(); this.m_impactEffectPool = null; this.m_blackBorder1.Dispose(); this.m_blackBorder1 = null; this.m_blackBorder2.Dispose(); this.m_blackBorder2 = null; this.m_chestList.Clear(); this.m_chestList = null; this.m_projectileIconPool.Dispose(); this.m_projectileIconPool = null; this.m_objKilledPlayer = null; this.m_dungeonLight.Dispose(); this.m_dungeonLight = null; this.m_traitAura.Dispose(); this.m_traitAura = null; this.m_killedEnemyObjList.Clear(); this.m_killedEnemyObjList = null; this.m_roomEnteringTitle.Dispose(); this.m_roomEnteringTitle = null; this.m_roomTitle.Dispose(); this.m_roomTitle = null; this.m_creditsText.Dispose(); this.m_creditsText = null; this.m_creditsTitleText.Dispose(); this.m_creditsTitleText = null; Array.Clear(this.m_creditsTextTitleList, 0, this.m_creditsTextTitleList.Length); Array.Clear(this.m_creditsTextList, 0, this.m_creditsTextList.Length); this.m_creditsTextTitleList = null; this.m_creditsTextList = null; this.m_filmGrain.Dispose(); this.m_filmGrain = null; this.m_objectivePlate.Dispose(); this.m_objectivePlate = null; this.m_objectivePlateTween = null; this.m_sky.Dispose(); this.m_sky = null; this.m_whiteBG.Dispose(); this.m_whiteBG = null; this.m_compassBG.Dispose(); this.m_compassBG = null; this.m_compass.Dispose(); this.m_compass = null; if (this.m_compassDoor != null) { this.m_compassDoor.Dispose(); } this.m_compassDoor = null; this.m_castleBorderTexture.Dispose(); this.m_gardenBorderTexture.Dispose(); this.m_towerBorderTexture.Dispose(); this.m_dungeonBorderTexture.Dispose(); this.m_neoBorderTexture.Dispose(); this.m_castleBorderTexture = null; this.m_gardenBorderTexture = null; this.m_towerBorderTexture = null; this.m_dungeonBorderTexture = null; this.DebugTextObj.Dispose(); this.DebugTextObj = null; base.Dispose(); } }
public void DisplayObjective(string objectiveTitle, string objectiveDescription, string objectiveProgress, bool tween) { (this.m_objectivePlate.GetChildAt(4) as SpriteObj).ScaleX = 0f; (this.m_objectivePlate.GetChildAt(5) as SpriteObj).ScaleX = 0f; this.m_objectivePlate.GetChildAt(2).Opacity = 1f; this.m_objectivePlate.GetChildAt(3).Opacity = 1f; this.m_objectivePlate.X = 1470f; if (this.m_objectivePlateTween != null && this.m_objectivePlateTween.TweenedObject == this.m_objectivePlate && this.m_objectivePlateTween.Active) { this.m_objectivePlateTween.StopTween(false); } (this.m_objectivePlate.GetChildAt(1) as TextObj).Text = objectiveTitle; (this.m_objectivePlate.GetChildAt(2) as TextObj).Text = objectiveDescription; (this.m_objectivePlate.GetChildAt(3) as TextObj).Text = objectiveProgress; if (tween) { this.m_objectivePlateTween = Tween.By(this.m_objectivePlate, 0.5f, new Easing(Back.EaseOut), new string[] { "X", "-300" }); return; } this.m_objectivePlate.X -= 300f; }
/// <summary> /// 去除 /// </summary> /// <param name="tweenOgject"></param> internal void RemoveTween(TweenObject tweenOgject) { tweens.Remove(tweenOgject); }
public override void HandleInput() { if (!this.m_lockControls && (this.m_selectTween == null || (this.m_selectTween != null && !this.m_selectTween.Active))) { LineageObj selectedLineageObj = this.m_selectedLineageObj; int selectedLineageIndex = this.m_selectedLineageIndex; if (Game.GlobalInput.JustPressed(9) && SkillSystem.GetSkill(SkillType.Randomize_Children).ModifierAmount > 0f && !Game.PlayerStats.RerolledChildren) { this.m_lockControls = true; SoundManager.PlaySound(new string[] { "frame_woosh_01", "frame_woosh_02" }); if (this.m_xShift != 0) { this.m_xShift = 0; Tween.By(this.m_descriptionPlate, 0.2f, new Easing(Back.EaseOut), new string[] { "delay", "0.2", "X", "-600" }); this.m_selectTween = Tween.To(base.Camera, 0.3f, new Easing(Quad.EaseOut), new string[] { "delay", "0.2", "X", (this.m_masterArray.Count * this.m_xPosOffset).ToString() }); } (base.ScreenManager as RCScreenManager).StartWipeTransition(); Tween.RunFunction(0.2f, this, "RerollCurrentBranch", new object[0]); } if (Game.GlobalInput.Pressed(20) || Game.GlobalInput.Pressed(21)) { if (base.Camera.X > this.m_masterArray[0].X + 10f) { SoundManager.PlaySound("frame_swoosh_01"); this.m_selectTween = Tween.By(base.Camera, 0.3f, new Easing(Quad.EaseOut), new string[] { "X", (-this.m_xPosOffset).ToString() }); if (this.m_xShift == 0) { Tween.By(this.m_descriptionPlate, 0.2f, new Easing(Back.EaseIn), new string[] { "X", "600" }); } this.m_xShift--; } } else if ((Game.GlobalInput.Pressed(22) || Game.GlobalInput.Pressed(23)) && this.m_xShift < 0) { SoundManager.PlaySound("frame_swoosh_01"); this.m_selectTween = Tween.By(base.Camera, 0.3f, new Easing(Quad.EaseOut), new string[] { "X", this.m_xPosOffset.ToString() }); this.m_xShift++; if (this.m_xShift == 0) { Tween.By(this.m_descriptionPlate, 0.2f, new Easing(Back.EaseOut), new string[] { "X", "-600" }); } } if (this.m_xShift == 0) { if (Game.GlobalInput.JustPressed(16) || Game.GlobalInput.JustPressed(17)) { if (this.m_selectedLineageIndex > 0) { SoundManager.PlaySound("frame_swap"); } this.m_selectedLineageIndex--; if (this.m_selectedLineageIndex < 0) { this.m_selectedLineageIndex = 0; } if (this.m_selectedLineageIndex != selectedLineageIndex) { this.UpdateDescriptionPlate(); this.m_selectTween = Tween.By(this.m_currentBranchArray[0], 0.3f, new Easing(Quad.EaseOut), new string[] { "Y", "450" }); Tween.By(this.m_currentBranchArray[1], 0.3f, new Easing(Quad.EaseOut), new string[] { "Y", "450" }); Tween.By(this.m_currentBranchArray[2], 0.3f, new Easing(Quad.EaseOut), new string[] { "Y", "450" }); } } else if (Game.GlobalInput.JustPressed(18) || Game.GlobalInput.JustPressed(19)) { if (this.m_selectedLineageIndex < this.m_currentBranchArray.Count - 1) { SoundManager.PlaySound("frame_swap"); } this.m_selectedLineageIndex++; if (this.m_selectedLineageIndex > this.m_currentBranchArray.Count - 1) { this.m_selectedLineageIndex = this.m_currentBranchArray.Count - 1; } if (this.m_selectedLineageIndex != selectedLineageIndex) { this.UpdateDescriptionPlate(); this.m_selectTween = Tween.By(this.m_currentBranchArray[0], 0.3f, new Easing(Quad.EaseOut), new string[] { "Y", "-450" }); Tween.By(this.m_currentBranchArray[1], 0.3f, new Easing(Quad.EaseOut), new string[] { "Y", "-450" }); Tween.By(this.m_currentBranchArray[2], 0.3f, new Easing(Quad.EaseOut), new string[] { "Y", "-450" }); } } } this.m_selectedLineageObj = this.m_currentBranchArray[this.m_selectedLineageIndex]; if (Game.GlobalInput.JustPressed(0) || Game.GlobalInput.JustPressed(1)) { if (this.m_xShift == 0) { if (selectedLineageObj == this.m_selectedLineageObj) { RCScreenManager rCScreenManager = base.ScreenManager as RCScreenManager; rCScreenManager.DialogueScreen.SetDialogue("LineageChoiceWarning"); rCScreenManager.DialogueScreen.SetDialogueChoice("ConfirmTest1"); rCScreenManager.DialogueScreen.SetConfirmEndHandler(this, "StartGame", new object[0]); rCScreenManager.DialogueScreen.SetCancelEndHandler(typeof(Console), "WriteLine", new object[] { "Canceling Selection" }); (base.ScreenManager as RCScreenManager).DisplayScreen(13, true, null); } } else { this.m_xShift = 0; SoundManager.PlaySound(new string[] { "frame_woosh_01", "frame_woosh_02" }); Tween.By(this.m_descriptionPlate, 0.2f, new Easing(Back.EaseOut), new string[] { "X", "-600" }); this.m_selectTween = Tween.To(base.Camera, 0.3f, new Easing(Quad.EaseOut), new string[] { "X", (this.m_masterArray.Count * this.m_xPosOffset).ToString() }); } } base.HandleInput(); } }
public void InvokeOnCompleteEventReverse(TweenObject to) { IsPlaying = false; to.onCompleteTweenReverseEvent.Invoke(); }
public override void Dispose() { if (!base.IsDisposed) { if (this.m_currentLogicSet.IsActive) { this.m_currentLogicSet.Stop(); } this.m_currentLogicSet = null; this.m_standingAttack3LogicSet.Dispose(); this.m_standingAttack3LogicSet = null; this.m_airAttackLS.Dispose(); this.m_airAttackLS = null; this.m_debugInputMap.Dispose(); this.m_debugInputMap = null; this.m_playerHead = null; this.m_playerLegs = null; this.m_walkDownSound.Dispose(); this.m_walkDownSound = null; this.m_walkUpSound.Dispose(); this.m_walkUpSound = null; this.m_walkDownSoundLow.Dispose(); this.m_walkDownSoundLow = null; this.m_walkUpSoundLow.Dispose(); this.m_walkUpSoundLow = null; this.m_walkDownSoundHigh.Dispose(); this.m_walkDownSoundHigh = null; this.m_walkUpSoundHigh.Dispose(); this.m_walkUpSoundHigh = null; if (this.m_externalLS != null) { this.m_externalLS.Dispose(); } this.m_externalLS = null; this.m_lastTouchedTeleporter = null; this.m_flightDurationText.Dispose(); this.m_flightDurationText = null; this.m_game = null; this.m_translocatorSprite.Dispose(); this.m_translocatorSprite = null; this.m_swearBubble.Dispose(); this.m_swearBubble = null; this.m_flipTween = null; this.m_wizardSpellList.Clear(); this.m_wizardSpellList = null; this.m_closestGround = null; this.m_rapidDaggerProjData.Dispose(); this.m_axeProjData.Dispose(); base.Dispose(); } }
public override void Dispose() { if (!base.IsDisposed) { if (this.m_currentActiveLB.IsActive) { this.m_currentActiveLB.StopLogicBlock(); } this.m_currentActiveLB = null; foreach (LogicBlock current in this.logicBlocksToDispose) { current.Dispose(); } for (int i = 0; i < this.logicBlocksToDispose.Count; i++) { this.logicBlocksToDispose[i] = null; } this.logicBlocksToDispose.Clear(); this.logicBlocksToDispose = null; this.m_target = null; this.m_walkingLB.Dispose(); this.m_walkingLB = null; if (this.m_cooldownLB.IsActive) { this.m_cooldownLB.StopLogicBlock(); } this.m_cooldownLB.Dispose(); this.m_cooldownLB = null; if (this.m_engageRadiusTexture != null) { this.m_engageRadiusTexture.Dispose(); } this.m_engageRadiusTexture = null; if (this.m_engageRadiusTexture != null) { this.m_projectileRadiusTexture.Dispose(); } this.m_projectileRadiusTexture = null; if (this.m_engageRadiusTexture != null) { this.m_meleeRadiusTexture.Dispose(); } this.m_meleeRadiusTexture = null; if (this.m_cooldownParams != null) { Array.Clear(this.m_cooldownParams, 0, this.m_cooldownParams.Length); } this.m_cooldownParams = null; this.TintablePart = null; this.m_flipTween = null; base.Dispose(); } }
public override void Dispose() { if (!base.IsDisposed) { Console.WriteLine("Disposing Lineage Screen"); this.m_titleText.Dispose(); this.m_titleText = null; this.m_selectedLineageObj = null; foreach (LineageObj current in this.m_currentBranchArray) { current.Dispose(); } this.m_currentBranchArray.Clear(); this.m_currentBranchArray = null; foreach (LineageObj current2 in this.m_masterArray) { if (!current2.IsDisposed) { current2.Dispose(); } } this.m_masterArray.Clear(); this.m_masterArray = null; if (this.m_startingLineageObj != null) { this.m_startingLineageObj.Dispose(); } this.m_startingLineageObj = null; this.m_background.Dispose(); this.m_background = null; this.m_bgShadow.Dispose(); this.m_bgShadow = null; this.m_selectTween = null; this.m_descriptionPlate.Dispose(); this.m_descriptionPlate = null; this.m_confirmText.Dispose(); this.m_confirmText = null; this.m_navigationText.Dispose(); this.m_navigationText = null; this.m_rerollText.Dispose(); this.m_rerollText = null; base.Dispose(); } }
/// <summary> /// 添加 /// </summary> /// <param name="tweenOgject"></param> internal void AddTween(TweenObject tweenOgject) { tweens.Add(tweenOgject); }