浏览代码

Fix null reference in state machine editor (#451)

/main
GitHub 4 年前
当前提交
14e99162
共有 1 个文件被更改,包括 2 次插入1 次删除
  1. 3
      UOP1_Project/Assets/Scripts/StateMachine/Editor/TransitionTableEditor.cs

3
UOP1_Project/Assets/Scripts/StateMachine/Editor/TransitionTableEditor.cs


int count = stateTransitions.Count;
int index = stateTransitions.FindIndex(t => t.SerializedTransition.Index == serializedTransition.Index);
int deleteIndex = serializedTransition.Index;
string fromStateName = serializedTransition.FromState.objectReferenceValue.name;
if (index == 0 && count > 1)
_transitions.MoveArrayElement(stateTransitions[1].SerializedTransition.Index, deleteIndex++);

ApplyModifications($"Deleted transition from {serializedTransition.FromState.objectReferenceValue.name} " +
ApplyModifications($"Deleted transition from {fromStateName} " +
"to {serializedTransition.ToState.objectReferenceValue.name}");
if (count > 1)

正在加载...
取消
保存