You've already forked taptap2024_GJ_chidouren
updat core
This commit is contained in:
@@ -163,7 +163,7 @@ namespace Game.Component
|
||||
}
|
||||
}
|
||||
|
||||
public bool HasRunaway { get; private set; } = false;
|
||||
public bool HasRunaway => MapContent.Instance?.IsRunaway ?? false;
|
||||
|
||||
public float CurMoveSpeed => this._curMoveSpeedOffset * (this.MaxMoveSpeed *
|
||||
(1 +
|
||||
@@ -235,6 +235,7 @@ namespace Game.Component
|
||||
|
||||
AttackCheck ();
|
||||
CheckUpdateFsmData ();
|
||||
this._fsmController.DoUpdate ();
|
||||
}
|
||||
|
||||
private void AttackCheck ()
|
||||
|
||||
19
Assets/Scripts/Game/Component/EnemyFSM_AI/Runaway.cs
Normal file
19
Assets/Scripts/Game/Component/EnemyFSM_AI/Runaway.cs
Normal file
@@ -0,0 +1,19 @@
|
||||
namespace Game.Component.EnemyFSM_AI
|
||||
{
|
||||
public class Runaway : EnemyFSMState
|
||||
{
|
||||
public override void OnEnter ()
|
||||
{
|
||||
|
||||
this.Entity.AnimState.SetState (EnemyAnimStateType.Idle);
|
||||
this.Entity.EndAttack ();
|
||||
//角色进入idea状态时 重置状态
|
||||
this.SetAiTarget (this.Entity.CreatePos);
|
||||
}
|
||||
|
||||
public override void OnUpdate ()
|
||||
{
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,3 @@
|
||||
fileFormatVersion: 2
|
||||
guid: c272ad5978c64a97b2d8208f16e9cac6
|
||||
timeCreated: 1729522496
|
||||
@@ -1,5 +1,7 @@
|
||||
using System;
|
||||
using Framework.Timer;
|
||||
using Game.EventDefine;
|
||||
using UniFramework.Event;
|
||||
using UnityEngine;
|
||||
|
||||
namespace Game.Component
|
||||
@@ -12,12 +14,16 @@ namespace Game.Component
|
||||
|
||||
|
||||
public bool IsActiveGame;
|
||||
|
||||
|
||||
//玩家位置
|
||||
public Vector2 PlayerPosition { private set; get; }
|
||||
public bool IsRunaway { get ; private set ; }
|
||||
|
||||
private TimeHandler _RunawayTimeHandler;
|
||||
|
||||
//全局特殊单例
|
||||
public static MapContent Instance;
|
||||
private EventGroup _eventGroup = new EventGroup ();
|
||||
|
||||
private void Awake ()
|
||||
{
|
||||
@@ -34,11 +40,13 @@ namespace Game.Component
|
||||
private void OnEnable ()
|
||||
{
|
||||
GameUpdateMgr.Instance.AddUpdater (DoUpdate);
|
||||
this._eventGroup.AddListener<GameEventDefine.GlobalRunaway> ( OnRunaway );
|
||||
}
|
||||
|
||||
private void OnDisable ()
|
||||
{
|
||||
GameUpdateMgr.Instance.RemoveUpdater (DoUpdate);
|
||||
this._eventGroup.RemoveAllListener ();
|
||||
}
|
||||
|
||||
private void DoUpdate ()
|
||||
@@ -63,6 +71,8 @@ namespace Game.Component
|
||||
|
||||
public void ResetGame ()
|
||||
{
|
||||
this._RunawayTimeHandler?.Kill ();
|
||||
this.IsRunaway = false;
|
||||
this.ScenePart.RefreshInit ();
|
||||
this.PlayerEntity.transform.position = this.ScenePart.createPos.position;
|
||||
this.PlayerEntity.gameObject.SetActive (true);
|
||||
@@ -75,5 +85,13 @@ namespace Game.Component
|
||||
// ReSharper disable once Unity.NoNullPropagation
|
||||
this.ScenePart?.AddConditionNumber (messageOverlyCoin);
|
||||
}
|
||||
|
||||
private void OnRunaway (IEventMessage message)
|
||||
{
|
||||
GameEventDefine.GlobalRunaway runaway = (GameEventDefine.GlobalRunaway) message ;
|
||||
this.IsRunaway = true;
|
||||
this._RunawayTimeHandler?.Kill ();
|
||||
this._RunawayTimeHandler = GameUpdateMgr.Instance.CreateTimer (runaway.Duration, () => { this.IsRunaway = false; });
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -19,6 +19,10 @@ namespace Game.FsmNode
|
||||
protected override async void OnEnter (params object[] args)
|
||||
{
|
||||
AudioManager.Instance.PlaySoundEffect (SeAudio.OverGame_Success);
|
||||
if (RoomManager.Instance.PartIndex < 3)
|
||||
{
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -141,6 +141,10 @@ namespace Game
|
||||
AudioManager.Instance.PlaySoundEffect (SeAudio.Gaming_GetCoin);
|
||||
MapContent.Instance.OverlyCoin (message.overlyCoin);
|
||||
GlobalEventDefine.RefreshView.SendMessage ();
|
||||
if (MapContent.Instance.ScenePart.IsComplete)
|
||||
{
|
||||
this._gameFsm.OpenState (GameState.SuccessGame);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -51,6 +51,14 @@ namespace System
|
||||
this._cineMachineNormalImpulseSource.GenerateImpulse(vector.normalized * scale);
|
||||
}
|
||||
|
||||
public void SampleImpulseCamera (float time, Vector3 vector, float scale)
|
||||
{
|
||||
this._cineMachineNormalImpulseSource.m_ImpulseDefinition.m_ImpulseDuration = time;
|
||||
this._cineMachineNormalImpulseSource.m_ImpulseDefinition.m_ImpulseType = CinemachineImpulseDefinition.ImpulseTypes.Legacy;
|
||||
this._cineMachineNormalImpulseSource.m_ImpulseDefinition.m_ImpulseShape = CinemachineImpulseDefinition.ImpulseShapes.Bump;
|
||||
this._cineMachineNormalImpulseSource.GenerateImpulse(vector.normalized * scale);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 持续震动
|
||||
/// </summary>
|
||||
|
||||
@@ -88,7 +88,7 @@ namespace System
|
||||
return;
|
||||
#endif
|
||||
var shakeValue = Account.Instance.AccountSystemData.ShakeValue;
|
||||
var duration = 40 * (int)vibratorScale;
|
||||
var duration = 250;
|
||||
int type = (int)vibratorScale;
|
||||
|
||||
if (VibratorImp.Instance.HasCustomVibration ())
|
||||
|
||||
@@ -46,7 +46,7 @@ Material:
|
||||
m_Ints: []
|
||||
m_Floats:
|
||||
- Vector1_c9f2135c9d254951b22c018d295f8558: 0.003
|
||||
- _blurOffset: 1
|
||||
- _blurOffset: 0.08123708
|
||||
m_Colors: []
|
||||
m_BuildTextureStacks: []
|
||||
--- !u!114 &268278646524644520
|
||||
|
||||
@@ -62,9 +62,8 @@ namespace Views{
|
||||
|
||||
private void OnClickToGame()
|
||||
{
|
||||
// UIManager.Instance.OpenTip ("测试" , null);
|
||||
// return;
|
||||
//todo 此处进入游戏
|
||||
UIManager.Instance.OpenView (UIPanel.SuccessPanel);
|
||||
return;
|
||||
UIManager.Instance.OpenLoading (() =>
|
||||
{
|
||||
this.ViewConnector.CloseView ();
|
||||
|
||||
156
Assets/Scripts/Views/SuccessPanel.cs
Normal file
156
Assets/Scripts/Views/SuccessPanel.cs
Normal file
@@ -0,0 +1,156 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using Coffee.UIEffects;
|
||||
using Cysharp.Threading.Tasks;
|
||||
using Framework.Timer;
|
||||
using Game;
|
||||
using Game.Component;
|
||||
using UnityEngine;
|
||||
using UnityEngine.UI;
|
||||
using IcecreamView;
|
||||
using MintAnimation.Core;
|
||||
|
||||
namespace Views{
|
||||
|
||||
public class SuccessPanel : IcecreamView.IC_AbstractModule
|
||||
{
|
||||
|
||||
public UIDissolve[] TopFragments;
|
||||
public UIDissolve[] LeftFragments;
|
||||
public UIDissolve[] RightFragments;
|
||||
|
||||
public GameObject redPoint;
|
||||
public GameObject greenPoint;
|
||||
public GameObject bluePoint;
|
||||
|
||||
public GameObject lastFragment;
|
||||
|
||||
public ObjectShake Shake;
|
||||
|
||||
|
||||
public override void OnOpenView(IC_ViewData parameters)
|
||||
{
|
||||
var index = parameters.GetValue<int> ();
|
||||
this.lastFragment.SetActive (false);
|
||||
this.redPoint.SetActive (false);
|
||||
this.greenPoint.SetActive (false);
|
||||
this.bluePoint.SetActive (false);
|
||||
foreach (var topFragment in this.TopFragments)
|
||||
{
|
||||
topFragment.effectFactor = 1;
|
||||
}
|
||||
foreach (var leftFragment in this.LeftFragments)
|
||||
{
|
||||
leftFragment.effectFactor = 1;
|
||||
}
|
||||
foreach (var rightFragment in this.RightFragments)
|
||||
{
|
||||
rightFragment.effectFactor = 1;
|
||||
}
|
||||
UpdateAnim (index);
|
||||
}
|
||||
|
||||
public override void OnCloseView()
|
||||
{
|
||||
|
||||
}
|
||||
// #if UNITY_EDITOR
|
||||
// private bool tempLock;
|
||||
// private async void Update ()
|
||||
// {
|
||||
// if (this.tempLock)
|
||||
// {
|
||||
// return;
|
||||
// }
|
||||
//
|
||||
// if (Input.GetKeyDown (KeyCode.A))
|
||||
// {
|
||||
// this.tempLock = true;
|
||||
// UpdateAnim (1);
|
||||
// await UniTask.Delay (5000);
|
||||
// this.tempLock = false;
|
||||
// }
|
||||
// if (Input.GetKeyDown (KeyCode.S))
|
||||
// {
|
||||
// this.tempLock = true;
|
||||
// UpdateAnim (2);
|
||||
// await UniTask.Delay (5000);
|
||||
// this.tempLock = false;
|
||||
// }
|
||||
// if (Input.GetKeyDown (KeyCode.D))
|
||||
// {
|
||||
// this.tempLock = true;
|
||||
// UpdateAnim (3);
|
||||
// await UniTask.Delay (5000);
|
||||
// this.tempLock = false;
|
||||
// }
|
||||
// }
|
||||
// #endif
|
||||
|
||||
|
||||
public async void UpdateAnim (int index)
|
||||
{
|
||||
lastFragment.SetActive (false);
|
||||
foreach (var topFragment in this.TopFragments)
|
||||
{
|
||||
topFragment.effectFactor = index > 1 ? 0 : 1;
|
||||
}
|
||||
foreach (var leftFragment in this.LeftFragments)
|
||||
{
|
||||
leftFragment.effectFactor = index > 2 ? 0 : 1;
|
||||
}
|
||||
|
||||
foreach (var rightFragment in this.RightFragments)
|
||||
{
|
||||
rightFragment.effectFactor = index > 3 ? 0 : 1;
|
||||
}
|
||||
|
||||
this.redPoint.SetActive (index > 1);
|
||||
this.greenPoint.SetActive (index > 2);
|
||||
this.bluePoint.SetActive (index > 3);
|
||||
|
||||
UIDissolve[] effects = index switch
|
||||
{
|
||||
1 => this.TopFragments,
|
||||
2 => this.LeftFragments,
|
||||
3 => this.RightFragments,
|
||||
_ => null
|
||||
};
|
||||
GameObject point = index switch
|
||||
{
|
||||
1 => this.redPoint,
|
||||
2 => this.greenPoint,
|
||||
3 => this.bluePoint,
|
||||
_ => null
|
||||
};
|
||||
await AnimOpen (effects , point);
|
||||
if (index >= 3)
|
||||
{
|
||||
this.lastFragment.SetActive (true);
|
||||
Shake.ShakeFor (0.25f , 0.75f);
|
||||
CameraImpulseUtils.Instance.UniformImpulseCamera (0.5f , 4);
|
||||
GameManager.Instance.Vibrator (VibratorScale.Normal);
|
||||
}
|
||||
}
|
||||
|
||||
private async UniTask AnimOpen (UIDissolve[] effects , GameObject point)
|
||||
{
|
||||
var taskTracker = GameUpdateMgr.Instance.CreateTask ();
|
||||
GameUpdateMgr.Instance.CreateTimer (0.75f , taskTracker.ListenerAction , progress =>
|
||||
{
|
||||
var f = MintEaseAction.InQuart (0 , 1 ,progress);
|
||||
foreach (var uiEffect in effects)
|
||||
{
|
||||
uiEffect.effectFactor = 1 - f;
|
||||
}
|
||||
});
|
||||
await taskTracker.Task;
|
||||
Shake.ShakeFor (0.15f , 0.35f);
|
||||
GameManager.Instance.Vibrator (VibratorScale.Small);
|
||||
CameraImpulseUtils.Instance.UniformImpulseCamera (0.5f , 2);
|
||||
point.SetActive (true);
|
||||
point.transform.GetChild (0).gameObject.SetActive (true);
|
||||
await UniTask.Delay (2000);
|
||||
}
|
||||
}
|
||||
}
|
||||
11
Assets/Scripts/Views/SuccessPanel.cs.meta
Normal file
11
Assets/Scripts/Views/SuccessPanel.cs.meta
Normal file
@@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 67d773b2a24e975459182e789c1a4b63
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -20,6 +20,7 @@ namespace Views
|
||||
public const string SelectWeaponPanel ="SelectWeaponPanel";
|
||||
public const string AboutPanel ="AboutPanel";
|
||||
public const string GamePanel ="GamePanel";
|
||||
public const string SuccessPanel ="SuccessPanel";
|
||||
//Code end
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user