完善加速跑
This commit is contained in:
parent
3be7c34642
commit
1337bb8c13
@ -119,10 +119,14 @@ Transform:
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 439879375179747351}
|
||||
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
|
||||
m_LocalPosition: {x: 3.66, y: 5.16, z: -2.09}
|
||||
m_LocalPosition: {x: 3.66, y: 5.16, z: -7.01}
|
||||
m_LocalScale: {x: 1, y: 1, z: 1}
|
||||
m_Children:
|
||||
- {fileID: 8746380691103001663}
|
||||
- {fileID: 5890863113073602243}
|
||||
- {fileID: 6445731006565275078}
|
||||
- {fileID: 981876493472615251}
|
||||
- {fileID: 3509611248466785242}
|
||||
m_Father: {fileID: 1377482919428722225}
|
||||
m_RootOrder: 2
|
||||
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
|
||||
@ -407,6 +411,36 @@ Rigidbody:
|
||||
m_Interpolate: 0
|
||||
m_Constraints: 0
|
||||
m_CollisionDetection: 0
|
||||
--- !u!1 &1590988042141038283
|
||||
GameObject:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
serializedVersion: 6
|
||||
m_Component:
|
||||
- component: {fileID: 3509611248466785242}
|
||||
m_Layer: 0
|
||||
m_Name: Pos (3)
|
||||
m_TagString: Untagged
|
||||
m_Icon: {fileID: 0}
|
||||
m_NavMeshLayer: 0
|
||||
m_StaticEditorFlags: 0
|
||||
m_IsActive: 1
|
||||
--- !u!4 &3509611248466785242
|
||||
Transform:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 1590988042141038283}
|
||||
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
|
||||
m_LocalPosition: {x: 7.78, y: 0, z: 0}
|
||||
m_LocalScale: {x: 1, y: 1, z: 1}
|
||||
m_Children: []
|
||||
m_Father: {fileID: 6968117161319888219}
|
||||
m_RootOrder: 4
|
||||
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
|
||||
--- !u!1 &1777036425267892462
|
||||
GameObject:
|
||||
m_ObjectHideFlags: 0
|
||||
@ -788,6 +822,36 @@ Transform:
|
||||
m_Father: {fileID: 1377482919428722225}
|
||||
m_RootOrder: 48
|
||||
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
|
||||
--- !u!1 &4499637179419588831
|
||||
GameObject:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
serializedVersion: 6
|
||||
m_Component:
|
||||
- component: {fileID: 981876493472615251}
|
||||
m_Layer: 0
|
||||
m_Name: Pos (2)
|
||||
m_TagString: Untagged
|
||||
m_Icon: {fileID: 0}
|
||||
m_NavMeshLayer: 0
|
||||
m_StaticEditorFlags: 0
|
||||
m_IsActive: 1
|
||||
--- !u!4 &981876493472615251
|
||||
Transform:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 4499637179419588831}
|
||||
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
|
||||
m_LocalPosition: {x: 4.11, y: 0, z: 0}
|
||||
m_LocalScale: {x: 1, y: 1, z: 1}
|
||||
m_Children: []
|
||||
m_Father: {fileID: 6968117161319888219}
|
||||
m_RootOrder: 3
|
||||
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
|
||||
--- !u!1 &5105545367418106500
|
||||
GameObject:
|
||||
m_ObjectHideFlags: 0
|
||||
@ -1182,6 +1246,36 @@ BoxCollider:
|
||||
serializedVersion: 2
|
||||
m_Size: {x: 1, y: 1, z: 1}
|
||||
m_Center: {x: 0, y: 0, z: 0}
|
||||
--- !u!1 &7099932027311794177
|
||||
GameObject:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
serializedVersion: 6
|
||||
m_Component:
|
||||
- component: {fileID: 6445731006565275078}
|
||||
m_Layer: 0
|
||||
m_Name: Pos (1)
|
||||
m_TagString: Untagged
|
||||
m_Icon: {fileID: 0}
|
||||
m_NavMeshLayer: 0
|
||||
m_StaticEditorFlags: 0
|
||||
m_IsActive: 1
|
||||
--- !u!4 &6445731006565275078
|
||||
Transform:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 7099932027311794177}
|
||||
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
|
||||
m_LocalPosition: {x: 1.67, y: 0, z: 0}
|
||||
m_LocalScale: {x: 1, y: 1, z: 1}
|
||||
m_Children: []
|
||||
m_Father: {fileID: 6968117161319888219}
|
||||
m_RootOrder: 2
|
||||
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
|
||||
--- !u!1 &7419622570795737872
|
||||
GameObject:
|
||||
m_ObjectHideFlags: 0
|
||||
@ -1354,6 +1448,36 @@ BoxCollider:
|
||||
serializedVersion: 2
|
||||
m_Size: {x: 1, y: 1, z: 1}
|
||||
m_Center: {x: 0, y: 0, z: 0}
|
||||
--- !u!1 &7766542404369853043
|
||||
GameObject:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
serializedVersion: 6
|
||||
m_Component:
|
||||
- component: {fileID: 5890863113073602243}
|
||||
m_Layer: 0
|
||||
m_Name: Pos
|
||||
m_TagString: Untagged
|
||||
m_Icon: {fileID: 0}
|
||||
m_NavMeshLayer: 0
|
||||
m_StaticEditorFlags: 0
|
||||
m_IsActive: 1
|
||||
--- !u!4 &5890863113073602243
|
||||
Transform:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 7766542404369853043}
|
||||
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
|
||||
m_LocalPosition: {x: 0, y: 0, z: 0}
|
||||
m_LocalScale: {x: 1, y: 1, z: 1}
|
||||
m_Children: []
|
||||
m_Father: {fileID: 6968117161319888219}
|
||||
m_RootOrder: 1
|
||||
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
|
||||
--- !u!1001 &65211413
|
||||
PrefabInstance:
|
||||
m_ObjectHideFlags: 0
|
||||
|
@ -71,7 +71,7 @@ AnimationClip:
|
||||
m_Level: 0
|
||||
m_CycleOffset: 0
|
||||
m_HasAdditiveReferencePose: 0
|
||||
m_LoopTime: 0
|
||||
m_LoopTime: 1
|
||||
m_LoopBlend: 0
|
||||
m_LoopBlendOrientation: 0
|
||||
m_LoopBlendPositionY: 0
|
||||
|
@ -32,7 +32,8 @@ AnimatorState:
|
||||
m_Name: NoneAttack
|
||||
m_Speed: 1
|
||||
m_CycleOffset: 0
|
||||
m_Transitions: []
|
||||
m_Transitions:
|
||||
- {fileID: -2504087700697766814}
|
||||
m_StateMachineBehaviours: []
|
||||
m_Position: {x: 50, y: 50, z: 0}
|
||||
m_IKOnFeet: 0
|
||||
@ -80,7 +81,8 @@ AnimatorState:
|
||||
m_Name: KeepAttack
|
||||
m_Speed: 1
|
||||
m_CycleOffset: 0
|
||||
m_Transitions: []
|
||||
m_Transitions:
|
||||
- {fileID: 9175103689760011087}
|
||||
m_StateMachineBehaviours: []
|
||||
m_Position: {x: 50, y: 50, z: 0}
|
||||
m_IKOnFeet: 0
|
||||
@ -96,6 +98,31 @@ AnimatorState:
|
||||
m_MirrorParameter:
|
||||
m_CycleOffsetParameter:
|
||||
m_TimeParameter:
|
||||
--- !u!1101 &-2504087700697766814
|
||||
AnimatorStateTransition:
|
||||
m_ObjectHideFlags: 1
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_Name:
|
||||
m_Conditions:
|
||||
- m_ConditionMode: 1
|
||||
m_ConditionEvent: KeepAttack
|
||||
m_EventTreshold: 0
|
||||
m_DstStateMachine: {fileID: 0}
|
||||
m_DstState: {fileID: -2913372157276921532}
|
||||
m_Solo: 0
|
||||
m_Mute: 0
|
||||
m_IsExit: 0
|
||||
serializedVersion: 3
|
||||
m_TransitionDuration: 0
|
||||
m_TransitionOffset: 0
|
||||
m_ExitTime: 1.0000001
|
||||
m_HasExitTime: 0
|
||||
m_HasFixedDuration: 1
|
||||
m_InterruptionSource: 0
|
||||
m_OrderedInterruption: 1
|
||||
m_CanTransitionToSelf: 1
|
||||
--- !u!1101 &-2217922872224882137
|
||||
AnimatorStateTransition:
|
||||
m_ObjectHideFlags: 1
|
||||
@ -126,7 +153,13 @@ AnimatorController:
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_Name: NormalAttack
|
||||
serializedVersion: 5
|
||||
m_AnimatorParameters: []
|
||||
m_AnimatorParameters:
|
||||
- m_Name: KeepAttack
|
||||
m_Type: 4
|
||||
m_DefaultFloat: 0
|
||||
m_DefaultInt: 0
|
||||
m_DefaultBool: 0
|
||||
m_Controller: {fileID: 0}
|
||||
m_AnimatorLayers:
|
||||
- serializedVersion: 5
|
||||
m_Name: Base Layer
|
||||
@ -187,10 +220,10 @@ AnimatorStateMachine:
|
||||
m_Position: {x: 510, y: 180, z: 0}
|
||||
- serializedVersion: 1
|
||||
m_State: {fileID: 2726917790948579376}
|
||||
m_Position: {x: 580, y: -20, z: 0}
|
||||
m_Position: {x: 650, y: -30, z: 0}
|
||||
- serializedVersion: 1
|
||||
m_State: {fileID: -2913372157276921532}
|
||||
m_Position: {x: 420, y: -80, z: 0}
|
||||
m_Position: {x: 460, y: -90, z: 0}
|
||||
m_ChildStateMachines: []
|
||||
m_AnyStateTransitions: []
|
||||
m_EntryTransitions: []
|
||||
@ -254,3 +287,28 @@ AnimatorState:
|
||||
m_MirrorParameter:
|
||||
m_CycleOffsetParameter:
|
||||
m_TimeParameter:
|
||||
--- !u!1101 &9175103689760011087
|
||||
AnimatorStateTransition:
|
||||
m_ObjectHideFlags: 1
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_Name:
|
||||
m_Conditions:
|
||||
- m_ConditionMode: 2
|
||||
m_ConditionEvent: KeepAttack
|
||||
m_EventTreshold: 0
|
||||
m_DstStateMachine: {fileID: 0}
|
||||
m_DstState: {fileID: -8692109954130743551}
|
||||
m_Solo: 0
|
||||
m_Mute: 0
|
||||
m_IsExit: 0
|
||||
serializedVersion: 3
|
||||
m_TransitionDuration: 0
|
||||
m_TransitionOffset: 0
|
||||
m_ExitTime: 1.0000001
|
||||
m_HasExitTime: 0
|
||||
m_HasFixedDuration: 1
|
||||
m_InterruptionSource: 0
|
||||
m_OrderedInterruption: 1
|
||||
m_CanTransitionToSelf: 1
|
||||
|
@ -59,8 +59,12 @@ namespace Game
|
||||
|
||||
int Damage = 40;
|
||||
|
||||
if (GamePlayEntry.MainPlayer.Player.IsFastSkillMode)
|
||||
Damage = 200;
|
||||
|
||||
SetDamage(UnderAttack, Damage, out bool IsDead);
|
||||
|
||||
GamePlayEntry.Tips.ShowHint($"产生一次攻击,攻击者{Attacker.name} 受击者{UnderAttack.name},造成伤害{Damage}", eHintType.Warn);
|
||||
SetDamage(UnderAttack, Damage);
|
||||
}
|
||||
//怪打人
|
||||
else if (Attacker.RoleType == E_NODE_TYPE.N_MONSTER && UnderAttack.RoleType == E_NODE_TYPE.N_MAINPLAYER)
|
||||
@ -73,7 +77,7 @@ namespace Game
|
||||
CanAttack = true;
|
||||
|
||||
int Damage = 40;
|
||||
SetDamage(UnderAttack, Damage);
|
||||
SetDamage(UnderAttack, Damage,out bool IsDead);
|
||||
}
|
||||
|
||||
if (CanAttack)
|
||||
@ -88,8 +92,9 @@ namespace Game
|
||||
/// </summary>
|
||||
/// <param name="role"></param>
|
||||
/// <param name="Damage"></param>
|
||||
private void SetDamage(RoleBase UnderAttack, int DamageHP)
|
||||
private void SetDamage(RoleBase UnderAttack, int DamageHP,out bool IsDead)
|
||||
{
|
||||
IsDead = false;
|
||||
//TODO 可能需要把伤害做成复合数据,扣除多项属性
|
||||
|
||||
UnderAttack.BaseData.life.curHP -= DamageHP;
|
||||
@ -99,8 +104,10 @@ namespace Game
|
||||
UnderAttack.Anime.PlayHit();
|
||||
else
|
||||
{
|
||||
IsDead = true;
|
||||
//死亡
|
||||
UnderAttack.Anime.PlayDead();
|
||||
GamePlayEntry.Tips.ShowHint($"ÊÜ»÷Õß{UnderAttack.name},ËÀÍö", eHintType.Warn);
|
||||
AppEntry.Event.Fire(null, RoleDeadEventArgs.Create(UnderAttack.RoleType, UnderAttack.RoleID));
|
||||
}
|
||||
}
|
||||
|
@ -20,6 +20,11 @@ namespace Game
|
||||
|
||||
public MainRole Player;
|
||||
|
||||
/// <summary>
|
||||
/// 摄像机Fov TODO后续应该移动到摄像机管理
|
||||
/// </summary>
|
||||
public float srcCameraFov;
|
||||
|
||||
//Rigidbody mRigidbody;
|
||||
public bool bLoadFinish { get; private set; } = false;
|
||||
|
||||
@ -71,10 +76,14 @@ namespace Game
|
||||
|
||||
//把摄像机Node挂到玩家下
|
||||
MainCamNode.parent = Player.transform;
|
||||
MainCamNode.localPosition = Vector3.zero;
|
||||
MainCamNode.localEulerAngles = Vector3.zero;
|
||||
//把主摄像机挂到MainCamNode的CamPos下
|
||||
Camera.main.transform.parent = CamPos;
|
||||
Camera.main.transform.localPosition = Vector3.zero;
|
||||
Camera.main.transform.localEulerAngles = Vector3.zero;
|
||||
|
||||
srcCameraFov = Camera.main.fieldOfView;
|
||||
}
|
||||
|
||||
public void Update_MoveForInput()
|
||||
|
@ -19,7 +19,7 @@ namespace Game
|
||||
/// </summary>
|
||||
public Vector3 SpawnPos { get; private set; }
|
||||
|
||||
public Vector3 SpawnMonster { get; private set; }
|
||||
public List<Vector3> SpawnMonsterPos { get; private set; } = new List<Vector3>();
|
||||
|
||||
// Start is called before the first frame update
|
||||
void Start()
|
||||
@ -35,11 +35,27 @@ namespace Game
|
||||
//TODO Òì²½
|
||||
GameObject mapgo = CloneMap(MapId);
|
||||
SpawnPos = mapgo.transform.Find("SpawnPos").transform.position;
|
||||
SpawnMonster = mapgo.transform.Find("SpawnMonster").transform.position;
|
||||
var SpawnMonster = mapgo.transform.Find("SpawnMonster");
|
||||
|
||||
SpawnMonsterPos.Clear();
|
||||
for (int i = 0;i < SpawnMonster.childCount;i++)
|
||||
{
|
||||
if (SpawnMonster.GetChild(i).name.ToLower().Contains("pos"))
|
||||
SpawnMonsterPos.Add(SpawnMonster.GetChild(i).position);
|
||||
}
|
||||
|
||||
MapGoList.Add(mapgo);
|
||||
bLoadFinish = true;
|
||||
}
|
||||
|
||||
public void SpawnMapMonster()
|
||||
{
|
||||
for (int i = 0; i < SpawnMonsterPos.Count; i++)
|
||||
{
|
||||
GamePlayEntry.RoleMgr.CreateMonster(SpawnMonsterPos[i]);
|
||||
}
|
||||
}
|
||||
|
||||
public void RemoveMapGameObjs()
|
||||
{
|
||||
mMapId = 0;
|
||||
|
@ -121,8 +121,7 @@ namespace Game
|
||||
|
||||
//实例化角色
|
||||
GameObject playergo = CloneRole(ModelName, GamePlayEntry.MainPlayer.transform);
|
||||
playergo.transform.localPosition = Vector3.zero;
|
||||
GamePlayEntry.MainPlayer.transform.position = data.status.pos;
|
||||
playergo.transform.position = data.status.pos;
|
||||
|
||||
SetRigibody(playergo.transform);
|
||||
|
||||
@ -144,7 +143,7 @@ namespace Game
|
||||
return role;
|
||||
}
|
||||
|
||||
public MonsterRole CreateMonster()
|
||||
public MonsterRole CreateMonster(Vector3 SpawnPos)
|
||||
{
|
||||
//数据
|
||||
S_ROLE_MONSTER data = new S_ROLE_MONSTER();
|
||||
@ -160,7 +159,7 @@ namespace Game
|
||||
|
||||
//状态等
|
||||
data.status.state = CharacterState.Living;
|
||||
data.status.pos = GamePlayEntry.Map.SpawnMonster;
|
||||
data.status.pos = SpawnPos;
|
||||
data.status.mapid = 0;//TODO
|
||||
|
||||
//生命魔法等
|
||||
@ -173,8 +172,7 @@ namespace Game
|
||||
|
||||
//实例化角色
|
||||
GameObject playergo = CloneRole(ModelName, GamePlayEntry.RoleMgr.transform);
|
||||
playergo.transform.localPosition = Vector3.zero;
|
||||
GamePlayEntry.MainPlayer.transform.position = data.status.pos;
|
||||
playergo.transform.position = data.status.pos;
|
||||
|
||||
SetRigibody(playergo.transform);
|
||||
|
||||
|
@ -4,6 +4,10 @@ using UnityEngine;
|
||||
|
||||
public class ConstClass
|
||||
{
|
||||
static public Vector3 Angle_RightDir => Vector3.zero;
|
||||
static public Vector3 Angle_LeftDir = new Vector3(0, 180, 0);
|
||||
public static Vector3 Angle_RightDir => Vector3.zero;
|
||||
public static Vector3 Angle_LeftDir = new Vector3(0, 180, 0);
|
||||
|
||||
public const float ToFastModeTime = 2f;
|
||||
public static float FastRunSpeedMultiplier = 3f;
|
||||
public static float FastModeShadowCreateIntervalTime = 0.25f;
|
||||
}
|
||||
|
@ -86,6 +86,7 @@ public class RoleFastShadow : MonoBehaviour
|
||||
|
||||
public void LoadData()
|
||||
{
|
||||
ClearHistory();
|
||||
RoleSnapshotClass[] srcData = GamePlayEntry.MainPlayer.Player.mRoleSnapshot.GetHistoryArray();
|
||||
float time = 0;
|
||||
Vector3 pos;
|
||||
@ -115,6 +116,9 @@ public class RoleFastShadow : MonoBehaviour
|
||||
NextPlayTime = 0;
|
||||
StartPlayTime = Time.time;
|
||||
NextPos = Vector3.zero;
|
||||
|
||||
|
||||
this.transform.position = KeyHistory[0].Pos;
|
||||
}
|
||||
}
|
||||
|
||||
@ -132,7 +136,6 @@ public class RoleFastShadow : MonoBehaviour
|
||||
//未到达播放下一帧的事件
|
||||
if (!bCanPlay || Time.time < NextPlayTime)
|
||||
return;
|
||||
|
||||
CurrPlayIndex++;
|
||||
|
||||
PlayRoleSnapshotClass snap = KeyHistory[CurrPlayIndex];
|
||||
|
@ -18,9 +18,7 @@ public class ProcedureInitRole : ProcedureBase
|
||||
GamePlayEntry.MainPlayer.LoadPlayer();
|
||||
|
||||
//生成怪物
|
||||
GamePlayEntry.RoleMgr.CreateMonster();
|
||||
//GamePlayEntry.RoleMgr.CreateMonster();
|
||||
//GamePlayEntry.RoleMgr.CreateMonster();
|
||||
GamePlayEntry.Map.SpawnMapMonster();
|
||||
|
||||
//TODO 一些初始化 管理 等等
|
||||
m_IsInitSuccessful = true;
|
||||
|
@ -36,6 +36,11 @@ namespace Game
|
||||
base.OnDisable();
|
||||
}
|
||||
|
||||
protected override void FixedUpdate()
|
||||
{
|
||||
base.FixedUpdate();
|
||||
FixedUpdate_FastMoveMode();
|
||||
}
|
||||
|
||||
const int SnapInterval = 3;
|
||||
int SnapIntervalIndex = 0;
|
||||
@ -61,25 +66,25 @@ namespace Game
|
||||
if (Input.GetKeyDown(KeyCode.G))
|
||||
{
|
||||
Anime.SetAnimatorSpeed(1f);
|
||||
Move_Speed = 3.5f * 1f;
|
||||
Move_BaseSpeed = 3.5f * 1f;
|
||||
}
|
||||
|
||||
if (Input.GetKeyDown(KeyCode.Y))
|
||||
{
|
||||
Anime.SetAnimatorSpeed(1.5f);
|
||||
Move_Speed = 3.5f * 1.5f;
|
||||
Move_BaseSpeed = 3.5f * 1.5f;
|
||||
}
|
||||
|
||||
if (Input.GetKeyDown(KeyCode.U))
|
||||
{
|
||||
Anime.SetAnimatorSpeed(2f);
|
||||
Move_Speed = 3.5f * 2f;
|
||||
Move_BaseSpeed = 3.5f * 2f;
|
||||
}
|
||||
|
||||
if (Input.GetKeyDown(KeyCode.I))
|
||||
{
|
||||
Anime.SetAnimatorSpeed(2.6f);
|
||||
Move_Speed = 3.5f * 2.6f;
|
||||
Move_BaseSpeed = 3.5f * 2.6f;
|
||||
}
|
||||
|
||||
}
|
||||
@ -100,5 +105,83 @@ namespace Game
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
#region 高速移动模式
|
||||
|
||||
private bool mIsFastSkillMode = false;
|
||||
private float LastFastShadowCreateTime = 0;
|
||||
public bool IsFastSkillMode
|
||||
{
|
||||
get { return mIsFastSkillMode; }
|
||||
set
|
||||
{
|
||||
if (mIsFastSkillMode != value)
|
||||
{
|
||||
mIsFastSkillMode = value;
|
||||
if (value)
|
||||
{
|
||||
AxibugLog.Debug("高速模式:开");
|
||||
//刚开始高速移动模式
|
||||
Move_SpeedMultiplier = ConstClass.FastRunSpeedMultiplier;
|
||||
Anime.SetAnimatorSpeed(ConstClass.FastRunSpeedMultiplier);
|
||||
AttackBoxAnime.SetBool("KeepAttack", true);
|
||||
}
|
||||
else
|
||||
{
|
||||
AxibugLog.Debug("高速模式:关");
|
||||
//刚停止高速移动模式
|
||||
Move_SpeedMultiplier = 1f;
|
||||
Anime.SetAnimatorSpeed(1f);
|
||||
AttackBoxAnime.SetBool("KeepAttack", false);
|
||||
|
||||
//Camera.main.fieldOfView = GamePlayEntry.MainPlayer.srcCameraFov;
|
||||
|
||||
//清理影子
|
||||
GamePlayEntry.EffectMgr.rolegastEftPool.Hide();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public void FixedUpdate_FastMoveMode()
|
||||
{
|
||||
if (!IsMove)
|
||||
{
|
||||
IsFastSkillMode = false;
|
||||
}
|
||||
else
|
||||
{
|
||||
//如果超过移动时间
|
||||
if(MoveTime > ConstClass.ToFastModeTime)
|
||||
IsFastSkillMode = true;
|
||||
else
|
||||
IsFastSkillMode = false;
|
||||
}
|
||||
|
||||
//高速模式开影子
|
||||
if (IsFastSkillMode)
|
||||
{
|
||||
if (Time.time - LastFastShadowCreateTime > ConstClass.FastModeShadowCreateIntervalTime)
|
||||
{
|
||||
LastFastShadowCreateTime = Time.time;
|
||||
AxibugLog.Debug("创建影子");
|
||||
//创建影子
|
||||
GamePlayEntry.EffectMgr.rolegastEftPool.GetAnyHide();
|
||||
}
|
||||
|
||||
float fov = Camera.main.fieldOfView;
|
||||
fov += 30f * Time.deltaTime;
|
||||
fov = Mathf.Min(GamePlayEntry.MainPlayer.srcCameraFov + 10f, fov);
|
||||
Camera.main.fieldOfView = fov;
|
||||
}
|
||||
else
|
||||
{
|
||||
float fov = Camera.main.fieldOfView;
|
||||
fov -= 25f * Time.deltaTime;
|
||||
fov = Mathf.Max(GamePlayEntry.MainPlayer.srcCameraFov, fov);
|
||||
Camera.main.fieldOfView = fov;
|
||||
}
|
||||
}
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
|
@ -19,11 +19,8 @@ namespace Game
|
||||
public AttackBox AttackBoxCollider;
|
||||
|
||||
public Vector2 InputV2;
|
||||
public bool mIsMove = false;
|
||||
public bool mIsLeft = false;
|
||||
|
||||
public E_ONCEATTACK_STEP AttackStep = E_ONCEATTACK_STEP.None;
|
||||
bool LastIsMove = false;
|
||||
bool LastIsLeft = false;
|
||||
|
||||
public Transform ModelTransfrom { get { return mModelTransfrom; } }
|
||||
public Transform BridgeTransfrom { get { return mBridgeTransfrom; } }
|
||||
@ -51,11 +48,8 @@ namespace Game
|
||||
|
||||
protected virtual void OnEnable()
|
||||
{
|
||||
mIsMove = false;
|
||||
LastIsMove = false;
|
||||
|
||||
mIsLeft = false;
|
||||
LastIsLeft = false;
|
||||
IsMove = false;
|
||||
IsLeft = false;
|
||||
|
||||
AttackStep = E_ONCEATTACK_STEP.None;
|
||||
|
||||
@ -76,7 +70,7 @@ namespace Game
|
||||
if (RoleType == E_NODE_TYPE.N_MAINPLAYER)
|
||||
{
|
||||
mAnime = new CharacterMachine();
|
||||
mAnime.InitMachine(mModelTransfrom,data);
|
||||
mAnime.InitMachine(mModelTransfrom, data);
|
||||
}
|
||||
else if (RoleType == E_NODE_TYPE.N_MONSTER)
|
||||
{
|
||||
@ -98,60 +92,14 @@ namespace Game
|
||||
|
||||
protected virtual void Update()
|
||||
{
|
||||
#region Òƶ¯
|
||||
|
||||
if (AttackStep != E_ONCEATTACK_STEP.None)
|
||||
{
|
||||
LastIsMove = false;
|
||||
Move_currentVector = Vector3.zero;
|
||||
}
|
||||
else
|
||||
{
|
||||
//ÊÇ·ñÒƶ¯
|
||||
bool ToMoveState = false;
|
||||
if (InputV2 != Vector2.zero)
|
||||
ToMoveState = true;
|
||||
|
||||
if (LastIsMove != ToMoveState)
|
||||
{
|
||||
//AxibugLog.Debug("MeshChangeMoveState =>" + ToMoveState);
|
||||
MeshChangeMoveState(ToMoveState);
|
||||
}
|
||||
LastIsMove = ToMoveState;
|
||||
|
||||
Move_currentVector = new Vector3(InputV2.x, 0, InputV2.y);
|
||||
//AxibugLog.Debug("Move_currentVector =>" + Move_currentVector);
|
||||
|
||||
|
||||
//³¯Ïò
|
||||
bool ToLeftDir = false;
|
||||
bool bChange = false;
|
||||
if (InputV2.x < 0)
|
||||
{
|
||||
ToLeftDir = true;
|
||||
bChange = true;
|
||||
}
|
||||
else if (InputV2.x > 0)
|
||||
{
|
||||
ToLeftDir = false;
|
||||
bChange = true;
|
||||
}
|
||||
|
||||
if (bChange && LastIsLeft != ToLeftDir)
|
||||
{
|
||||
//AxibugLog.Debug("MeshChangeDir =>" + ToLeftDir);
|
||||
MeshChangeDir(ToLeftDir);
|
||||
LastIsLeft = ToLeftDir;
|
||||
}
|
||||
}
|
||||
#endregion
|
||||
Update_Move();
|
||||
}
|
||||
|
||||
protected virtual void FixedUpdate()
|
||||
{
|
||||
FixedUpdate_Move();
|
||||
}
|
||||
|
||||
|
||||
public abstract void MeshChangeMoveState(bool ToMoveState);
|
||||
|
||||
public void MeshChangeDir(bool ToLeftDir)
|
||||
@ -162,18 +110,95 @@ namespace Game
|
||||
public abstract void Release();
|
||||
|
||||
|
||||
#region
|
||||
#region 移动
|
||||
|
||||
private bool mIsMove = false;
|
||||
public float MoveTime = 0;
|
||||
|
||||
public bool IsMove
|
||||
{
|
||||
get { return mIsMove; }
|
||||
set{ if (mIsMove != value)
|
||||
{
|
||||
mIsMove = value;
|
||||
if (value)//刚开始移动
|
||||
{
|
||||
MoveTime = 0;
|
||||
MeshChangeMoveState(true);
|
||||
}
|
||||
else//刚停止移动
|
||||
{
|
||||
MoveTime = 0;
|
||||
Move_currentVector = Vector3.zero;//清空移动方向
|
||||
MeshChangeMoveState(false);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 朝向
|
||||
/// </summary>
|
||||
private bool mIsLeft = false;
|
||||
public bool IsLeft
|
||||
{
|
||||
get { return mIsLeft; }
|
||||
set{ if (mIsLeft != value)
|
||||
{
|
||||
mIsLeft = value;
|
||||
MoveTime = 0;//朝向变化时,重置移动时间
|
||||
if (value)//开始往右
|
||||
MeshChangeDir(true);
|
||||
else//开始往左
|
||||
MeshChangeDir(false);
|
||||
}
|
||||
}
|
||||
}
|
||||
void Update_Move()
|
||||
{
|
||||
bool isDoMove = false;
|
||||
|
||||
if (AttackStep != E_ONCEATTACK_STEP.None)
|
||||
{
|
||||
//如果在攻击流程 就不移动
|
||||
}
|
||||
else
|
||||
{
|
||||
if (InputV2 != Vector2.zero)
|
||||
{
|
||||
isDoMove = true;
|
||||
Move_currentVector = new Vector3(InputV2.x, 0, InputV2.y);
|
||||
}
|
||||
|
||||
//AxibugLog.Debug("Move_currentVector =>" + Move_currentVector);
|
||||
|
||||
//朝向
|
||||
if (InputV2.x < 0)
|
||||
IsLeft = true;
|
||||
else if (InputV2.x > 0)
|
||||
IsLeft = false;
|
||||
}
|
||||
|
||||
IsMove = isDoMove;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// ËÙ¶È
|
||||
/// </summary>
|
||||
public float Move_Speed = 3.5f;
|
||||
protected float Move_BaseSpeed = 3.5f;
|
||||
protected float Move_SpeedMultiplier = 1f;
|
||||
private Vector3 Move_currentVector;
|
||||
|
||||
/// <summary>
|
||||
/// 移动位移
|
||||
/// </summary>
|
||||
void FixedUpdate_Move()
|
||||
{
|
||||
if (IsMove) MoveTime += Time.deltaTime;
|
||||
|
||||
Vector3 _playerPos = mRigidbody.position;
|
||||
_playerPos += Move_currentVector * Move_Speed * Time.deltaTime;
|
||||
_playerPos += Move_currentVector * Move_BaseSpeed * Move_SpeedMultiplier * Time.deltaTime;
|
||||
mRigidbody.MovePosition(_playerPos);
|
||||
//AxibugLog.Debug("FixedUpdate_Move =>" + _playerPos);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user