浏览代码

Callable List Add Menu (#44)

* BrowsePopup + Base add menu (not working atm)

* Different Design, CallableRList is now handled by IngredientEditor

* Fixed possible nulls / Position Fix / Fix Item Sorting

* Added Icons + Empty Entry

* Use of Callable attribute to define entries in menu

* Added Icons / Categories. Better Sorting

* More Icons

* Managed Categories

* Updated Changelog

* Added Generic GameplayIngredientsBehavior + Specific inspector with menu

* Added Custom editor for Managers

* Updated Changelog

* Custom Inspector for Pickup Item

* Pickup Item RList Naming.

* Set Interactive User to be a GameplayIngredientsBehaviour

* Removed [ReorderableList] attributes that are not required anymore
/main
GitHub 3 年前
当前提交
708623d3
共有 121 个文件被更改,包括 368 次插入275 次删除
  1. 6
      CHANGELOG.md
  2. 23
      Editor/CustomInspectors/IngredientEditor.cs
  3. 43
      Editor/Pickup/PickupItemEditor.cs
  4. 4
      Runtime/Ingredients/Counter/Counter.cs
  5. 1
      Runtime/Ingredients/Counter/CounterAction.cs
  6. 4
      Runtime/Ingredients/Counter/CounterLogic.cs
  7. 5
      Runtime/Ingredients/Factory/Factory.cs
  8. 1
      Runtime/Ingredients/Factory/FactorySetTargetAction.cs
  9. 1
      Runtime/Ingredients/Factory/FactorySpawnAction.cs
  10. 1
      Runtime/Ingredients/Interactions/Interaction.cs
  11. 2
      Runtime/Ingredients/Interactions/Interactive.cs
  12. 3
      Runtime/Ingredients/Interactions/InteractiveUser.cs
  13. 1
      Runtime/Ingredients/Pickup/PickupItem.cs
  14. 1
      Runtime/Ingredients/Rigs/ReachPositionRig.cs
  15. 1
      Runtime/Ingredients/StateMachine/SetStateAction.cs
  16. 4
      Runtime/Ingredients/StateMachine/State.cs
  17. 5
      Runtime/Ingredients/Timer/Timer.cs
  18. 3
      Runtime/Ingredients/Timer/TimerAction.cs
  19. 15
      Runtime/Ingredients/Timer/TimerDisplayRig.cs
  20. 1
      Runtime/LevelScripting/Actions/ApplicationExitAction.cs
  21. 1
      Runtime/LevelScripting/Actions/AttachToObjectAction.cs
  22. 1
      Runtime/LevelScripting/Actions/AudioMixParameterAction.cs
  23. 1
      Runtime/LevelScripting/Actions/AudioMixParameterCurveAction.cs
  24. 35
      Runtime/LevelScripting/Actions/AudioMixSnapshotAction.cs
  25. 1
      Runtime/LevelScripting/Actions/AudioPlayClipAction.cs
  26. 1
      Runtime/LevelScripting/Actions/CursorAction.cs
  27. 1
      Runtime/LevelScripting/Actions/CycleResolutionsAction.cs
  28. 1
      Runtime/LevelScripting/Actions/CycleWindowModeAction.cs
  29. 1
      Runtime/LevelScripting/Actions/DestroyObjectAction.cs
  30. 1
      Runtime/LevelScripting/Actions/DirectorControlRigAction.cs
  31. 1
      Runtime/LevelScripting/Actions/FocusUIAction.cs
  32. 7
      Runtime/LevelScripting/Actions/FullScreenFadeAction.cs
  33. 2
      Runtime/LevelScripting/Actions/GameLevelLoadAction.cs
  34. 1
      Runtime/LevelScripting/Actions/GameManagerSendStartupMessageAction.cs
  35. 1
      Runtime/LevelScripting/Actions/GameSaveLoadSaveAction.cs
  36. 1
      Runtime/LevelScripting/Actions/GameSaveSetValueAction.cs
  37. 1
      Runtime/LevelScripting/Actions/LogAction.cs
  38. 1
      Runtime/LevelScripting/Actions/RandomToggleGameObjectAction.cs
  39. 1
      Runtime/LevelScripting/Actions/ReachPositionRigSetTargetAction.cs
  40. 1
      Runtime/LevelScripting/Actions/RigidbodyAction.cs
  41. 1
      Runtime/LevelScripting/Actions/SendMessageAction.cs
  42. 1
      Runtime/LevelScripting/Actions/SetAnimatorParameterAction.cs
  43. 2
      Runtime/LevelScripting/Actions/SetAnimatorParameterAction.cs.meta
  44. 1
      Runtime/LevelScripting/Actions/SetRandomSeedAction.cs
  45. 2
      Runtime/LevelScripting/Actions/SetRandomSeedAction.cs.meta
  46. 1
      Runtime/LevelScripting/Actions/SetTimeScaleAction.cs
  47. 1
      Runtime/LevelScripting/Actions/SpawnPrefabAction.cs
  48. 2
      Runtime/LevelScripting/Actions/StreamingLevelAction.cs
  49. 1
      Runtime/LevelScripting/Actions/TakeScreenshotAction.cs
  50. 1
      Runtime/LevelScripting/Actions/TeleportGameObjectAction.cs
  51. 1
      Runtime/LevelScripting/Actions/TimelineControlAction.cs
  52. 1
      Runtime/LevelScripting/Actions/ToggleBehaviourAction.cs
  53. 1
      Runtime/LevelScripting/Actions/ToggleGameObjectAction.cs
  54. 1
      Runtime/LevelScripting/Actions/ToggleUIAction.cs
  55. 1
      Runtime/LevelScripting/Actions/UnityEventAction.cs
  56. 30
      Runtime/LevelScripting/Actions/VFXSendEventAction.cs
  57. 2
      Runtime/LevelScripting/Actions/VFXSendEventAction.cs.meta
  58. 197
      Runtime/LevelScripting/Actions/VFXSetPropertyAction.cs
  59. 2
      Runtime/LevelScripting/Actions/VFXSetPropertyAction.cs.meta
  60. 1
      Runtime/LevelScripting/Events/OnAwakeEvent.cs
  61. 3
      Runtime/LevelScripting/Events/OnButtonDownEvent.cs
  62. 3
      Runtime/LevelScripting/Events/OnColliderEvent.cs
  63. 1
      Runtime/LevelScripting/Events/OnDestroyEvent.cs
  64. 2
      Runtime/LevelScripting/Events/OnEnableDisableEvent.cs
  65. 1
      Runtime/LevelScripting/Events/OnGameManagerLevelStart.cs
  66. 1
      Runtime/LevelScripting/Events/OnJointBreakEvent.cs
  67. 3
      Runtime/LevelScripting/Events/OnKeyDownEvent.cs
  68. 1
      Runtime/LevelScripting/Events/OnMessageEvent.cs
  69. 1
      Runtime/LevelScripting/Events/OnMouseDownEvent.cs
  70. 2
      Runtime/LevelScripting/Events/OnMouseHoverEvent.cs
  71. 1
      Runtime/LevelScripting/Events/OnStartEvent.cs
  72. 3
      Runtime/LevelScripting/Events/OnTriggerEvent.cs
  73. 2
      Runtime/LevelScripting/Events/OnUpdateEvent.cs
  74. 2
      Runtime/LevelScripting/Events/OnVisibilityEvent.cs
  75. 3
      Runtime/LevelScripting/Logic/ConditionalLogic.cs
  76. 3
      Runtime/LevelScripting/Logic/DelayedLogic.cs
  77. 2
      Runtime/LevelScripting/Logic/EditorOnlyLogic.cs
  78. 4
      Runtime/LevelScripting/Logic/FlipFlopLogic.cs
  79. 2
      Runtime/LevelScripting/Logic/Logic.cs
  80. 2
      Runtime/LevelScripting/Logic/NTimesLogic.cs
  81. 2
      Runtime/LevelScripting/Logic/NextFrameLogic.cs
  82. 5
      Runtime/LevelScripting/Logic/PlatformLogic.cs
  83. 2
      Runtime/LevelScripting/Logic/RandomLogic.cs
  84. 3
      Runtime/LevelScripting/Logic/SaveDataLogic.cs
  85. 3
      Runtime/LevelScripting/Logic/SaveDataSwitchOnIntLogic.cs
  86. 2
      Runtime/LevelScripting/Logic/SetInstigatorFromFactoryLogic.cs
  87. 2
      Runtime/LevelScripting/Logic/SetInstigatorLogic.cs
  88. 3
      Runtime/LevelScripting/Logic/StateLogic.cs
  89. 3
      Runtime/Managers/Globals/GlobalLogic.cs
  90. 1
      Runtime/Managers/Globals/ResetGlobalAction.cs
  91. 3
      Runtime/Managers/Globals/SetGlobalAction.cs
  92. 3
      Runtime/Managers/Implementations/GameManager.cs
  93. 3
      Runtime/Managers/Implementations/GameSaveManager.cs
  94. 3
      Runtime/Managers/Implementations/ScreenshotManager.cs
  95. 33
      Runtime/Managers/Manager.cs
  96. 8
      Editor/BrowsePopup.meta
  97. 35
      Editor/CustomInspectors/GameplayIngredientsBehaviourEditor.cs
  98. 11
      Editor/CustomInspectors/GameplayIngredientsBehaviourEditor.cs.meta
  99. 40
      Editor/CustomInspectors/ManagerEditor.cs

6
CHANGELOG.md


#### Added
* Added a Popup to search and add Callables directly from callable lists.
* Added custom editors for Managers, Counters, Factories, and Pickup Item
* Created a Generic `GameplayIngredientsBehaviour` for Custom Decorated classes.
* Fixed missing icons
## 2020.2.4

23
Editor/CustomInspectors/IngredientEditor.cs


public abstract class IngredientEditor : PingableEditor
{
protected List<SerializedProperty> baseProperties;
protected Dictionary<string, CallableReorderableList> reorderableLists;
protected List<SerializedProperty> baseProperties;
protected override void OnEnable()
{

var property = serializedObject.FindProperty(info.Name);
if (property != null)
{
if (isCallableArray(property))
{
if (reorderableLists == null)
reorderableLists = new Dictionary<string, CallableReorderableList>();
string key = GetPropertyKeyName(property);
reorderableLists[key] = new CallableReorderableList(serializedObject, property);
}
}
static bool isCallableArray(SerializedProperty property) => property.isArray && property.arrayElementType == "PPtr<$Callable>";
static string GetPropertyKeyName(SerializedProperty property) => property.serializedObject.targetObject.GetInstanceID() + "." + property.name;
protected void DrawBaseProperties(params string[] excludedNames)
{

{
if (excludedNames.Any(o => o == prop.name))
continue;
NaughtyEditorGUI.PropertyField_Layout(prop, true);
if (isCallableArray(prop))
reorderableLists[GetPropertyKeyName(prop)].DoLayoutList();
else
NaughtyEditorGUI.PropertyField_Layout(prop, true);
}
}

43
Editor/Pickup/PickupItemEditor.cs


namespace GameplayIngredients.Editor
{
[CustomEditor(typeof(PickupItem))]
public class PickupItemEditor : UnityEditor.Editor
public class PickupItemEditor : IngredientEditor
SerializedProperty m_OnPickup;
private void OnEnable()
protected override void OnEnable()
m_RList.drawElementCallback = DrawElement;
m_OnPickup = serializedObject.FindProperty("OnPickup");
m_RList.drawHeaderCallback = (r) => GUI.Label(r, "Pickup Effects");
m_RList.drawElementCallback = (rect, index, isActive, isFocused) =>
{
GUI.Label(rect, $"#{index} - {ObjectNames.NicifyVariableName(((PickupItem)serializedObject.targetObject).effects[index]?.GetType().Name)}");
};
base.OnEnable();
void DrawElement(Rect rect, int index, bool isActive, bool isFocused)
public override void OnInspectorGUI_PingArea()
GUI.Label(rect,string.Format("#{0} - {1}", index+1, ObjectNames.NicifyVariableName(((PickupItem)serializedObject.targetObject).effects[index].GetType().Name)));
}
serializedObject.Update();
EditorGUI.BeginChangeCheck();
DrawBreadCrumb(ObjectNames.NicifyVariableName(serializedObject.targetObject.GetType().Name), color, () =>
{
GUILayout.Label(ObjectNames.NicifyVariableName(serializedObject.targetObject.GetType().Name), GUILayout.ExpandWidth(true));
GUILayout.FlexibleSpace();
});
public override void OnInspectorGUI()
{
GUILayout.Space(8);
EditorGUILayout.HelpBox("Add Effects to the Pickup Item by adding Pickup Effect Components to this Game Object", MessageType.Info);
serializedObject.Update();
EditorGUILayout.PropertyField(m_OnPickup,true);
serializedObject.ApplyModifiedProperties();
DrawBaseProperties();
if (EditorGUI.EndChangeCheck())
{
serializedObject.ApplyModifiedProperties();
}
static readonly Color color = new Color(1f, .3f, .3f, 1f);
}
}

4
Runtime/Ingredients/Counter/Counter.cs


namespace GameplayIngredients
{
[HelpURL(Help.URL + "counters")]
[AddComponentMenu("Gameplay Ingredients/Counter")]
public class Counter : MonoBehaviour
public class Counter : GameplayIngredientsBehaviour
{
public enum ValueSourceType
{

public int CurrentValue { get; private set; }
[ReorderableList]
public Callable[] OnValueChanged;
bool isValueProperty() { return ValueSource == ValueSourceType.Property; }

1
Runtime/Ingredients/Counter/CounterAction.cs


namespace GameplayIngredients.Actions
{
[HelpURL(Help.URL + "counters")]
[Callable("Data", "Misc/ic-counter.png")]
public class CounterAction : ActionBase
{
public enum CounterOperation

4
Runtime/Ingredients/Counter/CounterLogic.cs


namespace GameplayIngredients.Logic
{
[HelpURL(Help.URL + "counters")]
[Callable("Data", "Misc/ic-counter.png")]
public class CounterLogic : LogicBase
{
public enum ValueSourceType

[ShowIf("isValueGlobal")]
public Globals.Scope GlobalScope = Globals.Scope.Global;
[ReorderableList]
[ReorderableList]
public Callable[] OnTestFail;
bool isValueProperty() { return ValueSource == ValueSourceType.Property; }

5
Runtime/Ingredients/Factory/Factory.cs


namespace GameplayIngredients
{
[HelpURL(Help.URL + "factory")]
[AddComponentMenu("Gameplay Ingredients/Factory")]
public class Factory : MonoBehaviour
public class Factory : GameplayIngredientsBehaviour
{
public enum BlueprintSelectionMode
{

[Min(1), SerializeField]
private int MaxInstances = 1;
[ReorderableList]
[ReorderableList]
public Callable[] OnRespawn;
List<GameObject> m_Instances;

1
Runtime/Ingredients/Factory/FactorySetTargetAction.cs


namespace GameplayIngredients.Actions
{
[HelpURL(Help.URL + "factory")]
[Callable("Game", "Misc/ic-factory.png")]
public class FactorySetTargetAction : ActionBase
{
[NonNullCheck]

1
Runtime/Ingredients/Factory/FactorySpawnAction.cs


namespace GameplayIngredients.Actions
{
[HelpURL(Help.URL + "factory")]
[Callable("Game", "Misc/ic-factory.png")]
public class FactorySpawnAction : ActionBase
{
[NonNullCheck]

1
Runtime/Ingredients/Interactions/Interaction.cs


namespace GameplayIngredients.Interactions
{
[HelpURL(Help.URL + "interactive")]
[Callable("Game", "Misc/ic-interaction.png")]
public class Interaction : ActionBase
{
public InteractiveUser InteractiveUser;

2
Runtime/Ingredients/Interactions/Interactive.cs


public abstract class Interactive : EventBase
{
[Header("Events")]
[SerializeField, ReorderableList]
[SerializeField]
protected Callable[] OnInteract;
protected virtual void OnEnable()

3
Runtime/Ingredients/Interactions/InteractiveUser.cs


using System.Collections;
using System.Collections.Generic;
using UnityEngine;

public abstract class InteractiveUser : MonoBehaviour
public abstract class InteractiveUser : GameplayIngredientsBehaviour
{
public abstract bool CanInteract(Interactive interactive);

1
Runtime/Ingredients/Pickup/PickupItem.cs


{
public PickupEffectBase[] effects { get { return GetComponents<PickupEffectBase>(); } }
[ReorderableList]
public Callable[] OnPickup;
private void OnTriggerEnter(Collider other)

1
Runtime/Ingredients/Rigs/ReachPositionRig.cs


public bool inLocalSpace = false;
[Header("On Reach Position")]
[ReorderableList]
public Callable[] OnReachPosition;
public float ReachSnapDistance = 0.01f;

1
Runtime/Ingredients/StateMachine/SetStateAction.cs


namespace GameplayIngredients.Actions
{
[HelpURL(Help.URL + "state-machines")]
[Callable("State Machines", "Misc/ic-StateMachine-SetState.png")]
public class SetStateAction : ActionBase
{
[NonNullCheck]

4
Runtime/Ingredients/StateMachine/State.cs


{
public string StateName { get { return gameObject.name; } }
[ReorderableList]
[ReorderableList]
[ReorderableList, ShowIf("AllowUpdateCalls")]
[ShowIf("AllowUpdateCalls")]
public Callable[] OnStateUpdate;
private bool AllowUpdateCalls()

5
Runtime/Ingredients/Timer/Timer.cs


{
[HelpURL(Help.URL + "timers")]
[AdvancedHierarchyIcon("Packages/net.peeweek.gameplay-ingredients/Icons/Misc/ic-timer.png")]
public class Timer : MonoBehaviour
public class Timer : GameplayIngredientsBehaviour
{
public bool StartOnEnable = false;

public uint CurrentMilliseconds { get { return (uint)((m_TTL % 1.0f) * 1000); } }
[ReorderableList]
[ReorderableList]
[ReorderableList]
public Callable[] OnTimerStart;
float m_TTL = 0.0f;

3
Runtime/Ingredients/Timer/TimerAction.cs


using NaughtyAttributes;
using System.Collections;
using System.Collections.Generic;
[Callable("Time", "Misc/ic-timer.png")]
public class TimerAction : ActionBase
{
public enum Action

15
Runtime/Ingredients/Timer/TimerDisplayRig.cs


using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine;
using GameplayIngredients.Rigs;
public class TimerDisplayRig : MonoBehaviour
public class TimerDisplayRig : Rig
{
[NonNullCheck]
public Text text;

[InfoBox("Use the following wildcards:\n - %h : hours\n - %m : minutes\n - %s : seconds\n - %x : milliseconds", EInfoBoxType.Normal)]
public string format = "%h:%m:%s:%x";
public override UpdateMode defaultUpdateMode => UpdateMode.Update;
public override int defaultPriority => 0;
private void OnValidate()
{
UpdateText();

UpdateText();
}
private void Update()
public override void UpdateRig(float deltaTime)
{
if (timer == null || (text == null && textMesh == null))
return;

1
Runtime/LevelScripting/Actions/ApplicationExitAction.cs


namespace GameplayIngredients.Actions
{
[Callable("Application","Actions/ic-action-exit.png")]
public class ApplicationExitAction : ActionBase
{
public override void Execute(GameObject instigator = null)

1
Runtime/LevelScripting/Actions/AttachToObjectAction.cs


namespace GameplayIngredients.Actions
{
[Callable("Game Objects", "Actions/ic-action-attach.png")]
public class AttachToObjectAction : ActionBase
{
public enum Action

1
Runtime/LevelScripting/Actions/AudioMixParameterAction.cs


namespace GameplayIngredients.Actions
{
[Callable("Audio", "Actions/ic-action-audio.png")]
public class AudioMixParameterAction : ActionBase
{
public AudioMixer AudioMixer;

1
Runtime/LevelScripting/Actions/AudioMixParameterCurveAction.cs


namespace GameplayIngredients.Actions
{
[Callable("Audio", "Actions/ic-action-audio.png")]
public class AudioMixParameterCurveAction : ActionBase
{
public AudioMixer AudioMixer;

35
Runtime/LevelScripting/Actions/AudioMixSnapshotAction.cs


using System.Collections;
using System.Collections.Generic;
using GameplayIngredients;
using GameplayIngredients.Actions;
public class AudioMixSnapshotAction : ActionBase
namespace GameplayIngredients.Actions
[NonNullCheck]
public AudioMixer Mixer;
[Min(0.0f)]
public float TimeToReach = 1.0f;
public string SnapshotName = "master";
[Callable("Audio", "Actions/ic-action-audio.png")]
public class AudioMixSnapshotAction : ActionBase
{
[NonNullCheck]
public AudioMixer Mixer;
[Min(0.0f)]
public float TimeToReach = 1.0f;
public string SnapshotName = "master";
public override void Execute(GameObject instigator = null)
{
Mixer?.TransitionToSnapshots(new AudioMixerSnapshot[]{ Mixer.FindSnapshot(SnapshotName)}, new float[]{ 1.0f}, TimeToReach);
}
public override void Execute(GameObject instigator = null)
{
Mixer?.TransitionToSnapshots(new AudioMixerSnapshot[] { Mixer.FindSnapshot(SnapshotName) }, new float[] { 1.0f }, TimeToReach);
}
public override string GetDefaultName()
{
return $"Set Mixer Snapshot:'{SnapshotName}' ({TimeToReach})s";
public override string GetDefaultName()
{
return $"Set Mixer Snapshot:'{SnapshotName}' ({TimeToReach})s";
}

1
Runtime/LevelScripting/Actions/AudioPlayClipAction.cs


namespace GameplayIngredients.Actions
{
[Callable("Audio", "Actions/ic-action-audio.png")]
public class AudioPlayClipAction : ActionBase
{
public AudioClip Clip;

1
Runtime/LevelScripting/Actions/CursorAction.cs


namespace GameplayIngredients.Actions
{
[Callable("Screen", "Actions/ic-action-mouse.png")]
public class CursorAction : ActionBase
{
public CursorLockMode LockState = CursorLockMode.None;

1
Runtime/LevelScripting/Actions/CycleResolutionsAction.cs


namespace GameplayIngredients.Actions
{
[Obsolete]
[Callable("Screen", "Actions/ic-action-screen.png")]
public class CycleResolutionsAction : ActionBase
{
public Text ButtonLabel;

1
Runtime/LevelScripting/Actions/CycleWindowModeAction.cs


namespace GameplayIngredients.Actions
{
[Obsolete]
[Callable("Screen", "Actions/ic-action-screen.png")]
public class CycleWindowModeAction : ActionBase
{
public Text ButtonLabel;

1
Runtime/LevelScripting/Actions/DestroyObjectAction.cs


namespace GameplayIngredients.Actions
{
[Callable("Game Objects", "Actions/ic-action-trash.png")]
public class DestroyObjectAction : ActionBase
{
[ReorderableList]

1
Runtime/LevelScripting/Actions/DirectorControlRigAction.cs


namespace GameplayIngredients.Actions
{
[Callable("Sequencing", "Actions/ic-action-director.png")]
public class DirectorControlRigAction : ActionBase
{
[NonNullCheck]

1
Runtime/LevelScripting/Actions/FocusUIAction.cs


namespace GameplayIngredients.Actions
{
[Callable("UI", "Actions/ic-action-ui.png")]
public class FocusUIAction : ActionBase
{
public Selectable UIObjectToFocus;

7
Runtime/LevelScripting/Actions/FullScreenFadeAction.cs


using System;
using System.Collections;
using System.Collections.Generic;
using UnityEngine.Events;
[Callable("Screen", "Actions/ic-action-screen.png")]
public class FullScreenFadeAction : ActionBase
{
public FullScreenFadeManager.FadeMode Fading = FullScreenFadeManager.FadeMode.ToBlack;

[ReorderableList]
public Callable[] OnComplete;
public override void Execute(GameObject instigator = null)

2
Runtime/LevelScripting/Actions/GameLevelLoadAction.cs


namespace GameplayIngredients.Actions
{
[Callable("Game", "GameManager Icon.png")]
public class GameLevelLoadAction : ActionBase
{
public enum Target

public bool SaveProgress = false;
[ReorderableList]
public Callable[] OnComplete;
private bool isSpecified() { return level == Target.SpecifiedLevel; }

1
Runtime/LevelScripting/Actions/GameManagerSendStartupMessageAction.cs


namespace GameplayIngredients.Actions
{
[Callable("Game", "GameManager Icon.png")]
public class GameManagerSendStartupMessageAction : ActionBase
{
public enum MessageType

1
Runtime/LevelScripting/Actions/GameSaveLoadSaveAction.cs


namespace GameplayIngredients.Actions
{
[Callable("Data", "Actions/ic-action-save.png")]
public class GameSaveLoadSaveAction : ActionBase
{
public enum Action

1
Runtime/LevelScripting/Actions/GameSaveSetValueAction.cs


namespace GameplayIngredients.Actions
{
[Callable("Data", "Actions/ic-action-save.png")]
public class GameSaveSetValueAction : ActionBase
{
public string Key = "SomeKey";

1
Runtime/LevelScripting/Actions/LogAction.cs


namespace GameplayIngredients.Actions
{
[Callable("Application", "Actions/ic-action-log.png")]
public class LogAction : ActionBase
{
const string kHelpText = @"Wildcards:

1
Runtime/LevelScripting/Actions/RandomToggleGameObjectAction.cs


namespace GameplayIngredients.Actions
{
[Callable("Game Objects", "Actions/ic-action-list.png")]
public class RandomToggleGameObjectAction : ActionBase
{
[ReorderableList]

1
Runtime/LevelScripting/Actions/ReachPositionRigSetTargetAction.cs


namespace GameplayIngredients.Actions
{
[Callable("Game", "Rigs/ic-rig-reachposition.png")]
public class ReachPositionRigSetTargetAction : ActionBase
{
[NonNullCheck]

1
Runtime/LevelScripting/Actions/RigidbodyAction.cs


public enum ActionSpace { Local, World };
[ExecuteAlways]
[Callable("Game", "Actions/ic-action-rigidbody.png")]
public class RigidbodyAction : ActionBase
{
public bool ApplyOnInstigator = false;

1
Runtime/LevelScripting/Actions/SendMessageAction.cs


namespace GameplayIngredients.Actions
{
[HelpURL(Help.URL + "messager")]
[Callable("Game", "Actions/ic-action-message.png")]
public class SendMessageAction : ActionBase
{
public string MessageToSend = "Message";

1
Runtime/LevelScripting/Actions/SetAnimatorParameterAction.cs


{
public enum AnimatorParameterType { Bool, Float, Int, Trigger };
[Callable("Game", "Actions/ic-generic-action.png")]
public class SetAnimatorParameterAction : ActionBase
{
public Animator animator;

2
Runtime/LevelScripting/Actions/SetAnimatorParameterAction.cs.meta


serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
icon: {fileID: 2800000, guid: 87355f4718c07b542b49dd0fe0abe447, type: 3}
userData:
assetBundleName:
assetBundleVariant:

1
Runtime/LevelScripting/Actions/SetRandomSeedAction.cs


namespace GameplayIngredients.Actions
{
[Callable("Game", "Actions/ic-action-randomseed.png")]
public class SetRandomSeedAction : ActionBase
{
[Tooltip("Whether to set a new random seed, or a fixed seed")]

2
Runtime/LevelScripting/Actions/SetRandomSeedAction.cs.meta


serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
icon: {fileID: 2800000, guid: 2bf3946d17b8843439f50d0c5dde63c5, type: 3}
userData:
assetBundleName:
assetBundleVariant:

1
Runtime/LevelScripting/Actions/SetTimeScaleAction.cs


namespace GameplayIngredients.Actions
{
[Callable("Time", "Actions/ic-action-time.png")]
public class SetTimeScaleAction : ActionBase
{
public float TimeScale = 1.0f;

1
Runtime/LevelScripting/Actions/SpawnPrefabAction.cs


namespace GameplayIngredients.Actions
{
[Callable("Game Objects", "Actions/ic-action-spawn.png")]
public class SpawnPrefabAction : ActionBase
{
[ReorderableList]

2
Runtime/LevelScripting/Actions/StreamingLevelAction.cs


namespace GameplayIngredients.Actions
{
[Callable("Game", "Misc/ic-scene.png")]
public class StreamingLevelAction : ActionBase
{
[ReorderableList, Scene]

public bool ShowUI = false;
[ReorderableList]
public Callable[] OnLoadComplete;
public override void Execute(GameObject instigator = null)

1
Runtime/LevelScripting/Actions/TakeScreenshotAction.cs


namespace GameplayIngredients.Actions
{
[Callable("Screen", "Actions/ic-action-screen.png")]
public class TakeScreenshotAction : ActionBase
{
[Tooltip("Super Sampling multiplier")]

1
Runtime/LevelScripting/Actions/TeleportGameObjectAction.cs


namespace GameplayIngredients.Actions
{
[Callable("Game Objects", "Actions/ic-action-teleport.png")]
public class TeleportGameObjectAction : ActionBase
{
[ReorderableList]

1
Runtime/LevelScripting/Actions/TimelineControlAction.cs


namespace GameplayIngredients.Actions
{
[Callable("Sequencing", "Actions/ic-action-timeline.png")]
public class TimelineControlAction : ActionBase
{
public enum TimelineControlMode

1
Runtime/LevelScripting/Actions/ToggleBehaviourAction.cs


namespace GameplayIngredients.Actions
{
[Callable("Game Objects", "Actions/ic-action-list.png")]
public class ToggleBehaviourAction : ActionBase
{

1
Runtime/LevelScripting/Actions/ToggleGameObjectAction.cs


namespace GameplayIngredients.Actions
{
[Callable("Game Objects", "Actions/ic-action-list.png")]
public class ToggleGameObjectAction : ActionBase
{
[ContextMenu("Update Toggles from Current State")]

1
Runtime/LevelScripting/Actions/ToggleUIAction.cs


namespace GameplayIngredients.Actions
{
[Callable("UI", "Actions/ic-action-ui.png")]
public class ToggleUIAction : ActionBase
{
[ReorderableList]

1
Runtime/LevelScripting/Actions/UnityEventAction.cs


namespace GameplayIngredients.Actions
{
[Callable("Game", "Actions/ic-action-event.png")]
public class UnityEventAction : ActionBase
{
public UnityEvent OnExecute;

30
Runtime/LevelScripting/Actions/VFXSendEventAction.cs


using GameplayIngredients.Actions;
public class VFXSendEventAction : ActionBase
namespace GameplayIngredients.Actions
public VisualEffect visualEffect;
[Callable("Game", "Misc/ic-vfx.png")]
public class VFXSendEventAction : ActionBase
{
public VisualEffect visualEffect;
public string eventName = "Event";
public string eventName = "Event";
public override void Execute(GameObject instigator = null)
{
int id = Shader.PropertyToID(eventName);
var attrib = visualEffect.CreateVFXEventAttribute();
visualEffect.SendEvent(eventName, attrib);
public override void Execute(GameObject instigator = null)
{
int id = Shader.PropertyToID(eventName);
var attrib = visualEffect.CreateVFXEventAttribute();
visualEffect.SendEvent(eventName, attrib);
}
public override string GetDefaultName()
{
return $"Send VFX Event '{eventName}' to {visualEffect?.gameObject.name}";
}
public override string GetDefaultName()
{
return $"Send VFX Event '{eventName}' to {visualEffect?.gameObject.name}";
}
}

2
Runtime/LevelScripting/Actions/VFXSendEventAction.cs.meta


serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
icon: {fileID: 2800000, guid: 9a14315cb05b557459e14128a03f988f, type: 3}
userData:
assetBundleName:
assetBundleVariant:

197
Runtime/LevelScripting/Actions/VFXSetPropertyAction.cs


using NaughtyAttributes;
using UnityEngine.Serialization;
public class VFXSetPropertyAction : ActionBase
namespace GameplayIngredients.Actions
public enum DataType
[Callable("Game", "Misc/ic-vfx.png")]
public class VFXSetPropertyAction : ActionBase
Bool,
Float,
Vector2,
Vector3,
Vector4,
Texture2D,
Texture3D,
UInt,
Int
}
public enum DataType
{
Bool,
Float,
Vector2,
Vector3,
Vector4,
Texture2D,
Texture3D,
UInt,
Int
}
public VisualEffect visualEffect;
public VisualEffect visualEffect;
[FormerlySerializedAs("parameter")]
public string property = "Property";
public bool Override = true;
[FormerlySerializedAs("parameter")]
public string property = "Property";
public bool Override = true;
[SerializeField]
protected DataType dataType = DataType.Float;
[SerializeField]
protected DataType dataType = DataType.Float;
[ShowIf("isBool")]
public bool BoolValue = false;
[ShowIf("isFloat")]
public float FloatValue = 0.0f;
[ShowIf("isVector2")]
public Vector2 Vector2Value = Vector2.zero;
[ShowIf("isVector3")]
public Vector3 Vector3Value = Vector3.zero;
[ShowIf("isVector4")]
public Vector4 Vector4Value = Vector4.zero;
[ShowIf("isTexture2D")]
public Texture2D Texture2DValue;
[ShowIf("isTexture3D")]
public Texture3D Texture3DValue;
[ShowIf("isUInt")]
public uint UIntValue = 0;
[ShowIf("isInt")]
public int IntValue = 0;
[ShowIf("isBool")]
public bool BoolValue = false;
[ShowIf("isFloat")]
public float FloatValue = 0.0f;
[ShowIf("isVector2")]
public Vector2 Vector2Value = Vector2.zero;
[ShowIf("isVector3")]
public Vector3 Vector3Value = Vector3.zero;
[ShowIf("isVector4")]
public Vector4 Vector4Value = Vector4.zero;
[ShowIf("isTexture2D")]
public Texture2D Texture2DValue;
[ShowIf("isTexture3D")]
public Texture3D Texture3DValue;
[ShowIf("isUInt")]
public uint UIntValue = 0;
[ShowIf("isInt")]
public int IntValue = 0;
public override void Execute(GameObject instigator = null)
{
int id = Shader.PropertyToID(property);
if(HasParameter(id))
public override void Execute(GameObject instigator = null)
if (!Override)
visualEffect.ResetOverride(id);
else
int id = Shader.PropertyToID(property);
if(HasParameter(id))
switch (dataType)
if (!Override)
visualEffect.ResetOverride(id);
else
case DataType.Bool: visualEffect.SetBool(id, BoolValue); break;
case DataType.Float: visualEffect.SetFloat(id, FloatValue); break;
case DataType.Vector2: visualEffect.SetVector2(id, Vector2Value); break;
case DataType.Vector3: visualEffect.SetVector3(id, Vector3Value); break;
case DataType.Vector4: visualEffect.SetVector4(id, Vector4Value); break;
case DataType.Texture2D: visualEffect.SetTexture(id, Texture2DValue); break;
case DataType.Texture3D: visualEffect.SetTexture(id, Texture3DValue); break;
case DataType.UInt: visualEffect.SetUInt(id, UIntValue); break;
case DataType.Int: visualEffect.SetInt(id, IntValue); break;
switch (dataType)
{
case DataType.Bool: visualEffect.SetBool(id, BoolValue); break;
case DataType.Float: visualEffect.SetFloat(id, FloatValue); break;
case DataType.Vector2: visualEffect.SetVector2(id, Vector2Value); break;
case DataType.Vector3: visualEffect.SetVector3(id, Vector3Value); break;
case DataType.Vector4: visualEffect.SetVector4(id, Vector4Value); break;
case DataType.Texture2D: visualEffect.SetTexture(id, Texture2DValue); break;
case DataType.Texture3D: visualEffect.SetTexture(id, Texture3DValue); break;
case DataType.UInt: visualEffect.SetUInt(id, UIntValue); break;
case DataType.Int: visualEffect.SetInt(id, IntValue); break;
}
}
bool HasParameter(int id)
{
switch(dataType)
bool HasParameter(int id)
case DataType.Bool: return visualEffect.HasBool(id);
case DataType.Float: return visualEffect.HasFloat(id);
case DataType.Vector2: return visualEffect.HasVector2(id);
case DataType.Vector3: return visualEffect.HasVector3(id);
case DataType.Vector4: return visualEffect.HasVector4(id);
case DataType.Texture2D: return visualEffect.HasTexture(id);
case DataType.Texture3D: return visualEffect.HasTexture(id);
case DataType.UInt: return visualEffect.HasUInt(id);
case DataType.Int: return visualEffect.HasInt(id);
switch(dataType)
{
case DataType.Bool: return visualEffect.HasBool(id);
case DataType.Float: return visualEffect.HasFloat(id);
case DataType.Vector2: return visualEffect.HasVector2(id);
case DataType.Vector3: return visualEffect.HasVector3(id);
case DataType.Vector4: return visualEffect.HasVector4(id);
case DataType.Texture2D: return visualEffect.HasTexture(id);
case DataType.Texture3D: return visualEffect.HasTexture(id);
case DataType.UInt: return visualEffect.HasUInt(id);
case DataType.Int: return visualEffect.HasInt(id);
}
return false;
return false;
}
public override string GetDefaultName()
{
if (!Override)
return $"Reset VFX override for property :'{property}' ({dataType})";
else
public override string GetDefaultName()
switch (dataType)
if (!Override)
return $"Reset VFX override for property :'{property}' ({dataType})";
else
switch (dataType)
{
case DataType.Bool: return $"{visualEffect.name} {property} {BoolValue} ";
case DataType.Float: return $"{visualEffect.name} {property} {FloatValue} ";
case DataType.Vector2: return $"{visualEffect.name} {property} {Vector2Value} ";
case DataType.Vector3: return $"{visualEffect.name} {property} {Vector3Value} ";
case DataType.Vector4: return $"{visualEffect.name} {property} {Vector4Value} ";
case DataType.Texture2D: return $"{visualEffect.name} {property} {Texture2DValue} ";
case DataType.Texture3D: return $"{visualEffect.name} {property} {Texture3DValue} ";
case DataType.UInt: return $"{visualEffect.name} {property} {UIntValue} ";
case DataType.Int: return $"{visualEffect.name} {property} {IntValue} ";
default:
return $"Set VFX <UNKNOWN> property :'{property}'";
case DataType.Bool: return $"{visualEffect.name} {property} {BoolValue} ";
case DataType.Float: return $"{visualEffect.name} {property} {FloatValue} ";
case DataType.Vector2: return $"{visualEffect.name} {property} {Vector2Value} ";
case DataType.Vector3: return $"{visualEffect.name} {property} {Vector3Value} ";
case DataType.Vector4: return $"{visualEffect.name} {property} {Vector4Value} ";
case DataType.Texture2D: return $"{visualEffect.name} {property} {Texture2DValue} ";
case DataType.Texture3D: return $"{visualEffect.name} {property} {Texture3DValue} ";
case DataType.UInt: return $"{visualEffect.name} {property} {UIntValue} ";
case DataType.Int: return $"{visualEffect.name} {property} {IntValue} ";
default:
return $"Set VFX <UNKNOWN> property :'{property}'";
}
}
bool isBool() { return dataType == DataType.Bool; }
bool isFloat() { return dataType == DataType.Float; }
bool isVector2() { return dataType == DataType.Vector2; }
bool isVector3() { return dataType == DataType.Vector3; }
bool isVector4() { return dataType == DataType.Vector4; }
bool isTexture2D() { return dataType == DataType.Texture2D; }
bool isTexture3D() { return dataType == DataType.Texture3D; }
bool isUInt() { return dataType == DataType.UInt; }
bool isInt() { return dataType == DataType.Int; }
bool isBool() { return dataType == DataType.Bool; }
bool isFloat() { return dataType == DataType.Float; }
bool isVector2() { return dataType == DataType.Vector2; }
bool isVector3() { return dataType == DataType.Vector3; }
bool isVector4() { return dataType == DataType.Vector4; }
bool isTexture2D() { return dataType == DataType.Texture2D; }
bool isTexture3D() { return dataType == DataType.Texture3D; }
bool isUInt() { return dataType == DataType.UInt; }
bool isInt() { return dataType == DataType.Int; }
}

2
Runtime/LevelScripting/Actions/VFXSetPropertyAction.cs.meta


serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
icon: {fileID: 2800000, guid: 9a14315cb05b557459e14128a03f988f, type: 3}
userData:
assetBundleName:
assetBundleVariant:

1
Runtime/LevelScripting/Events/OnAwakeEvent.cs


{
public class OnAwakeEvent : EventBase
{
[ReorderableList]
public Callable[] onAwake;
private void Awake()

3
Runtime/LevelScripting/Events/OnButtonDownEvent.cs


{
public string Button = "Fire1";
[ReorderableList]
[ReorderableList]
public Callable[] OnButtonUp;
void Update()

3
Runtime/LevelScripting/Events/OnColliderEvent.cs


[RequireComponent(typeof(Collider))]
public class OnColliderEvent : EventBase
{
[ReorderableList]
[ReorderableList]
public Callable[] onCollisionExit;
public bool OnlyInteractWithTag = false;

1
Runtime/LevelScripting/Events/OnDestroyEvent.cs


{
public class OnDestroyEvent : EventBase
{
[ReorderableList]
public Callable[] onDestroy;
private void OnDestroy()

2
Runtime/LevelScripting/Events/OnEnableDisableEvent.cs


[AdvancedHierarchyIcon("Packages/net.peeweek.gameplay-ingredients/Icons/Events/ic-event-enable-disable.png")]
public class OnEnableDisableEvent : EventBase
{
[ReorderableList]
[ReorderableList]
public Callable[] OnDisableEvent;
private void OnEnable()

1
Runtime/LevelScripting/Events/OnGameManagerLevelStart.cs


string m_Message;
[ReorderableList]
public Callable[] OnMessageRecieved;
void OnEnable()

1
Runtime/LevelScripting/Events/OnJointBreakEvent.cs


[RequireComponent(typeof(Joint))]
public class OnJointBreakEvent : EventBase
{
[ReorderableList]
public Callable[] onJointBreak;
private void OnJointBreak(float breakForce)

3
Runtime/LevelScripting/Events/OnKeyDownEvent.cs


{
public KeyCode Key = KeyCode.F5;
[ReorderableList]
[ReorderableList]
public Callable[] OnKeyUp;
void Update()

1
Runtime/LevelScripting/Events/OnMessageEvent.cs


{
public string MessageName = "Message";
[ReorderableList]
public Callable[] OnMessageRecieved;
void OnEnable()

1
Runtime/LevelScripting/Events/OnMouseDownEvent.cs


[RequireComponent(typeof(Collider))]
public class OnMouseDownEvent : EventBase
{
[ReorderableList]
public Callable[] MouseDown;
private void OnMouseDown()

2
Runtime/LevelScripting/Events/OnMouseHoverEvent.cs


[RequireComponent(typeof(Collider))]
public class OnMouseHoverEvent : EventBase
{
[ReorderableList]
[ReorderableList]
public Callable[] OnHoverOut;

1
Runtime/LevelScripting/Events/OnStartEvent.cs


[AdvancedHierarchyIcon("Packages/net.peeweek.gameplay-ingredients/Icons/Events/ic-event-start.png")]
public class OnStartEvent : EventBase
{
[ReorderableList]
public Callable[] OnStart;
private void Start()

3
Runtime/LevelScripting/Events/OnTriggerEvent.cs


[AdvancedHierarchyIcon("Packages/net.peeweek.gameplay-ingredients/Icons/Events/ic-event-trigger.png")]
public class OnTriggerEvent : EventBase
{
[ReorderableList]
[ReorderableList]
public Callable[] onTriggerExit;
public bool OnlyInteractWithTag = true;

2
Runtime/LevelScripting/Events/OnUpdateEvent.cs


{
public class OnUpdateEvent : EventBase
{
[ReorderableList, EnableIf("AllowUpdateCalls")]
[EnableIf("AllowUpdateCalls")]
public Callable[] OnUpdate;
private void OnEnable()

2
Runtime/LevelScripting/Events/OnVisibilityEvent.cs


[RequireComponent(typeof(Renderer))]
public class OnVisibilityEvent : EventBase
{
[ReorderableList]
[ReorderableList]
public Callable[] OnInvisible;
private void OnBecameVisible()

3
Runtime/LevelScripting/Logic/ConditionalLogic.cs


{
public abstract class ConditionalLogic : LogicBase
{
[ReorderableList]
[ReorderableList]
public Callable[] OnConditionInvalid;
public override void Execute(GameObject instigator = null)

3
Runtime/LevelScripting/Logic/DelayedLogic.cs


using UnityEngine;
namespace GameplayIngredients.Logic
{
[Callable("Time", "Logic/ic-generic-logic.png")]
public class DelayedLogic : LogicBase
{
public enum DelayMode { Constant, Random };

[ShowIf("DelayIsRandom")]
public Vector2 DelayRange = Vector2.one;
[ReorderableList]
[ReorderableList]
public Callable[] OnCanceled;
IEnumerator m_Coroutine;
private void OnValidate()

2
Runtime/LevelScripting/Logic/EditorOnlyLogic.cs


namespace GameplayIngredients.Logic
{
[Callable("Application", "Logic/ic-generic-logic.png")]
public class EditorOnlyLogic : LogicBase
{
public enum Mode

public Mode ExecutionPath = Mode.PlayerAndEditor;
[ReorderableList]
public Callable[] OnExecute;
public override void Execute(GameObject instigator = null)

4
Runtime/LevelScripting/Logic/FlipFlopLogic.cs


namespace GameplayIngredients.Logic
{
[Callable("Logic", "Logic/ic-generic-logic.png")]
public class FlipFlopLogic : LogicBase
{
public enum State

public State InitialState = State.Flip;
[ReorderableList]
[ReorderableList]
public Callable[] OnFlop;
private State state;

2
Runtime/LevelScripting/Logic/Logic.cs


namespace GameplayIngredients.Logic
{
[Callable("Logic", "Logic/ic-generic-logic.png")]
[ReorderableList]
public Callable[] Calls;
public override void Execute(GameObject instigator = null)

2
Runtime/LevelScripting/Logic/NTimesLogic.cs


namespace GameplayIngredients.Logic
{
[Callable("Logic", "Logic/ic-generic-logic.png")]
[ReorderableList]
public Callable[] Calls;
[Min(1), SerializeField]
protected int Count = 1;

2
Runtime/LevelScripting/Logic/NextFrameLogic.cs


namespace GameplayIngredients.Logic
{
[Callable("Time", "Logic/ic-generic-logic.png")]
[ReorderableList]
public Callable[] OnNextFrame;
IEnumerator m_Coroutine;

5
Runtime/LevelScripting/Logic/PlatformLogic.cs


namespace GameplayIngredients.Logic
{
[Callable("Application", "Logic/ic-generic-logic.png")]
public class PlatformLogic : LogicBase
{
public enum InclusionMode

public InclusionMode inclusionMode = InclusionMode.IsTarget;
[ReorderableList, FormerlySerializedAs("Calls")]
[FormerlySerializedAs("Calls")]
[ReorderableList]
public Callable[] OnTestInvalid;

2
Runtime/LevelScripting/Logic/RandomLogic.cs


namespace GameplayIngredients.Logic
{
[Callable("Logic", "Logic/ic-generic-logic.png")]
[ReorderableList]
public Callable[] RandomCalls;
public override void Execute(GameObject instigator = null)

3
Runtime/LevelScripting/Logic/SaveDataLogic.cs


namespace GameplayIngredients.Logic
{
[Callable("Data", "Logic/ic-generic-logic.png")]
public class SaveDataLogic : LogicBase
{
public enum Evaluation

[ShowIf("isString")]
public string StringTargetValue;
[ReorderableList]
[ReorderableList]
public Callable[] OnTestFail;
public override void Execute(GameObject instigator = null)

3
Runtime/LevelScripting/Logic/SaveDataSwitchOnIntLogic.cs


namespace GameplayIngredients.Logic
{
[Callable("Data", "Logic/ic-generic-logic.png")]
public class SaveDataSwitchOnIntLogic : LogicBase
{
public GameSaveManager.Location SaveLocation = GameSaveManager.Location.System;

public Callable[] DefaultCaseToCall;
[ReorderableList, NonNullCheck]
[NonNullCheck]
public Callable[] CasesToCall;
public override void Execute(GameObject instigator = null)

2
Runtime/LevelScripting/Logic/SetInstigatorFromFactoryLogic.cs


namespace GameplayIngredients.Logic
{
[Callable("Game", "Logic/ic-generic-logic.png")]
[ReorderableList]
public Callable[] Next;
[NonNullCheck]

2
Runtime/LevelScripting/Logic/SetInstigatorLogic.cs


namespace GameplayIngredients.Logic
{
[Callable("Game", "Logic/ic-generic-logic.png")]
[ReorderableList]
public Callable[] Next;
public GameObject NewInstigator;

3
Runtime/LevelScripting/Logic/StateLogic.cs


namespace GameplayIngredients.Logic
{
[Callable("State Machines", "Logic/ic-generic-logic.png")]
public class StateLogic : LogicBase
{
[NonNullCheck]

[ReorderableList]
[ReorderableList]
public Callable[] IfNotCurrentState;
public override void Execute(GameObject instigator = null)

3
Runtime/Managers/Globals/GlobalLogic.cs


namespace GameplayIngredients.Logic
{
[HelpURL(Help.URL + "globals")]
[Callable("Data", "Logic/ic-generic-logic.png")]
public class GlobalLogic : LogicBase
{
[Header("Base Value")]

bool isGlobal() { return compareTo == CompareTo.OtherGlobalVariable && isCompareToOther(); }
bool isCompareToOther() { return evaluation != Evaluation.Exists; }
[ReorderableList]
[ReorderableList]
public Callable[] OnTestFail;
public override void Execute(GameObject instigator = null)

1
Runtime/Managers/Globals/ResetGlobalAction.cs


namespace GameplayIngredients.Actions
{
[HelpURL(Help.URL + "globals")]
[Callable("Data", "Misc/ic-globals.png")]
public class ResetGlobalAction : ActionBase
{
public ResetType resetType = ResetType.Locals;

3
Runtime/Managers/Globals/SetGlobalAction.cs


using NaughtyAttributes;
using System.Collections;
using System.Collections.Generic;
[Callable("Data", "Misc/ic-globals.png")]
public class SetGlobalAction : ActionBase
{
public Globals.Scope scope = Globals.Scope.Global;

3
Runtime/Managers/Implementations/GameManager.cs


public class GameManager : Manager
{
[Header("Events")]
[ReorderableList]
[ReorderableList]
[ReorderableList]
public Callable[] OnMainMenuLoaded;
[Header("Levels"), NonNullCheck]

3
Runtime/Managers/Implementations/GameSaveManager.cs


Dictionary<string, System.Object> systemSaveEntries;
Dictionary<string, System.Object> currentUserSaveEntries;
[ReorderableList]
[ReorderableList]
public Callable[] OnSave;
const string kPreferencePrefix = "GameplayIngredients.GameSaveManager.";

3
Runtime/Managers/Implementations/ScreenshotManager.cs


public string Prefix = "Screenshot";
[Header("Actions")]
[ReorderableList]
[ReorderableList]
public Callable[] OnAfterScreenshot;
public void Update()

33
Runtime/Managers/Manager.cs


return(s_Managers.ContainsKey(typeof(T)));
}
static readonly Type[] kAllManagerTypes = GetAllManagerTypes();
static readonly Type[] kAllManagerTypes = TypeUtility.GetConcreteTypes<Manager>();
[RuntimeInitializeOnLoadMethod(RuntimeInitializeLoadType.BeforeSceneLoad)]
static void AutoCreateAll()

if (GameplayIngredientsSettings.currentSettings.verboseCalls)
Debug.Log(string.Format(" -> <{0}> OK", type.Name));
}
}
static Type[] GetAllManagerTypes()
{
List<Type> types = new List<Type>();
foreach(var assembly in AppDomain.CurrentDomain.GetAssemblies())
{
Type[] assemblyTypes = null;
try
{
assemblyTypes = assembly.GetTypes();
}
catch
{
Debug.LogError($"Could not load types from assembly : {assembly.FullName}");
}
if(assemblyTypes != null)
{
foreach (Type t in assemblyTypes)
{
if (typeof(Manager).IsAssignableFrom(t) && !t.IsAbstract)
{
types.Add(t);
}
}
}
}
return types.ToArray();
}
}
}

8
Editor/BrowsePopup.meta


fileFormatVersion: 2
guid: f01d2f5124e821746af4c4bb82ea6727
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

35
Editor/CustomInspectors/GameplayIngredientsBehaviourEditor.cs


using UnityEngine;
using UnityEditor;
using System.Collections.Generic;
using System.Linq;
using NaughtyAttributes.Editor;
using GameplayIngredients.Rigs;
namespace GameplayIngredients.Editor
{
[CustomEditor(typeof(GameplayIngredientsBehaviour), true)]
public class GameplayIngredientsBehaviourEditor : IngredientEditor
{
public override void OnInspectorGUI_PingArea()
{
serializedObject.Update();
EditorGUI.BeginChangeCheck();
DrawBreadCrumb(ObjectNames.NicifyVariableName(serializedObject.targetObject.GetType().Name), color, () =>
{
GUILayout.Label(ObjectNames.NicifyVariableName(serializedObject.targetObject.GetType().Name), GUILayout.ExpandWidth(true));
GUILayout.FlexibleSpace();
});
DrawBaseProperties();
if (EditorGUI.EndChangeCheck())
{
serializedObject.ApplyModifiedProperties();
}
}
static readonly Color color = new Color(.1f, .8f, .6f, 1f);
}
}

11
Editor/CustomInspectors/GameplayIngredientsBehaviourEditor.cs.meta


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

40
Editor/CustomInspectors/ManagerEditor.cs


using UnityEngine;
using UnityEditor;
using System.Collections.Generic;
using System.Linq;
using NaughtyAttributes.Editor;
using GameplayIngredients.Rigs;
namespace GameplayIngredients.Editor
{
[CustomEditor(typeof(Manager), true)]
public class ManagerEditor : IngredientEditor
{
public override void OnInspectorGUI_PingArea()
{
serializedObject.Update();
EditorGUI.BeginChangeCheck();
DrawBreadCrumb("Manager", color, () =>
{
GUILayout.Label(ObjectNames.NicifyVariableName(serializedObject.targetObject.GetType().Name), GUILayout.ExpandWidth(true));
GUILayout.FlexibleSpace();
});
if(GameplayIngredientsSettings.currentSettings.excludedeManagers.Contains(serializedObject.targetObject.GetType().Name))
{
EditorGUILayout.HelpBox("This manager is currently excluded, please check the Manager Exclusion list in your GameplayIngredientsSettings asset located in Assets/Resources", MessageType.Warning);
}
DrawBaseProperties();
if (EditorGUI.EndChangeCheck())
{
serializedObject.ApplyModifiedProperties();
}
}
static readonly Color color = new Color(.8f, .6f, .1f, 1f);
}
}

部分文件因为文件数量过多而无法显示

正在加载...
取消
保存