浏览代码

Merge branch 'minor-sm-changes' of https://github.com/DeivSky/open-project-1 into pr-bash

/UI
Ciro Continisio 3 年前
当前提交
c0c06250
共有 5 个文件被更改,包括 20 次插入47 次删除
  1. 21
      UOP1_Project/Assets/ScriptableObjects/StateMachine/Config/BasicHealth.asset
  2. 21
      UOP1_Project/Assets/ScriptableObjects/StateMachine/Config/EliteHealth.asset
  3. 3
      UOP1_Project/Assets/Scripts/StateMachine/Core/StateCondition.cs
  4. 18
      UOP1_Project/Assets/Scripts/StateMachine/Core/StateMachine.cs
  5. 4
      UOP1_Project/Assets/Scripts/StateMachine/ScriptableObjects/StateConditionSO.cs

21
UOP1_Project/Assets/ScriptableObjects/StateMachine/Config/BasicHealth.asset


m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: e005b717defd93a4c81276fd8caab626, type: 3}
m_Name: PlantCritter
m_Name: BasicHealth
_name:
m_TableReference:
m_TableCollectionName: GUID:753c1cc38ecdc5a4b93227e74555c8d7
m_TableEntryReference:
m_KeyId: 8129245184
m_Key:
_waitTime: 0
_roamingSpeed: 0
_chasingSpeed: 0
_roamingDistance: 0
_playerTransform: {fileID: 11400000, guid: 35fc4039342b6ba458d0d4429e89ee74, type: 2}
_maxNbDropppedItems: 3
_dropItems:
- _item: {fileID: 11400000, guid: 8aff2c01ad67b48d0a0627754d613415, type: 2}
_dropRate: 0.45
- _item: {fileID: 11400000, guid: 7a69da03abc7b42a080b2856abaab177, type: 2}
_dropRate: 0.45
- _item: {fileID: 11400000, guid: 981618c3eb6d24746a53ce7dbe6559a6, type: 2}
_dropRate: 0.1

21
UOP1_Project/Assets/ScriptableObjects/StateMachine/Config/EliteHealth.asset


m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: e005b717defd93a4c81276fd8caab626, type: 3}
m_Name: SlimeCritter
m_Name: EliteHealth
_name:
m_TableReference:
m_TableCollectionName: GUID:753c1cc38ecdc5a4b93227e74555c8d7
m_TableEntryReference:
m_KeyId: 173183496192
m_Key:
_waitTime: 2
_roamingSpeed: 1
_chasingSpeed: 2
_roamingDistance: 10
_playerTransform: {fileID: 11400000, guid: 35fc4039342b6ba458d0d4429e89ee74, type: 2}
_maxNbDropppedItems: 3
_dropItems:
- _item: {fileID: 11400000, guid: 8aff2c01ad67b48d0a0627754d613415, type: 2}
_dropRate: 0.45
- _item: {fileID: 11400000, guid: 7a69da03abc7b42a080b2856abaab177, type: 2}
_dropRate: 0.45
- _item: {fileID: 11400000, guid: 7b870b4146bd349bb856ccc38dd7e528, type: 2}
_dropRate: 0.1

3
UOP1_Project/Assets/Scripts/StateMachine/Core/StateCondition.cs


/// </summary>
internal bool GetStatement()
{
if (!_originSO.cacheResult)
return Statement();
if (!_isCached)
{
_isCached = true;

18
UOP1_Project/Assets/Scripts/StateMachine/Core/StateMachine.cs


#endif
}
#if UNITY_EDITOR
private void OnEnable()
{
UnityEditor.AssemblyReloadEvents.afterAssemblyReload += OnAfterAssemblyReload;
}
private void OnAfterAssemblyReload()
{
_currentState = _transitionTableSO.GetInitialState(this);
_debugger.Awake(this);
}
private void OnDisable()
{
UnityEditor.AssemblyReloadEvents.afterAssemblyReload -= OnAfterAssemblyReload;
}
#endif
private void Start()
{
_currentState.OnStateEnter();

4
UOP1_Project/Assets/Scripts/StateMachine/ScriptableObjects/StateConditionSO.cs


{
public abstract class StateConditionSO : ScriptableObject
{
[SerializeField]
[Tooltip("The condition will only be evaluated once each frame, and cached for subsequent uses.\r\n\r\nThe caching is unique to each instance of the State Machine and of the Scriptable Object (i.e. Instances of the State Machine or Condition don't share results if they belong to different GameObjects).")]
internal bool cacheResult = true;
/// <summary>
/// Will create a new custom <see cref="Condition"/> or use an existing one inside <paramref name="createdInstances"/>.
/// </summary>

正在加载...
取消
保存