浏览代码

Bard hare state machine working

/main
Amel Negra 3 年前
当前提交
ce10fdea
共有 6 个文件被更改,包括 18 次插入96 次删除
  1. 16
      UOP1_Project/Assets/Art/Characters/BardHare/Animation/BardHare.controller
  2. 14
      UOP1_Project/Assets/Scenes/WIP/TestingGround.unity
  3. 31
      UOP1_Project/Assets/Scripts/Characters/StateMachine/Conditions/IsNPCJumpingDownSO.cs
  4. 11
      UOP1_Project/Assets/Scripts/Characters/StateMachine/Conditions/IsNPCJumpingDownSO.cs.meta
  5. 31
      UOP1_Project/Assets/Scripts/Characters/StateMachine/Conditions/IsNPCJumpingUpSO.cs
  6. 11
      UOP1_Project/Assets/Scripts/Characters/StateMachine/Conditions/IsNPCJumpingUpSO.cs.meta

16
UOP1_Project/Assets/Art/Characters/BardHare/Animation/BardHare.controller


m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_Name:
m_Conditions: []
m_Conditions:
- m_ConditionMode: 2
m_ConditionEvent: IsTalking
m_EventTreshold: 0
m_DstStateMachine: {fileID: 0}
m_DstState: {fileID: 3583411645183670853}
m_Solo: 0

m_DefaultFloat: 0
m_DefaultInt: 0
m_DefaultBool: 0
m_Controller: {fileID: 0}
m_Controller: {fileID: 9100000}
m_Controller: {fileID: 0}
m_Controller: {fileID: 9100000}
m_AnimatorLayers:
- serializedVersion: 5
m_Name: Base Layer

m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_Name:
m_Conditions: []
m_Conditions:
- m_ConditionMode: 2
m_ConditionEvent: IsTalking
m_EventTreshold: 0
m_DstStateMachine: {fileID: 0}
m_DstState: {fileID: 3583411645183670853}
m_Solo: 0

m_TransitionDuration: 0.25
m_TransitionOffset: 0
m_ExitTime: 0.96231157
m_HasExitTime: 1
m_HasExitTime: 0
m_HasFixedDuration: 1
m_InterruptionSource: 0
m_OrderedInterruption: 1

14
UOP1_Project/Assets/Scenes/WIP/TestingGround.unity
文件差异内容过多而无法显示
查看文件

31
UOP1_Project/Assets/Scripts/Characters/StateMachine/Conditions/IsNPCJumpingDownSO.cs


using UnityEngine;
using UOP1.StateMachine;
using UOP1.StateMachine.ScriptableObjects;
[CreateAssetMenu(menuName = "State Machines/Conditions/Is NPC Jumping Down")]
public class IsNPCJumpingDownSO : StateConditionSO<IsNPCJumpingDownCondition> { }
public class IsNPCJumpingDownCondition : Condition
{
//Component references
private NPC _npcScript;
public override void Awake(StateMachine stateMachine)
{
_npcScript = stateMachine.GetComponent<NPC>();
}
protected override bool Statement()
{
if (_npcScript.npcState == NPCState.JumpDown)
{
return true;
}
else
{
return false;
}
}
}

11
UOP1_Project/Assets/Scripts/Characters/StateMachine/Conditions/IsNPCJumpingDownSO.cs.meta


fileFormatVersion: 2
guid: 301c417603e282742b18e2ccf214676f
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

31
UOP1_Project/Assets/Scripts/Characters/StateMachine/Conditions/IsNPCJumpingUpSO.cs


using UnityEngine;
using UOP1.StateMachine;
using UOP1.StateMachine.ScriptableObjects;
[CreateAssetMenu(menuName = "State Machines/Conditions/Is NPC Jumping Up")]
public class IsNPCJumpingUpSO : StateConditionSO<IsNPCJumpingUpCondition> { }
public class IsNPCJumpingUpCondition : Condition
{
//Component references
private NPC _npcScript;
public override void Awake(StateMachine stateMachine)
{
_npcScript = stateMachine.GetComponent<NPC>();
}
protected override bool Statement()
{
if (_npcScript.npcState == NPCState.JumpUp)
{
return true;
}
else
{
return false;
}
}
}

11
UOP1_Project/Assets/Scripts/Characters/StateMachine/Conditions/IsNPCJumpingUpSO.cs.meta


fileFormatVersion: 2
guid: 70b5d33c4b4236b4181fe3d04ce9da47
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:
正在加载...
取消
保存