public override unsafe void DrawEditor(void *data, IBlackboardComponent blackboard) { var value = *(int *)data; var output = UnityEditor.EditorGUILayout.DelayedIntField(name, value); if (value != output) { MainThreadDispatcher.Schedule(() => blackboard.SetValue(Index, output)); } }
public override unsafe void DrawEditor(void *data, IBlackboardComponent blackboard) { var value = *(byte *)data; var output = UnityEditor.EditorGUILayout.Toggle(name, (value).ToBoolean()).ToByte(); if (output != value) { MainThreadDispatcher.Schedule(() => blackboard.SetValue(Index, output)); } }
public override unsafe void DrawEditor(void *data, IBlackboardComponent blackboard) { var valuePtr = (float *)data; var output = UnityEditor.EditorGUILayout.Vector3Field(name, new Vector3(valuePtr[0], valuePtr[1], valuePtr[2])); // ReSharper disable thrice CompareOfFloatsByEqualityOperator if (output.x != valuePtr[0] || output.y != valuePtr[1] || output.z != valuePtr[2]) { MainThreadDispatcher.Schedule(() => blackboard.SetValue(Index, output)); } }
public override unsafe void DrawEditor(void *data, IBlackboardComponent blackboard) { var value = *(float *)data; var output = UnityEditor.EditorGUILayout.DelayedFloatField(name, value); // ReSharper disable once CompareOfFloatsByEqualityOperator if (output != value) { MainThreadDispatcher.Schedule(() => blackboard.SetValue(Index, output)); } }
public override ExecutionStatus Execute(float deltaTime) { ExecutionStatus result; if (RandomLocation.TryGet(_locationName, out _current)) { _blackboard.SetValue <Vector3>(_key, _current.transform.position); result = ExecutionStatus.Succeeded; } else { result = ExecutionStatus.Failed; } _blackboard = null; return(result); }
public void ApplyTo(IBlackboardComponent blackboard) => blackboard.SetValue <byte>(key.Index, (byte)(1 - blackboard.GetValue <byte>(key.Index)));
public void ApplyTo(IBlackboardComponent blackboard) { blackboard.SetValue <float>(key.Index, value.x); blackboard.SetValue <float>((ushort)(key.Index + sizeof(float)), value.y); blackboard.SetValue <float>((ushort)(key.Index + sizeof(float) + sizeof(float)), value.z); }
public void ApplyTo(IBlackboardComponent blackboard) => blackboard.SetValue <int>(key.Index, blackboard.GetValue <int>(key.Index) + blackboard.GetValue <int>(toAdd.Index));
public void ApplyTo(IBlackboardComponent blackboard) => blackboard.SetValue <byte>(key.Index, value.ToByte());