浏览代码
Yet another State Machine (#94)
Yet another State Machine (#94)
* Initial commit * [Bot] Automated dotnet-format update * Added debug toggle * [Bot] Automated dotnet-format update * Update StateMachines.unity * Removed serializable actions/conditions. Added current state name in state machine component. Added more spheres to test scene. * minor * Renaming from 'Scriptable' prefix to 'SO' suffix. Co-Authored-By: Ciro Continisio <20049224+ciro-unity@users.noreply.github.com> * Adjusted test scene. Renamed StateAction.Perform() to OnUpdate(). Added a couple of Tooltips and comments. The test scene was adjusted to display how to override the behaviour of the Spheres by attatching a different `ChaseDataSO` to the `StateMachine`, specifying a different target. Tooltips and comments were added to try to explain the workflow of overriding Action and Condition data. * [Bot] Automated dotnet-format update * Removed ScriptableObjects array from StateMachine. Adjusted test scene. Single l.../main
GitHub
4 年前
当前提交
391017ac
共有 97 个文件被更改,包括 3302 次插入 和 0 次删除
-
129UOP1_Project/Assets/Prefabs/Sphere.prefab
-
7UOP1_Project/Assets/Prefabs/Sphere.prefab.meta
-
8UOP1_Project/Assets/Scenes/StateMachines.meta
-
1001UOP1_Project/Assets/Scenes/StateMachines.unity
-
7UOP1_Project/Assets/Scenes/StateMachines.unity.meta
-
8UOP1_Project/Assets/ScriptableObjects.meta
-
8UOP1_Project/Assets/Scripts/Characters/MovementModifiers.meta
-
8UOP1_Project/Assets/Scripts/StateMachine.meta
-
8UOP1_Project/Assets/Scripts/StateMachineTest.meta
-
9UOP1_Project/Assets/Scenes/StateMachines/LightingData.asset
-
8UOP1_Project/Assets/Scenes/StateMachines/LightingData.asset.meta
-
707UOP1_Project/Assets/Scenes/StateMachines/ReflectionProbe-0.exr
-
140UOP1_Project/Assets/Scenes/StateMachines/ReflectionProbe-0.exr.meta
-
8UOP1_Project/Assets/ScriptableObjects/StateMachinesTest.meta
-
8UOP1_Project/Assets/ScriptableObjects/StateMachinesTest/Actions.meta
-
15UOP1_Project/Assets/ScriptableObjects/StateMachinesTest/Actions/Chase.asset
-
8UOP1_Project/Assets/ScriptableObjects/StateMachinesTest/Actions/Chase.asset.meta
-
15UOP1_Project/Assets/ScriptableObjects/StateMachinesTest/Actions/Eat.asset
-
8UOP1_Project/Assets/ScriptableObjects/StateMachinesTest/Actions/Eat.asset.meta
-
14UOP1_Project/Assets/ScriptableObjects/StateMachinesTest/Actions/EnableHunger.asset
-
8UOP1_Project/Assets/ScriptableObjects/StateMachinesTest/Actions/EnableHunger.asset.meta
-
8UOP1_Project/Assets/ScriptableObjects/StateMachinesTest/Conditions.meta
-
15UOP1_Project/Assets/ScriptableObjects/StateMachinesTest/Conditions/AttackDuration.asset
-
8UOP1_Project/Assets/ScriptableObjects/StateMachinesTest/Conditions/AttackDuration.asset.meta
-
15UOP1_Project/Assets/ScriptableObjects/StateMachinesTest/Conditions/CloseToTarget.asset
-
8UOP1_Project/Assets/ScriptableObjects/StateMachinesTest/Conditions/CloseToTarget.asset.meta
-
15UOP1_Project/Assets/ScriptableObjects/StateMachinesTest/Conditions/EatDuration.asset
-
8UOP1_Project/Assets/ScriptableObjects/StateMachinesTest/Conditions/EatDuration.asset.meta
-
14UOP1_Project/Assets/ScriptableObjects/StateMachinesTest/Conditions/IsHungry.asset
-
8UOP1_Project/Assets/ScriptableObjects/StateMachinesTest/Conditions/IsHungry.asset.meta
-
8UOP1_Project/Assets/ScriptableObjects/StateMachinesTest/States.meta
-
17UOP1_Project/Assets/ScriptableObjects/StateMachinesTest/States/Attacking.asset
-
8UOP1_Project/Assets/ScriptableObjects/StateMachinesTest/States/Attacking.asset.meta
-
20UOP1_Project/Assets/ScriptableObjects/StateMachinesTest/States/Chasing.asset
-
8UOP1_Project/Assets/ScriptableObjects/StateMachinesTest/States/Chasing.asset.meta
-
18UOP1_Project/Assets/ScriptableObjects/StateMachinesTest/States/Eating.asset
-
8UOP1_Project/Assets/ScriptableObjects/StateMachinesTest/States/Eating.asset.meta
-
8UOP1_Project/Assets/ScriptableObjects/StateMachinesTest/Transitions.meta
-
19UOP1_Project/Assets/ScriptableObjects/StateMachinesTest/Transitions/AttackingToChasing.asset
-
8UOP1_Project/Assets/ScriptableObjects/StateMachinesTest/Transitions/AttackingToChasing.asset.meta
-
19UOP1_Project/Assets/ScriptableObjects/StateMachinesTest/Transitions/ChasingToAttacking.asset
-
8UOP1_Project/Assets/ScriptableObjects/StateMachinesTest/Transitions/ChasingToAttacking.asset.meta
-
19UOP1_Project/Assets/ScriptableObjects/StateMachinesTest/Transitions/ChasingToEating.asset
-
8UOP1_Project/Assets/ScriptableObjects/StateMachinesTest/Transitions/ChasingToEating.asset.meta
-
19UOP1_Project/Assets/ScriptableObjects/StateMachinesTest/Transitions/EatingToChasing.asset
-
8UOP1_Project/Assets/ScriptableObjects/StateMachinesTest/Transitions/EatingToChasing.asset.meta
-
8UOP1_Project/Assets/Scripts/StateMachine/Core.meta
-
15UOP1_Project/Assets/Scripts/StateMachine/Core/IStateComponent.cs
-
11UOP1_Project/Assets/Scripts/StateMachine/Core/IStateComponent.cs.meta
-
61UOP1_Project/Assets/Scripts/StateMachine/Core/State.cs
-
11UOP1_Project/Assets/Scripts/StateMachine/Core/State.cs.meta
-
22UOP1_Project/Assets/Scripts/StateMachine/Core/StateAction.cs
-
11UOP1_Project/Assets/Scripts/StateMachine/Core/StateAction.cs.meta
-
39UOP1_Project/Assets/Scripts/StateMachine/Core/StateCondition.cs
-
11UOP1_Project/Assets/Scripts/StateMachine/Core/StateCondition.cs.meta
-
80UOP1_Project/Assets/Scripts/StateMachine/Core/StateMachine.cs
-
11UOP1_Project/Assets/Scripts/StateMachine/Core/StateMachine.cs.meta
-
57UOP1_Project/Assets/Scripts/StateMachine/Core/StateTransition.cs
-
11UOP1_Project/Assets/Scripts/StateMachine/Core/StateTransition.cs.meta
-
13UOP1_Project/Assets/Scripts/StateMachine/DeivSky.StateMachine.asmdef
-
7UOP1_Project/Assets/Scripts/StateMachine/DeivSky.StateMachine.asmdef.meta
-
8UOP1_Project/Assets/Scripts/StateMachine/ScriptableObjects.meta
-
25UOP1_Project/Assets/Scripts/StateMachine/ScriptableObjects/StateActionSO.cs
-
11UOP1_Project/Assets/Scripts/StateMachine/ScriptableObjects/StateActionSO.cs.meta
-
26UOP1_Project/Assets/Scripts/StateMachine/ScriptableObjects/StateConditionSO.cs
-
11UOP1_Project/Assets/Scripts/StateMachine/ScriptableObjects/StateConditionSO.cs.meta
-
55UOP1_Project/Assets/Scripts/StateMachine/ScriptableObjects/StateSO.cs
-
11UOP1_Project/Assets/Scripts/StateMachine/ScriptableObjects/StateSO.cs.meta
-
66UOP1_Project/Assets/Scripts/StateMachine/ScriptableObjects/StateTransitionSO.cs
-
11UOP1_Project/Assets/Scripts/StateMachine/ScriptableObjects/StateTransitionSO.cs.meta
-
22UOP1_Project/Assets/Scripts/StateMachineTest/ChaseActionSO.cs
-
11UOP1_Project/Assets/Scripts/StateMachineTest/ChaseActionSO.cs.meta
-
17UOP1_Project/Assets/Scripts/StateMachineTest/ChaseComponent.cs
-
11UOP1_Project/Assets/Scripts/StateMachineTest/ChaseComponent.cs.meta
-
24UOP1_Project/Assets/Scripts/StateMachineTest/CloseToTargetConditionSO.cs
-
11UOP1_Project/Assets/Scripts/StateMachineTest/CloseToTargetConditionSO.cs.meta
-
23UOP1_Project/Assets/Scripts/StateMachineTest/EatActionSO.cs
-
11UOP1_Project/Assets/Scripts/StateMachineTest/EatActionSO.cs.meta
-
19UOP1_Project/Assets/Scripts/StateMachineTest/HungerActionSO.cs
-
11UOP1_Project/Assets/Scripts/StateMachineTest/HungerActionSO.cs.meta
-
33UOP1_Project/Assets/Scripts/StateMachineTest/HungerComponent.cs
-
11UOP1_Project/Assets/Scripts/StateMachineTest/HungerComponent.cs.meta
-
18UOP1_Project/Assets/Scripts/StateMachineTest/HungerConditionSO.cs
-
11UOP1_Project/Assets/Scripts/StateMachineTest/HungerConditionSO.cs.meta
-
32UOP1_Project/Assets/Scripts/StateMachineTest/TimerConditionSO.cs
-
11UOP1_Project/Assets/Scripts/StateMachineTest/TimerConditionSO.cs.meta
|
|||
%YAML 1.1 |
|||
%TAG !u! tag:unity3d.com,2011: |
|||
--- !u!1 &8065985805251957531 |
|||
GameObject: |
|||
m_ObjectHideFlags: 0 |
|||
m_CorrespondingSourceObject: {fileID: 0} |
|||
m_PrefabInstance: {fileID: 0} |
|||
m_PrefabAsset: {fileID: 0} |
|||
serializedVersion: 6 |
|||
m_Component: |
|||
- component: {fileID: 8065985805251957521} |
|||
- component: {fileID: 8065985805251957526} |
|||
- component: {fileID: 8065985805251957527} |
|||
- component: {fileID: 8065985805251957524} |
|||
- component: {fileID: 8065985805251957525} |
|||
- component: {fileID: 8065985805251957530} |
|||
m_Layer: 0 |
|||
m_Name: Sphere |
|||
m_TagString: Untagged |
|||
m_Icon: {fileID: 0} |
|||
m_NavMeshLayer: 0 |
|||
m_StaticEditorFlags: 0 |
|||
m_IsActive: 1 |
|||
--- !u!4 &8065985805251957521 |
|||
Transform: |
|||
m_ObjectHideFlags: 0 |
|||
m_CorrespondingSourceObject: {fileID: 0} |
|||
m_PrefabInstance: {fileID: 0} |
|||
m_PrefabAsset: {fileID: 0} |
|||
m_GameObject: {fileID: 8065985805251957531} |
|||
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} |
|||
m_LocalPosition: {x: 9.62, y: 0.73, z: -15.743169} |
|||
m_LocalScale: {x: 1, y: 1, z: 1} |
|||
m_Children: [] |
|||
m_Father: {fileID: 0} |
|||
m_RootOrder: 0 |
|||
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} |
|||
--- !u!33 &8065985805251957526 |
|||
MeshFilter: |
|||
m_ObjectHideFlags: 0 |
|||
m_CorrespondingSourceObject: {fileID: 0} |
|||
m_PrefabInstance: {fileID: 0} |
|||
m_PrefabAsset: {fileID: 0} |
|||
m_GameObject: {fileID: 8065985805251957531} |
|||
m_Mesh: {fileID: 10207, guid: 0000000000000000e000000000000000, type: 0} |
|||
--- !u!23 &8065985805251957527 |
|||
MeshRenderer: |
|||
m_ObjectHideFlags: 0 |
|||
m_CorrespondingSourceObject: {fileID: 0} |
|||
m_PrefabInstance: {fileID: 0} |
|||
m_PrefabAsset: {fileID: 0} |
|||
m_GameObject: {fileID: 8065985805251957531} |
|||
m_Enabled: 1 |
|||
m_CastShadows: 1 |
|||
m_ReceiveShadows: 1 |
|||
m_DynamicOccludee: 1 |
|||
m_MotionVectors: 1 |
|||
m_LightProbeUsage: 1 |
|||
m_ReflectionProbeUsage: 1 |
|||
m_RayTracingMode: 2 |
|||
m_RenderingLayerMask: 1 |
|||
m_RendererPriority: 0 |
|||
m_Materials: |
|||
- {fileID: 2100000, guid: 31321ba15b8f8eb4c954353edc038b1d, type: 2} |
|||
m_StaticBatchInfo: |
|||
firstSubMesh: 0 |
|||
subMeshCount: 0 |
|||
m_StaticBatchRoot: {fileID: 0} |
|||
m_ProbeAnchor: {fileID: 0} |
|||
m_LightProbeVolumeOverride: {fileID: 0} |
|||
m_ScaleInLightmap: 1 |
|||
m_ReceiveGI: 1 |
|||
m_PreserveUVs: 0 |
|||
m_IgnoreNormalsForChartDetection: 0 |
|||
m_ImportantGI: 0 |
|||
m_StitchLightmapSeams: 1 |
|||
m_SelectedEditorRenderState: 3 |
|||
m_MinimumChartSize: 4 |
|||
m_AutoUVMaxDistance: 0.5 |
|||
m_AutoUVMaxAngle: 89 |
|||
m_LightmapParameters: {fileID: 0} |
|||
m_SortingLayerID: 0 |
|||
m_SortingLayer: 0 |
|||
m_SortingOrder: 0 |
|||
--- !u!135 &8065985805251957524 |
|||
SphereCollider: |
|||
m_ObjectHideFlags: 0 |
|||
m_CorrespondingSourceObject: {fileID: 0} |
|||
m_PrefabInstance: {fileID: 0} |
|||
m_PrefabAsset: {fileID: 0} |
|||
m_GameObject: {fileID: 8065985805251957531} |
|||
m_Material: {fileID: 0} |
|||
m_IsTrigger: 0 |
|||
m_Enabled: 1 |
|||
serializedVersion: 2 |
|||
m_Radius: 0.5 |
|||
m_Center: {x: 0, y: 0, z: 0} |
|||
--- !u!114 &8065985805251957525 |
|||
MonoBehaviour: |
|||
m_ObjectHideFlags: 0 |
|||
m_CorrespondingSourceObject: {fileID: 0} |
|||
m_PrefabInstance: {fileID: 0} |
|||
m_PrefabAsset: {fileID: 0} |
|||
m_GameObject: {fileID: 8065985805251957531} |
|||
m_Enabled: 1 |
|||
m_EditorHideFlags: 0 |
|||
m_Script: {fileID: 11500000, guid: 42ecc2ef8dcbbe4449a3f1d0bb1d04b2, type: 3} |
|||
m_Name: |
|||
m_EditorClassIdentifier: |
|||
_maxFullness: 100 |
|||
_hungerPerSecond: 10 |
|||
_isHungryThreshold: 0.4 |
|||
_currentFullness: 0 |
|||
--- !u!114 &8065985805251957530 |
|||
MonoBehaviour: |
|||
m_ObjectHideFlags: 0 |
|||
m_CorrespondingSourceObject: {fileID: 0} |
|||
m_PrefabInstance: {fileID: 0} |
|||
m_PrefabAsset: {fileID: 0} |
|||
m_GameObject: {fileID: 8065985805251957531} |
|||
m_Enabled: 1 |
|||
m_EditorHideFlags: 0 |
|||
m_Script: {fileID: 11500000, guid: 1eeda163c70b3cb4ebb88ba92f608fd8, type: 3} |
|||
m_Name: |
|||
m_EditorClassIdentifier: |
|||
CurrentState: |
|||
debug: 1 |
|||
_initialStateSO: {fileID: 11400000, guid: 4b9ef9df9c479aa469d161e9019b218e, type: 2} |
|||
_scriptableObjects: [] |
|
|||
fileFormatVersion: 2 |
|||
guid: 2ae670cd29a6f4843aa75201aa44ef31 |
|||
PrefabImporter: |
|||
externalObjects: {} |
|||
userData: |
|||
assetBundleName: |
|||
assetBundleVariant: |
|
|||
fileFormatVersion: 2 |
|||
guid: 383cdb500247b7d4aa7316c4e1bd6db6 |
|||
folderAsset: yes |
|||
DefaultImporter: |
|||
externalObjects: {} |
|||
userData: |
|||
assetBundleName: |
|||
assetBundleVariant: |
1001
UOP1_Project/Assets/Scenes/StateMachines.unity
文件差异内容过多而无法显示
查看文件
文件差异内容过多而无法显示
查看文件
|
|||
fileFormatVersion: 2 |
|||
guid: 2ece9c9d6c19541478faa51f281757a7 |
|||
DefaultImporter: |
|||
externalObjects: {} |
|||
userData: |
|||
assetBundleName: |
|||
assetBundleVariant: |
|
|||
fileFormatVersion: 2 |
|||
guid: 85494a62d9312464a8266894d9fdec40 |
|||
folderAsset: yes |
|||
DefaultImporter: |
|||
externalObjects: {} |
|||
userData: |
|||
assetBundleName: |
|||
assetBundleVariant: |
|
|||
fileFormatVersion: 2 |
|||
guid: 0c2ca5875abd6634993342de5c275d35 |
|||
folderAsset: yes |
|||
DefaultImporter: |
|||
externalObjects: {} |
|||
userData: |
|||
assetBundleName: |
|||
assetBundleVariant: |
|
|||
fileFormatVersion: 2 |
|||
guid: 2400a6046d71e10408c3813821b7df3f |
|||
folderAsset: yes |
|||
DefaultImporter: |
|||
externalObjects: {} |
|||
userData: |
|||
assetBundleName: |
|||
assetBundleVariant: |
|
|||
fileFormatVersion: 2 |
|||
guid: 65d2f586828266841aba890e1f317318 |
|||
folderAsset: yes |
|||
DefaultImporter: |
|||
externalObjects: {} |
|||
userData: |
|||
assetBundleName: |
|||
assetBundleVariant: |
9
UOP1_Project/Assets/Scenes/StateMachines/LightingData.asset
文件差异内容过多而无法显示
查看文件
文件差异内容过多而无法显示
查看文件
|
|||
fileFormatVersion: 2 |
|||
guid: 765452ab796dfaa4580da8dea56be2be |
|||
NativeFormatImporter: |
|||
externalObjects: {} |
|||
mainObjectFileID: 0 |
|||
userData: |
|||
assetBundleName: |
|||
assetBundleVariant: |
|
|||
v/1 channels chlist 7 B G R compression compression dataWindow box2i � displayWindow box2i � lineOrder lineOrder pixelAspectRatio float �?screenWindowCenter v2f screenWindowWidth float �? Y {� �� �( � �.�r���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������oZ~� x � A�a�a�r �I$�J(��,��0�0�
0�
0�4�M8��<��4��<� <�@8��<�AA�=�@C������� � O�� ����PA��А��ؐ�������������P�`��]��9�O?��?0C�?C� ?��?EC�#�C�?DC�?C��? C�t?kC�T?NC�� C�t ?�?JC�?+C�d;C�4?+C��?UC�t>C�$?C��?C�D?�C�?0C���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������C��?C�?C��?C�?C�?@ ?�;C�#�A�PA�<� @�� �C�==@��A @�A A�A� �@ = �A�=<��<��<��8�<��<��<�N8��5�4�N8��4�N4�L4�N0�M0�M0�L0�,��,�,�,��(��(��(��(�I$� �H �q�q�a�a�Q�a I�(�2��(�2�2��yחy��%��S ���M� �&d1&$ |
|||
dą��@�&�N�6���7vɸ�G�t �t:�h�)�YК%b͍��E��$�y�n.32o8�bad�p�]@ |
|||
�* �T" |