├── .gitattributes
├── .gitignore
├── Components
├── Comment.cs
├── DebugLogOnScreen.cs
├── DisableOnAwake.cs
├── DontDestroyDeleteDuplicates.cs
├── FPSCounter.cs
├── FollowMouseMovement.cs
├── Other Source
│ └── ParticleScaler.cs
├── Physics related
│ ├── DebugSpeed.cs
│ ├── README.MD
│ └── SetGravityClamped.cs
├── PlayMaker Extension
│ └── DebugFSM
│ │ ├── DebugFSM.cs
│ │ ├── Editor
│ │ └── DebugFSMInspector.cs
│ │ └── README.MD
├── README.MD
├── RemoveAtRuntime.cs
├── TextureScrolling.cs
└── _Third Party
│ ├── GDE
│ ├── GDEInit.cs
│ └── README.MD
│ └── NGUI
│ └── UIDragDropItem2D.cs
├── Custom PlayMaker Actions
├── AnimatedVariables Customs
│ ├── EaseInt.cs
│ └── README.md
├── Animator Customs
│ ├── GetRuntimeAnimatorController.cs
│ ├── README.MD
│ └── SetRuntimeAnimatorController.cs
├── Application Customs
│ ├── IsOnPlatformEvent.cs
│ └── README.MD
├── Array Customs
│ ├── ArrayAddGameObjectIfEnabled.cs
│ ├── ArrayAddIfEmpty.cs
│ ├── ArrayGetRandomAdvanced.cs
│ ├── ArrayIsEmpty.cs
│ ├── ArrayOperator.cs
│ └── README.MD
├── Array Lists & Hash Table Customs
│ ├── ArrayListAddAll.cs
│ ├── ArrayListContainsName.cs
│ ├── ArrayListGetLength.cs
│ ├── ListGameObjectsInsideCollider.cs
│ ├── ListGameObjectsInsideCollider2D.cs
│ └── README.MD
├── Audio Customs
│ ├── Editor
│ │ ├── GetAudioClipName.cs
│ │ └── README.MD
│ ├── GetAudioClipLength.cs
│ ├── GetAudioProgress.cs
│ ├── IntSwitchAudioClip.cs
│ └── README.MD
├── Camera Customs
│ ├── Collider2DIsVisible.cs
│ ├── ColliderIsVisible.cs
│ └── README.MD
├── Color Customs
│ ├── CompareColors.cs
│ └── README.MD
├── Device Customs
│ ├── GetDeviceLinearAcceleration.cs
│ ├── GetDeviceRollCustom.cs
│ ├── README.MD
│ └── SwipeGestureEventAdvanced.cs
├── Enum Customs
│ ├── EnumGetRandom.cs
│ ├── GetEnumAsArray.cs
│ ├── README.MD
│ └── RandomWeightedEnum.cs
├── GameObject & UnityObject Customs
│ ├── ActivateComponents.cs
│ ├── ActivateGameObjects.cs
│ ├── ActivateGameObjectsAdvanced.cs
│ ├── DestroyChildren.cs
│ ├── EnableChildren.cs
│ ├── EnableChildrenInRange.cs
│ ├── FindChildren.cs
│ ├── GameObjectCompareMulti.cs
│ ├── GameObjectKeepActive.cs
│ ├── GetChildCountAdvanced.cs
│ ├── GetChildren.cs
│ ├── GetGameObjectSibling.cs
│ ├── GetLastChild.cs
│ ├── GetMultilevelGameObject.cs
│ ├── GetObjectName.cs
│ ├── HasSibling.cs
│ ├── README.MD
│ ├── SetGameObjectIfNotNull.cs
│ ├── ToggleComponent.cs
│ └── ToggleGameObject.cs
├── Logic Customs
│ ├── ConvertIntToLetter.cs
│ ├── FloatCompareRange.cs
│ ├── IntCompareRange.cs
│ ├── IntSignTest.cs
│ ├── IntSwitchAdvanced.cs
│ └── README.MD
├── Math Customs
│ ├── FloatFlip.cs
│ ├── GetPercentageInt.cs
│ ├── GetUnsignedFloat.cs
│ ├── GetUnsignedInt.cs
│ ├── IntFlip.cs
│ ├── IntRoundToNearest.cs
│ └── README.MD
├── Navigation Customs
│ ├── FindClosestAgent.cs
│ ├── NavMeshAgentGetAreaMask.cs
│ ├── NavMeshAgentMoveTo.cs
│ ├── NavMeshFindClosestPoint.cs
│ └── README.MD
├── Physics & Transform Customs
│ ├── EnableCollider.cs
│ ├── EnableColliderMulti.cs
│ ├── FollowMouse2D.cs
│ ├── GetGameObjectScreenPosition.cs
│ ├── GetGravity2dScale.cs
│ ├── GetPositionAddOffset.cs
│ ├── GetRotationAddOffset.cs
│ ├── GetScaleAddOffset.cs
│ ├── README.MD
│ ├── ResetTransforms.cs
│ └── SetPositions.cs
├── PlayMakerHelpers.cs
├── Random Customs
│ ├── README.MD
│ ├── RandomCharacters.cs
│ ├── RandomFloatAroundRange.cs
│ ├── RandomFloatOnSlope.cs
│ ├── RandomIntAroundRange.cs
│ ├── RandomPointBetweenGameObjects.cs
│ ├── RandomPointOnSlope.cs
│ ├── RandomWaitCustom.cs
│ ├── RandomWeightedVector3.cs
│ ├── SelectRandomAudioClip.cs
│ └── SelectRandomObject.cs
├── Sprite customs
│ ├── README.MD
│ └── SpriteGetName.cs
├── StateMachine Customs
│ ├── DisableThisFSM.cs
│ ├── Editor
│ │ └── SendEventsInspector.cs
│ ├── EnableFsms.cs
│ ├── GetFsmComponent.cs
│ ├── GetGameObjectByFsmVariableValue.cs
│ ├── README.MD
│ ├── RestartThisFSM.cs
│ ├── SendEventRandomDelay.cs
│ ├── SendEventSetMulti.cs
│ ├── SendEventSetValue.cs
│ └── SendEvents.cs
├── String Customs
│ ├── BuildStringAutoConvert.cs
│ ├── GetStringNumbers.cs
│ ├── README.MD
│ ├── StringAppend2.cs
│ ├── StringCompareSetMulti.cs
│ ├── StringContainsSwitch.cs
│ ├── StringRemove.cs
│ ├── StringRemoveChars.cs
│ ├── StringReplaceEachChar.cs
│ └── StringSwitchCustom.cs
├── System & Time Customs
│ ├── CountupTimer.cs
│ ├── Editor
│ │ ├── FindAssetByName.cs
│ │ └── README.MD
│ ├── GetFileExtension.cs
│ ├── GetTimeScale.cs
│ ├── README.MD
│ ├── RandomWaitAroundOffset.cs
│ └── SetPropertyAdvanced.cs
├── Vector Customs
│ ├── README.MD
│ ├── Vector2OperatorAdvanced.cs
│ ├── Vector3Compare.cs
│ └── Vector3OperatorAdvanced.cs
├── _Templates
│ ├── Editor
│ │ └── TemplateInspector.cs
│ ├── ExampleOverview.cs
│ ├── README.MD
│ ├── Template.cs
│ └── TemplateAdvanced.cs
├── _ThirdParty
│ ├── GDE Customs
│ │ ├── GDEAddString.cs
│ │ ├── GDEBoolFlip.cs
│ │ ├── GDEBoolTest.cs
│ │ ├── GDECountOccurrences.cs
│ │ ├── GDECreateItem.cs
│ │ ├── GDEDebugData.cs
│ │ ├── GDEFind.cs
│ │ ├── GDEFindItemsByValue.cs
│ │ ├── GDEFindItemsByValue2.cs
│ │ ├── GDEFloatCompare.cs
│ │ ├── GDEFloatOperator.cs
│ │ ├── GDEGetItemWithMatchingValues.cs
│ │ ├── GDEGetSchemaByItem.cs
│ │ ├── GDEHasFieldValueChanged.cs
│ │ ├── GDEHasItem.cs
│ │ ├── GDEHelpers.cs
│ │ ├── GDEIntCompare.cs
│ │ ├── GDEIntOperator.cs
│ │ ├── GDEListMultipleFieldValues.cs
│ │ ├── GDERemoveItem.cs
│ │ ├── GDERemoveString.cs
│ │ ├── GDEResetItem.cs
│ │ ├── GDESchemaGetNextItem.cs
│ │ ├── GDESwapFieldValues.cs
│ │ ├── GDESwapItems.cs
│ │ ├── GDEVector2Operator.cs
│ │ ├── GDEVector3Operator.cs
│ │ ├── GDEVector4Operator.cs
│ │ ├── Needs Re-Work
│ │ │ ├── Editor
│ │ │ │ └── GDECreateItemInspector.cs
│ │ │ ├── GDEFindItemByValue.cs
│ │ │ ├── GDEGetRandomItem.cs
│ │ │ ├── GDELoadAllItemsBySchema.cs
│ │ │ ├── GDELoadAllKeysBySchema.cs
│ │ │ ├── GDELoadSchemaList.cs
│ │ │ └── GDELoadStringListCustom.cs
│ │ └── README.MD
│ └── NGUI Customs
│ │ ├── NguiGetWidgetDetails.cs
│ │ ├── NguiLabelSetTextAdvanced.cs
│ │ ├── NguiSetSpriteMultiple.cs
│ │ ├── NguiSetSpriteSize.cs
│ │ ├── NguiSetWidgetAlphaMulti.cs
│ │ ├── NguiSetWidgetColor.cs
│ │ ├── NguiSetWidgetDetails.cs
│ │ ├── NguiSpriteIsVisible.cs
│ │ ├── NguiToolsAddChildAdvanced.cs
│ │ ├── NguiToolsDestroyMulti.cs
│ │ └── README.MD
└── uGUI Customs
│ ├── DebugVariableOnScreen.cs
│ ├── DrawFullscreenColorAdvanced.cs
│ └── README.MD
├── Editor Extensions
└── Editor
│ ├── CurrentSelectionMenu.cs
│ ├── CustomAssetImporter.cs
│ ├── README.MD
│ └── ToolsMenu
│ ├── README.MD
│ └── ToolsScenesMenu.cs
├── README.MD
├── Screenshots
├── Actions
│ ├── ActivateComponents.png
│ ├── ActivateGameObjects.png
│ ├── ActivateGameObjectsAdvanced.png
│ ├── ActivateMultipleComponents.png
│ ├── AndroidNativeAudioNonRedundantFile.png
│ ├── ArrayAddGameObjectIfEnabled.png
│ ├── ArrayAddIfEmpty.png
│ ├── ArrayGetRandomAdvanced.png
│ ├── ArrayIsEmpty.png
│ ├── ArrayListAddAll.png
│ ├── ArrayListContainsName.png
│ ├── ArrayListGetLength.png
│ ├── ArrayOperator.png
│ ├── BuildStringAutoConvert.png
│ ├── CompareColors.png
│ ├── ConvertIntToLetter.png
│ ├── CountupTimer.png
│ ├── DebugVariableOnScreen.png
│ ├── DestroyChildren.png
│ ├── DisableThisFSM.png
│ ├── DrawFullscreenColorAdvanced.png
│ ├── EaseInt.png
│ ├── EnableChildren.png
│ ├── EnableChildrenInRange.png
│ ├── EnableCollider.png
│ ├── EnableColliderMulti.png
│ ├── EnableFsms.png
│ ├── EnumGetRandom.png
│ ├── ExampleOverview.png
│ ├── FindAssetByName.png
│ ├── FindChildren.png
│ ├── FindClosestAgent.png
│ ├── FloatCompareRange.png
│ ├── FloatFlip.png
│ ├── FollowMouse2D.png
│ ├── GDEAddString.png
│ ├── GDEBoolFlip.png
│ ├── GDEBoolTest.png
│ ├── GDECountOccurrences.png
│ ├── GDECreateItem.png
│ ├── GDEFind.png
│ ├── GDEFindItemByValue.png
│ ├── GDEFindItemsByValue.png
│ ├── GDEFindItemsByValue2.png
│ ├── GDEFloatOperator.png
│ ├── GDEGetRandomItem.png
│ ├── GDEGetSchemaByItem.png
│ ├── GDEHasFieldValueChanged.png
│ ├── GDEHasItem.png
│ ├── GDEIntOperator.png
│ ├── GDELoadAllItemsBySchema.png
│ ├── GDELoadAllKeysBySchema.png
│ ├── GDELoadSchemaList.png
│ ├── GDELoadStringListCustom.png
│ ├── GDERemoveItem.png
│ ├── GDERemoveString.png
│ ├── GDESwapFieldValues.png
│ ├── GDESwapItems.png
│ ├── GDEVector2Operator.png
│ ├── GDEVector3Operator.png
│ ├── GDEVector4Operator.png
│ ├── GOCompareMulti.png
│ ├── GameObjectCompareMulti.png
│ ├── GameObjectIsVisibleAlternative.png
│ ├── GameObjectIsVisibleAlternative2D.png
│ ├── GameObjectKeepActive.png
│ ├── GetAudioClipLength.png
│ ├── GetAudioClipName.png
│ ├── GetAudioProgress.png
│ ├── GetChildCountAdvanced.png
│ ├── GetChildren.png
│ ├── GetDeviceLinearAcceleration.png
│ ├── GetDeviceRollCustom.png
│ ├── GetEnumAsArray.png
│ ├── GetFileExtension.png
│ ├── GetFsmComponent.png
│ ├── GetGameObjectByFsmVariableValue.png
│ ├── GetGameObjectScreenPosition.png
│ ├── GetGameObjectSibling.png
│ ├── GetGravity2dScale.png
│ ├── GetLastChild.png
│ ├── GetMultilevelGameObject.png
│ ├── GetObjectName.png
│ ├── GetPercentageInt.png
│ ├── GetPositionAddOffset.png
│ ├── GetRotationAddOffset.png
│ ├── GetRuntimeAnimatorController.png
│ ├── GetScaleAddOffset.png
│ ├── GetStringNumbers.png
│ ├── GetTimeScale.png
│ ├── GetUnsignedFloat.png
│ ├── GetUnsignedInt.png
│ ├── HasSibling.png
│ ├── IntCompareRange.png
│ ├── IntFlip.png
│ ├── IntRoundToNearest.png
│ ├── IntSignTest.png
│ ├── IntSwitchAdvanced.png
│ ├── IntSwitchAudioClip.png
│ ├── IsOnPlatformEvent.png
│ ├── ListGameObjectsInsideCollider.png
│ ├── ListGameObjectsInsideCollider2D.png
│ ├── NavMeshAgentGetAcceleration.png
│ ├── NavMeshAgentGetAngularSpeed.png
│ ├── NavMeshAgentGetAreaMask.png
│ ├── NavMeshAgentGetAutoBraking.png
│ ├── NavMeshAgentGetAutoRepath.png
│ ├── NavMeshAgentGetAutoTraverseOffMeshLink.png
│ ├── NavMeshAgentGetAvoidancePriority.png
│ ├── NavMeshAgentGetBaseOffset.png
│ ├── NavMeshAgentGetHeight.png
│ ├── NavMeshAgentGetNextPosition.png
│ ├── NavMeshAgentGetPathEndPosition.png
│ ├── NavMeshAgentGetPathStatus.png
│ ├── NavMeshAgentGetRemainingDistance.png
│ ├── NavMeshAgentGetSpeed.png
│ ├── NavMeshAgentGetStoppingDistance.png
│ ├── NavMeshAgentGetVelocity.png
│ ├── NavMeshAgentHasPath.png
│ ├── NavMeshAgentIsOnNavMesh.png
│ ├── NavMeshAgentIsOnOffMeshLink.png
│ ├── NavMeshAgentIsPathPending.png
│ ├── NavMeshAgentMoveTo.png
│ ├── NavMeshAgentPause.png
│ ├── NavMeshAgentResetPath.png
│ ├── NavMeshAgentResume.png
│ ├── NavMeshAgentSetAcceleration.png
│ ├── NavMeshAgentSetAngularSpeed.png
│ ├── NavMeshAgentSetAutoBraking.png
│ ├── NavMeshAgentSetAutoRepath.png
│ ├── NavMeshAgentSetAutoTraverseOffMeshLink.png
│ ├── NavMeshAgentSetAvoidancePriority.png
│ ├── NavMeshAgentSetBaseOffset.png
│ ├── NavMeshAgentSetHeight.png
│ ├── NavMeshAgentSetSpeed.png
│ ├── NavMeshAgentSetVelocity.png
│ ├── NavMeshAgentWarp.png
│ ├── NavMeshFindClosestPoint.png
│ ├── NguiGetWidgetDetails.png
│ ├── NguiLabelSetTextAdvanced.png
│ ├── NguiSetSpriteMultiple.png
│ ├── NguiSetSpriteSize.png
│ ├── NguiSetWidgetAlphaMulti.png
│ ├── NguiSetWidgetColor.png
│ ├── NguiSetWidgetDetails.png
│ ├── NguiSpriteIsVisible.png
│ ├── NguiToolsAddChildAdvanced.png
│ ├── NguiToolsDestroyMulti.png
│ ├── RandomCharacters.png
│ ├── RandomFloatAroundRange.png
│ ├── RandomFloatOnSlope.png
│ ├── RandomIntAroundRange.png
│ ├── RandomPointBetweenGameObjects.png
│ ├── RandomPointOnSlope.png
│ ├── RandomWaitAroundOffset.png
│ ├── RandomWaitCustom.png
│ ├── RandomWeightedEnum.png
│ ├── RandomWeightedVector3.png
│ ├── ResetTransforms.png
│ ├── RestartThisFSM.png
│ ├── SelectRandomAudioClip.png
│ ├── SelectRandomObject.png
│ ├── SendEventMulti.png
│ ├── SendEventRandomDelay.png
│ ├── SendEventSetMulti.png
│ ├── SendEventSetValue.png
│ ├── SendEvents.png
│ ├── SendRandomEvent.png
│ ├── SetGameObjectIfNotNull.png
│ ├── SetPositions.png
│ ├── SetPropertyAdvanced.png
│ ├── SetRuntimeAnimatorController.png
│ ├── SpriteGetName.png
│ ├── StringAppend.png
│ ├── StringCompareSetMulti.png
│ ├── StringContainsSwitch.png
│ ├── StringRemove.png
│ ├── StringRemoveChars.png
│ ├── StringReplaceEachChar.png
│ ├── StringSwitchCustom.png
│ ├── SwipeGestureEventAdvanced.png
│ ├── Template.png
│ ├── TemplateAdvanced.png
│ ├── ToggleComponent.png
│ ├── ToggleGameObject.png
│ ├── Vector2OperatorAdvanced.png
│ ├── Vector3Compare.png
│ └── Vector3OperatorAdvanced.png
├── Components
│ ├── Comment.png
│ ├── DebugFSM.png
│ ├── DebugSpeed.png
│ ├── DisableOnAwake.png
│ ├── DontDestroyDeleteDuplicates.png
│ ├── FPSCounter.png
│ ├── FollowMouseMovement.png
│ ├── GDEInit.png
│ ├── NGUIEffects1.png
│ ├── RemoveAtRuntime.png
│ ├── SendEventToFSM.png
│ ├── SendEventToFSM2.png
│ ├── SendEventToFSMAdvanced.png
│ ├── SendEventToFSMAdvanced_OLD.png
│ ├── SetGravityClamped.png
│ ├── SetNGUILabel.png
│ └── TextureScrolling.png
└── Editor
│ ├── CurrentSelectionMenu.png
│ └── ToolsScenesMenu.png
├── _config.yml
└── index.md
/.gitattributes:
--------------------------------------------------------------------------------
1 | # Auto detect text files and perform LF normalization
2 | * text=auto
--------------------------------------------------------------------------------
/.gitignore:
--------------------------------------------------------------------------------
1 | **.meta
2 | **.cs~
3 | .idea
--------------------------------------------------------------------------------
/Components/Comment.cs:
--------------------------------------------------------------------------------
1 | using System.Collections;
2 | using UnityEngine;
3 |
4 | public class Comment : MonoBehaviour {
5 |
6 | //the main comment
7 | public string text;
8 |
9 | public bool displayOnScreen = false;
10 | public Color textColor = Color.cyan;
11 | public Vector2 offset;
12 |
13 | public bool debug = false;
14 | public bool removeAtRuntime = false;
15 |
16 | void OnGUI() {
17 | if (displayOnScreen)
18 | {
19 | GUI.color = textColor;
20 | Vector2 ownerPos = Camera.main.WorldToScreenPoint(transform.position);
21 | ownerPos.y = Screen.height - ownerPos.y;
22 | var textSize = GUI.skin.label.CalcSize(new GUIContent(text));
23 | GUI.Label(new Rect(ownerPos.x + offset.x, ownerPos.y - offset.y, textSize.x, textSize.y), text);
24 | }
25 | }
26 |
27 | void Start ()
28 | {
29 | if (debug) Debug.Log(text);
30 | if (removeAtRuntime) Destroy(this);
31 | }
32 |
33 | }
34 |
--------------------------------------------------------------------------------
/Components/DisableOnAwake.cs:
--------------------------------------------------------------------------------
1 | using UnityEngine;
2 |
3 | ///
4 | /// Disables every GameObject tagged as "RemoveAtRuntime" (tag has to be created if it doesn't exist)
5 | ///
6 | public class DisableOnAwake : MonoBehaviour
7 | {
8 | void Awake()
9 | {
10 | GameObject[] allTaggedGOs = GameObject.FindGameObjectsWithTag("RemoveAtRuntime");
11 |
12 | if(allTaggedGOs.Length == 0)
13 | {
14 | return;
15 | }
16 |
17 | foreach(GameObject go in allTaggedGOs)
18 | {
19 | if(go != null)
20 | {
21 | go.SetActive(false);
22 | }
23 | }
24 | }
25 | }
26 |
--------------------------------------------------------------------------------
/Components/DontDestroyDeleteDuplicates.cs:
--------------------------------------------------------------------------------
1 | using UnityEngine;
2 |
3 | ///
4 | /// Sets the GameObject this component is attached to to not be destroyed
5 | /// on scene load and removes duplicates when re-visiting scenes.
6 | ///
7 | public class DontDestroyDeleteDuplicates : MonoBehaviour
8 | {
9 | private void Awake()
10 | {
11 | if (GameObject.Find(gameObject.name)
12 | && GameObject.Find(gameObject.name) != this.gameObject)
13 | {
14 | Destroy(GameObject.Find(gameObject.name));
15 | }
16 | }
17 |
18 | private void Start()
19 | {
20 | DontDestroyOnLoad(gameObject);
21 | }
22 |
23 | }
24 |
--------------------------------------------------------------------------------
/Components/FPSCounter.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using UnityEngine;
3 | using UnityEngine.UI;
4 |
5 | public class FPSCounter : MonoBehaviour
6 | {
7 | public Color _color = new Color32(1, 35, 56, 255);
8 | public Vector2 _position = new Vector2(17, 11);
9 | public Vector2 _size = new Vector2(100, 20);
10 |
11 | const float fpsMeasurePeriod = 0.5f;
12 | private int m_FpsAccumulator = 0;
13 | private float m_FpsNextPeriod = 0;
14 | private int m_CurrentFps;
15 | const string display = "{0} FPS";
16 | private string fps = "";
17 |
18 | void OnGUI()
19 | {
20 | GUI.color = _color;
21 | GUI.Label(new Rect(_position.x, _position.y, _size.x, _size.y), fps);
22 | }
23 |
24 | private void Start()
25 | {
26 | m_FpsNextPeriod = Time.realtimeSinceStartup + fpsMeasurePeriod;
27 | }
28 |
29 |
30 | void Update()
31 | {
32 | // measure average frames per second
33 | m_FpsAccumulator++;
34 | if(Time.realtimeSinceStartup > m_FpsNextPeriod)
35 | {
36 | m_CurrentFps = (int)(m_FpsAccumulator / fpsMeasurePeriod);
37 | m_FpsAccumulator = 0;
38 | m_FpsNextPeriod += fpsMeasurePeriod;
39 | fps = string.Format(display, m_CurrentFps);
40 | }
41 | }
42 | }
--------------------------------------------------------------------------------
/Components/FollowMouseMovement.cs:
--------------------------------------------------------------------------------
1 | using UnityEngine;
2 |
3 | ///
4 | /// When enabled, the GameObject this script is attached to follows the movement of the mouse-/touch-position in 2D space.
5 | ///
6 | public class FollowMouseMovement : MonoBehaviour {
7 |
8 | [Tooltip("If not set, uses the GameObject tagged 'MainCamera'. When using custom GUI systems like NGUI, you should insert its own camera.")]
9 | public Camera cam;
10 | [Tooltip("How much delay between the current mouse position and the position of the GameObject should be added. " +
11 | "The higher the value, the closer the GameObject follows the mouse position.")]
12 | [Range(0.01f, 1f)]
13 | public float smoothing = 1f;
14 | [Tooltip("Whether to use the world or local space of the GameObject.")]
15 | public bool worldSpace = true;
16 | [Tooltip("if set, disable this component immediately to manually activate it at a later point.")]
17 | public bool startDisabled = true;
18 |
19 | void Awake()
20 | {
21 | if(startDisabled) enabled = false;
22 | }
23 |
24 | void Start()
25 | {
26 | if(cam == null) cam = Camera.main;
27 | }
28 |
29 | void Update()
30 | {
31 | if (cam == null)
32 | {
33 | Debug.LogError("No camera set in FollowMouseMovement on " + name);
34 | return;
35 | }
36 |
37 | Vector3 currPos = worldSpace ? gameObject.transform.position : transform.localPosition;
38 | Vector3 result = Vector3.Lerp(currPos, cam.ScreenToWorldPoint(Input.mousePosition), smoothing);
39 |
40 | if (worldSpace) gameObject.transform.position = result;
41 | else gameObject.transform.localPosition = result;
42 | }
43 | }
--------------------------------------------------------------------------------
/Components/Physics related/README.MD:
--------------------------------------------------------------------------------
1 | ## DebugSpeed.cs
2 | 
3 |
4 | - Shows valuable information of the current GameObject on screen like Acceleration, Velocity, and modifications of them (the square Magnitude and them normalized)
5 |
6 | ## SetGravityClamped.cs
7 | 
8 |
9 | - Adds a downward force to the GameObject, optionally change the Force Mode and clamp the max velocity
--------------------------------------------------------------------------------
/Components/Physics related/SetGravityClamped.cs:
--------------------------------------------------------------------------------
1 | using UnityEngine;
2 |
3 | [RequireComponent(typeof(Rigidbody))]
4 | public class SetGravityClamped : MonoBehaviour
5 | {
6 |
7 | public float maxVelocity = 10;
8 | public ForceMode forceMode = ForceMode.Acceleration;
9 |
10 | private Rigidbody ownRigidbody;
11 |
12 | void Start()
13 | {
14 | ownRigidbody = this.gameObject.GetComponent();
15 | }
16 |
17 | // Update is called once per frame
18 | void FixedUpdate()
19 | {
20 | if (ownRigidbody.velocity.sqrMagnitude < maxVelocity)
21 | {
22 | ownRigidbody.AddForce(Physics.gravity, forceMode);
23 | }
24 | }
25 | }
26 |
--------------------------------------------------------------------------------
/Components/PlayMaker Extension/DebugFSM/Editor/DebugFSMInspector.cs:
--------------------------------------------------------------------------------
1 |
2 | using UnityEditor;
3 | using UnityEngine;
4 |
5 | [CanEditMultipleObjects]
6 | [CustomEditor(typeof(DebugFSM))]
7 | public class DebugFSMInspector : Editor
8 | {
9 | private static GUIStyle ToggleButtonStyleNormal = null;
10 | private static GUIStyle ToggleButtonStyleToggled = null;
11 |
12 | public override void OnInspectorGUI()
13 | {
14 | DebugFSM script = (DebugFSM)this.target;
15 |
16 | ToggleButtonStyleNormal = "Button";
17 | ToggleButtonStyleToggled = new GUIStyle(ToggleButtonStyleNormal);
18 | ToggleButtonStyleToggled.normal.background = ToggleButtonStyleToggled.active.background;
19 |
20 | GUILayout.BeginHorizontal();
21 | if(GUILayout.Button("States", script.debugStateNames ? ToggleButtonStyleToggled : ToggleButtonStyleNormal))
22 | {
23 | script.debugStateNames = true;
24 | script.debugVariables = false;
25 | }
26 |
27 | if(GUILayout.Button("Variables", script.debugVariables ? ToggleButtonStyleToggled : ToggleButtonStyleNormal))
28 | {
29 | script.debugStateNames = false;
30 | script.debugVariables = true;
31 | }
32 | GUILayout.EndHorizontal();
33 |
34 | if(script.debugStateNames)
35 | {
36 | //limit traceBackAmount to always be above 0
37 | if(script.traceBackAmount < 0)
38 | {
39 | script.traceBackAmount = 0;
40 | }
41 | script.traceBackAmount = EditorGUILayout.IntField("Trace-Back Amount", script.traceBackAmount);
42 | } else if(script.debugVariables)
43 | {
44 | script.startFrom = EditorGUILayout.IntField("Start From Variable #", script.startFrom);
45 | }
46 |
47 | EditorGUILayout.Separator();
48 | EditorGUILayout.Separator();
49 |
50 | base.DrawDefaultInspector();
51 | }
52 | }
53 |
--------------------------------------------------------------------------------
/Components/PlayMaker Extension/DebugFSM/README.MD:
--------------------------------------------------------------------------------
1 | ## DebugFSM.cs
2 | 
3 |
4 | Useful for debugging FSM related information at runtime.
5 |
6 | Divided into two separate modes:
7 | States - Shows the active state and as many of the previous states as selected. Also show, how long it was in the previous state.
8 | Variables - Displays all available variables and their live-action values
9 |
10 | Most options change how and where the information is displayed.
11 | It's also possible to debug both modes on the same GameObject by using this component twice.
--------------------------------------------------------------------------------
/Components/RemoveAtRuntime.cs:
--------------------------------------------------------------------------------
1 | using UnityEngine;
2 |
3 | ///
4 | /// Removes the GameObject this is attached to immediately
5 | /// on scene load without letting it execute anything.
6 | /// Useful to remove GOs that are used for debugging at
7 | /// runtime or in build.
8 | /// Optionally remove all GOs which name contains "OBSOLETE"
9 | /// (best to only use one of this component per scene or on
10 | /// a GameObject that's persistent throughout all scenes).
11 | ///
12 | public class RemoveAtRuntime : MonoBehaviour
13 | {
14 | public bool removeOBSOLETE = false;
15 |
16 | void Awake()
17 | {
18 | if(!removeOBSOLETE)
19 | {
20 | Destroy(this.gameObject);
21 | } else
22 | {
23 | foreach(var currentGO in GameObject.FindObjectsOfType(typeof(GameObject)))
24 | {
25 | if(currentGO.name.Contains("OBSOLETE"))
26 | {
27 | Destroy(currentGO);
28 | }
29 | }
30 | }
31 | }
32 | }
33 |
--------------------------------------------------------------------------------
/Components/TextureScrolling.cs:
--------------------------------------------------------------------------------
1 | using UnityEngine;
2 | [RequireComponent(typeof(Renderer))]
3 | public class TextureScrolling : MonoBehaviour
4 | {
5 |
6 | public enum UpdateType
7 | {
8 | Update,
9 | LateUpdate,
10 | FixedUpdate
11 | }
12 |
13 | public float scrollSpeed = 0.5f;
14 | public bool horizontal = true;
15 | public bool vertical = false;
16 | public UpdateType updateType = UpdateType.Update;
17 | public bool ignoreTimeScale = true;
18 |
19 | private Renderer _renderer;
20 | private float scrollUpdate;
21 | private Vector2 currentOffset;
22 | private float usedTime;
23 |
24 | void Start()
25 | {
26 | _renderer = GetComponent();
27 | }
28 |
29 | void Update()
30 | {
31 | if(updateType == UpdateType.Update)
32 | {
33 | DoScroll();
34 | }
35 | }
36 |
37 | void LateUpdate()
38 | {
39 | if(updateType == UpdateType.LateUpdate)
40 | {
41 | DoScroll();
42 | }
43 | }
44 |
45 | void FixedUpdate()
46 | {
47 | if(updateType == UpdateType.FixedUpdate)
48 | {
49 | DoScroll();
50 | }
51 | }
52 |
53 | public void DoScroll()
54 | {
55 | if(ignoreTimeScale)
56 | {
57 | if(Time.inFixedTimeStep)
58 | {
59 | usedTime = Time.fixedUnscaledTime;
60 | } else
61 | {
62 | usedTime = Time.unscaledTime;
63 | }
64 | } else
65 | {
66 | usedTime = Time.time;
67 | }
68 |
69 | scrollUpdate = usedTime * scrollSpeed;
70 |
71 | if(horizontal == true && vertical == false)
72 | {
73 | currentOffset = new Vector2(scrollUpdate, 0);
74 | } else if(horizontal == true && vertical == true)
75 | {
76 | currentOffset = new Vector2(scrollUpdate, scrollUpdate);
77 | } else if(horizontal == false && vertical == true)
78 | {
79 | currentOffset = new Vector2(0, scrollUpdate);
80 | } else if(horizontal == false && vertical == false)
81 | {
82 | currentOffset = new Vector2(0, 0);
83 | }
84 |
85 | var allMaterials = _renderer.materials;
86 | foreach(var currentMaterial in allMaterials)
87 | {
88 | currentMaterial.mainTextureOffset = currentOffset;
89 | }
90 | }
91 | }
92 |
--------------------------------------------------------------------------------
/Components/_Third Party/GDE/GDEInit.cs:
--------------------------------------------------------------------------------
1 | using UnityEngine;
2 | using GameDataEditor;
3 |
4 | #if GDE_PLAYMAKER_SUPPORT
5 |
6 | public class GDEInit : MonoBehaviour
7 | {
8 | public string GDEDataFileName;
9 |
10 | public bool Encrypted;
11 |
12 | void Reset()
13 | {
14 | GDEDataFileName = null;
15 | }
16 |
17 | void Awake()
18 | {
19 | try
20 | {
21 | if (!GDEDataManager.Init(GDEDataFileName, Encrypted))
22 | UnityEngine.Debug.LogError(GDMConstants.ErrorNotInitialized + " " + GDEDataFileName);
23 | }
24 | catch(UnityException ex)
25 | {
26 | UnityEngine.Debug.LogError(ex.ToString());
27 | }
28 | }
29 | }
30 |
31 | #endif
32 |
--------------------------------------------------------------------------------
/Components/_Third Party/GDE/README.MD:
--------------------------------------------------------------------------------
1 | ## GDEInit.cs
2 | 
3 |
4 | Initializes the GDEItemManager on Awake(). Best kept on a persistent GameObject in your first scene.
--------------------------------------------------------------------------------
/Custom PlayMaker Actions/AnimatedVariables Customs/README.md:
--------------------------------------------------------------------------------
1 | ## EaseInt.cs
2 | 
--------------------------------------------------------------------------------
/Custom PlayMaker Actions/Animator Customs/GetRuntimeAnimatorController.cs:
--------------------------------------------------------------------------------
1 | // License: Attribution 4.0 International (CC BY 4.0)
2 | /*--- __ECO__ __PLAYMAKER__ __ACTION__ ---*/
3 | //Author: Deek
4 |
5 | using UnityEngine;
6 |
7 | namespace HutongGames.PlayMaker.Actions
8 | {
9 | [ActionCategory(ActionCategory.Animator)]
10 | [HelpUrl("http://hutonggames.com/playmakerforum/index.php?topic=15458.0")]
11 | [Tooltip("Get the runtimeAnimatorController of an Animator Component.")]
12 | public class GetRuntimeAnimatorController : FsmStateAction
13 | {
14 | [RequiredField]
15 | [CheckForComponent(typeof(Animator))]
16 | [Tooltip("The target. An Animator component is required")]
17 | public FsmOwnerDefault gameObject;
18 |
19 | [RequiredField]
20 | [UIHint(UIHint.Variable)]
21 | [ObjectType(typeof(RuntimeAnimatorController))]
22 | [Tooltip("The current controller of the specified Animator.")]
23 | public FsmObject getController;
24 |
25 | [Tooltip("Repeat every frame. Useful when using normalizedTime to manually control the animation.")]
26 | public bool everyFrame;
27 |
28 | Animator _animator;
29 |
30 | public override void Reset()
31 | {
32 | gameObject = null;
33 | getController = null;
34 | everyFrame = false;
35 | }
36 |
37 | public override void OnEnter()
38 | {
39 | // get the animator component
40 | var go = Fsm.GetOwnerDefaultTarget(gameObject);
41 |
42 | if(go == null)
43 | {
44 | Finish();
45 | return;
46 | }
47 |
48 | _animator = go.GetComponent();
49 |
50 | DoAnimatorPlay();
51 | if(!everyFrame)
52 | {
53 | Finish();
54 | }
55 | }
56 |
57 | public override void OnUpdate()
58 | {
59 | DoAnimatorPlay();
60 | }
61 |
62 | void DoAnimatorPlay()
63 | {
64 | if(_animator != null)
65 | {
66 | getController.Value = _animator.runtimeAnimatorController;
67 |
68 | if(getController.Value == null)
69 | {
70 | LogWarning("Animator " + _animator.name + " doesn't have a runtimeAnimatorController!");
71 | }
72 | }
73 | }
74 | }
75 | }
--------------------------------------------------------------------------------
/Custom PlayMaker Actions/Animator Customs/README.MD:
--------------------------------------------------------------------------------
1 | ## GetRuntimeAnimatorController.cs
2 | 
3 |
4 | ## SetRuntimeAnimatorController.cs
5 | 
6 |
--------------------------------------------------------------------------------
/Custom PlayMaker Actions/Application Customs/README.MD:
--------------------------------------------------------------------------------
1 | ## IsOnPlatformEvent.cs
2 | 
--------------------------------------------------------------------------------
/Custom PlayMaker Actions/Array Customs/ArrayAddIfEmpty.cs:
--------------------------------------------------------------------------------
1 | //License: Attribution 4.0 International (CC BY 4.0)
2 | //Author: Deek
3 |
4 | /*--- __ECO__ __PLAYMAKER__ __ACTION__ ---*/
5 |
6 | namespace HutongGames.PlayMaker.Actions
7 | {
8 | [ActionCategory(ActionCategory.Array)]
9 | [HelpUrl("http://hutonggames.com/playmakerforum/index.php?topic=15458.0")]
10 | [Tooltip("Add an item to the end of an Array if it's null or empty. Optionally reverse the check.")]
11 | public class ArrayAddIfEmpty : FsmStateAction
12 | {
13 | [RequiredField]
14 | [UIHint(UIHint.Variable)]
15 | [Tooltip("The Array Variable to use.")]
16 | public FsmArray array;
17 |
18 | [RequiredField]
19 | [MatchElementType("array")]
20 | [Tooltip("Item to add.")]
21 | public FsmVar value;
22 |
23 | [Tooltip("Adds if empty, otherwise if not empty.")]
24 | public FsmBool ifEmpty;
25 |
26 | public override void Reset()
27 | {
28 | array = null;
29 | value = null;
30 | ifEmpty = true;
31 | }
32 |
33 | public override void OnEnter()
34 | {
35 | if(ifEmpty.Value)
36 | {
37 | if(value.IsNone && value.GetValue() == null) DoAddValue();
38 | } else
39 | {
40 | if(!value.IsNone && value.GetValue() != null) DoAddValue();
41 | }
42 |
43 | Finish();
44 | }
45 |
46 | private void DoAddValue()
47 | {
48 | //incorporate the check for empty or not empty if the value is of type string
49 | if(value.Type == VariableType.String)
50 | {
51 | if(ifEmpty.Value)
52 | {
53 | if(!string.IsNullOrEmpty(value.stringValue)) return;
54 | } else
55 | {
56 | if(string.IsNullOrEmpty(value.stringValue)) return;
57 | }
58 | }
59 |
60 | array.Resize(array.Length + 1);
61 | value.UpdateValue();
62 | array.Set(array.Length - 1, value.GetValue());
63 | }
64 | }
65 | }
66 |
67 |
--------------------------------------------------------------------------------
/Custom PlayMaker Actions/Array Customs/ArrayGetRandomAdvanced.cs:
--------------------------------------------------------------------------------
1 | // (c) Copyright HutongGames, LLC 2010-2013. All rights reserved.
2 | //License: Attribution 4.0 International (CC BY 4.0)
3 | //Author: Deek
4 |
5 | /*--- __ECO__ __PLAYMAKER__ __ACTION__ ---*/
6 |
7 | using UnityEngine;
8 |
9 | namespace HutongGames.PlayMaker.Actions
10 | {
11 | [ActionCategory(ActionCategory.Array)]
12 | [Tooltip("Get a Random item from an Array. Optionally disallow to get the same result twice in a row.")]
13 | public class ArrayGetRandomAdvanced : FsmStateAction
14 | {
15 | [RequiredField]
16 | [UIHint(UIHint.Variable)]
17 | [Tooltip("The Array to use.")]
18 | public FsmArray array;
19 |
20 | [RequiredField]
21 | [UIHint(UIHint.Variable)]
22 | [Tooltip("Store the value in a variable.")]
23 | [MatchElementType("array")]
24 | public FsmVar storeValue;
25 |
26 | [Tooltip("Can return the same item twice in a row.")]
27 | public FsmBool repeat;
28 |
29 | [Tooltip("Repeat every frame while the state is active.")]
30 | public bool everyFrame;
31 |
32 | int prevItem;
33 |
34 | public override void Reset()
35 | {
36 | array = null;
37 | storeValue = null;
38 | repeat = false;
39 | everyFrame = false;
40 | }
41 |
42 | // Code that runs on entering the state.
43 | public override void OnEnter()
44 | {
45 | DoGetRandomValue();
46 |
47 | if(!everyFrame) Finish();
48 |
49 | }
50 |
51 | public override void OnUpdate()
52 | {
53 | DoGetRandomValue();
54 |
55 | }
56 |
57 | private void DoGetRandomValue()
58 | {
59 | if(storeValue.IsNone) return;
60 |
61 | int currItem = Random.Range(0, array.Length);
62 |
63 | if(!repeat.Value)
64 | {
65 | while(currItem == prevItem)
66 | {
67 | currItem = Random.Range(0, array.Length);
68 | }
69 | }
70 |
71 | storeValue.SetValue(array.Get(currItem));
72 | prevItem = currItem;
73 | }
74 |
75 |
76 | }
77 | }
78 |
79 |
--------------------------------------------------------------------------------
/Custom PlayMaker Actions/Array Customs/ArrayIsEmpty.cs:
--------------------------------------------------------------------------------
1 | //License: Attribution 4.0 International (CC BY 4.0)
2 | //Author: Deek
3 |
4 | /*--- __ECO__ __PLAYMAKER__ __ACTION__ ---*/
5 |
6 | namespace HutongGames.PlayMaker.Actions
7 | {
8 | [ActionCategory(ActionCategory.Array)]
9 | [Tooltip("Send an event based on the length of an array.")]
10 | public class ArrayIsEmpty : FsmStateAction
11 | {
12 | [UIHint(UIHint.Variable)]
13 | [Tooltip("The Array Variable.")]
14 | public FsmArray array;
15 |
16 | [Tooltip("Event to send if the array is empty.")]
17 | public FsmEvent isEmpty;
18 |
19 | [Tooltip("Event to send if the array not is empty.")]
20 | public FsmEvent isNotEmpty;
21 |
22 | public override void Reset()
23 | {
24 | array = null;
25 | }
26 |
27 | public override void OnEnter()
28 | {
29 | Fsm.Event(array.Length == 0 ? isEmpty : isNotEmpty);
30 | Finish();
31 | }
32 | }
33 | }
--------------------------------------------------------------------------------
/Custom PlayMaker Actions/Array Customs/README.MD:
--------------------------------------------------------------------------------
1 | ## ArrayAddGameObjectIfEnabled.cs
2 | 
3 |
4 | ## ArrayAddIfEmpty.cs
5 | 
6 |
7 | ## ArrayGetRandomAdvanced.cs
8 | 
9 |
10 | ## ArrayIsEmpty.cs
11 | 
12 |
13 | ## ArrayOperator.cs
14 | 
--------------------------------------------------------------------------------
/Custom PlayMaker Actions/Array Lists & Hash Table Customs/ArrayListAddAll.cs:
--------------------------------------------------------------------------------
1 | // License: Attribution 4.0 International (CC BY 4.0)
2 | /*--- __ECO__ __PLAYMAKER__ __ACTION__ ---*/
3 | //Author: Deek
4 |
5 | using UnityEngine;
6 |
7 | namespace HutongGames.PlayMaker.Actions
8 | {
9 | [ActionCategory("ArrayMaker/ArrayList")]
10 | [Tooltip("Add all items from an FsmArray to a PlayMaker Array List Proxy component")]
11 | public class ArrayListAddAll : ArrayListActions
12 | {
13 | [RequiredField]
14 | [UIHint(UIHint.Variable)]
15 | [Tooltip("The FsmArray to add to the ArrayList proxy.")]
16 | public FsmArray array;
17 |
18 | [RequiredField]
19 | [Tooltip("The gameObject with the PlayMaker ArrayList Proxy component")]
20 | [CheckForComponent(typeof(PlayMakerArrayListProxy))]
21 | public FsmOwnerDefault gameObject;
22 |
23 | [Tooltip("Author defined Reference of the PlayMaker ArrayList Proxy component (necessary if several component coexists on the same GameObject)")]
24 | [UIHint(UIHint.FsmString)]
25 | public FsmString reference;
26 |
27 | public FsmEvent successEvent;
28 | public FsmEvent failureEvent;
29 |
30 | public override void Reset()
31 | {
32 | array = null;
33 | gameObject = null;
34 | reference = null;
35 | successEvent = null;
36 | failureEvent = null;
37 | }
38 |
39 | public override void OnEnter()
40 | {
41 | if(!SetUpArrayListProxyPointer(Fsm.GetOwnerDefaultTarget(gameObject), reference.Value))
42 | {
43 | Debug.LogWarning("Couldn't find the Array List Proxy Component!");
44 | Fsm.Event(failureEvent);
45 | Finish();
46 | }
47 |
48 | proxy.AddRange(array.Values, array.ObjectTypeName);
49 |
50 | Fsm.Event(successEvent);
51 | Finish();
52 | }
53 | }
54 | }
--------------------------------------------------------------------------------
/Custom PlayMaker Actions/Array Lists & Hash Table Customs/ArrayListGetLength.cs:
--------------------------------------------------------------------------------
1 | //License: Attribution 4.0 International (CC BY 4.0)
2 | /*--- __ECO__ __PLAYMAKER__ __ACTION__ ---*/
3 | //Author: Deek
4 |
5 | using UnityEngine;
6 |
7 | namespace HutongGames.PlayMaker.Actions
8 | {
9 | [ActionCategory("ArrayMaker/ArrayList")]
10 | [HelpUrl("http://hutonggames.com/playmakerforum/index.php?topic=15458.0")]
11 | [Tooltip("Returns the length of the specified Array List Proxy Component.")]
12 | public class ArrayListGetLength : ArrayListActions
13 | {
14 | [ActionSection("Set up")]
15 |
16 | [RequiredField]
17 | [Tooltip("The gameObject with the PlayMaker ArrayList Proxy component")]
18 | [CheckForComponent(typeof(PlayMakerArrayListProxy))]
19 | public FsmOwnerDefault gameObject;
20 |
21 | [Tooltip("Author defined Reference of the PlayMaker ArrayList Proxy component ( necessary if several component coexists on the same GameObject")]
22 | public FsmString reference;
23 |
24 | [ActionSection("Result")]
25 |
26 | [RequiredField]
27 | [UIHint(UIHint.Variable)]
28 | public FsmInt length;
29 |
30 | [Tooltip("Subtract 1 from the length to get the index of the last element. Otherwise you get the actual length of the ArrayList wich can lead to IndexOutOfRange Exceptions.")]
31 | public bool subtract1;
32 |
33 | public override void Reset()
34 | {
35 | gameObject = null;
36 | reference = null;
37 | length = null;
38 | subtract1 = true;
39 | }
40 |
41 | public override void OnEnter()
42 | {
43 |
44 | if(!SetUpArrayListProxyPointer(Fsm.GetOwnerDefaultTarget(gameObject), reference.Value))
45 | {
46 | Debug.LogWarning("Couldn't find the Array List Proxy Component!");
47 | Finish();
48 | }
49 |
50 | length.Value = proxy.arrayList.Count;
51 |
52 | if(subtract1) length.Value -= 1;
53 |
54 | Finish();
55 | }
56 | }
57 | }
58 |
--------------------------------------------------------------------------------
/Custom PlayMaker Actions/Array Lists & Hash Table Customs/README.MD:
--------------------------------------------------------------------------------
1 | ## ArrayListContainsName.cs
2 | 
3 |
4 | ## ArrayListGetLength.cs
5 | 
6 |
7 | ## ListGameObjectsInsideCollider.cs
8 | 
9 |
10 | ## ListGameObjectsInsideCollider2D.cs
11 | 
--------------------------------------------------------------------------------
/Custom PlayMaker Actions/Audio Customs/Editor/GetAudioClipName.cs:
--------------------------------------------------------------------------------
1 |
2 | using System.IO;
3 | using UnityEngine;
4 | using UnityEditor;
5 | using System;
6 |
7 | namespace HutongGames.PlayMaker.Actions
8 | {
9 | [ActionCategory(ActionCategory.Audio)]
10 | [HelpUrl("http://hutonggames.com/playmakerforum/index.php?topic=15458.0")]
11 | [Tooltip("Returns the Name of the provided AudioClip. Optionally includes the extension.")]
12 | public class GetAudioClipName : FsmStateAction
13 | {
14 | [ObjectType(typeof(AudioClip))]
15 | [Tooltip("The AudioClip to get the name of.")]
16 | public FsmObject audioClip;
17 |
18 | [Tooltip("The retrieved String-Variable.")]
19 | public FsmString audioClipName;
20 |
21 | [Tooltip("If it should include the file extension. (e.g. foo.wav instead of foo)")]
22 | public bool includeFileExtension;
23 |
24 | [Tooltip("Required for the extension: Set the path the file is at, starting after Assets (/Some/File/At/foo.extension). Otherwise uses 'AssetDatabase', wich doesn't work outside of the Editor (not in any build nor on any platform)")]
25 | public FsmString atPath;
26 |
27 | public override void Reset()
28 | {
29 | audioClip = null;
30 | includeFileExtension = true;
31 | atPath = null;
32 | }
33 |
34 | public override void OnEnter()
35 | {
36 | //Get the File-Name and trim the ObjectType at the end
37 | audioClipName = audioClip.ToString().TrimEnd(" (UnityEngine.AudioClip)".ToCharArray());
38 | if(includeFileExtension)
39 | {
40 | //Get Extension from Path starting after "Assets" and save it in a String
41 | String extension = "";
42 | if(atPath.Value != null && atPath.Value != "")
43 | {
44 | extension = Path.GetExtension(atPath.Value);
45 | } else
46 | {
47 | extension = Path.GetExtension(AssetDatabase.GetAssetPath(assetObject: audioClip.Value).ToString().TrimStart("Assets".ToCharArray()));
48 | }
49 |
50 | //Combine AudioClip-Name with the File-Extension
51 | audioClipName = String.Concat(audioClipName, extension);
52 | }
53 | Finish();
54 | }
55 | }
56 | }
57 |
--------------------------------------------------------------------------------
/Custom PlayMaker Actions/Audio Customs/Editor/README.MD:
--------------------------------------------------------------------------------
1 | ## GetAudioClipName.cs
2 | 
3 |
--------------------------------------------------------------------------------
/Custom PlayMaker Actions/Audio Customs/GetAudioClipLength.cs:
--------------------------------------------------------------------------------
1 | // License: Attribution 4.0 International (CC BY 4.0)
2 | /*--- __ECO__ __PLAYMAKER__ __ACTION__ ---*/
3 | // Author : Deek
4 |
5 | using UnityEngine;
6 |
7 | namespace HutongGames.PlayMaker.Actions
8 | {
9 | [ActionCategory(ActionCategory.Audio)]
10 | [HelpUrl("http://hutonggames.com/playmakerforum/index.php?topic=15458.0")]
11 | [Tooltip("Retrieve the length of the AudioClip inside the specified AudioSource or from the given object.")]
12 | public class GetAudioClipLength : ComponentAction
13 | {
14 |
15 | [CheckForComponent(typeof(AudioSource))]
16 | [Tooltip("The GameObject with the AudioSource component.")]
17 | public FsmOwnerDefault gameObject;
18 |
19 | [Tooltip("Supply a clip directly.")]
20 | public FsmObject audioClip;
21 |
22 | [UIHint(UIHint.Variable)]
23 | [Tooltip("The length of the clip.")]
24 | public FsmFloat length;
25 |
26 | private AudioClip _audioClip;
27 |
28 | public override void Reset()
29 | {
30 | gameObject = null;
31 | audioClip = new FsmObject() { UseVariable = true };
32 | length = 0;
33 | }
34 |
35 | public override void OnEnter()
36 | {
37 |
38 | var go = Fsm.GetOwnerDefaultTarget(gameObject);
39 | if(UpdateCache(go))
40 | {
41 | _audioClip = audio.clip as AudioClip;
42 | length.Value = _audioClip.length;
43 | } else
44 | {
45 | _audioClip = audioClip.Value as AudioClip;
46 | length.Value = _audioClip.length;
47 | }
48 |
49 | Finish();
50 | }
51 | }
52 | }
53 |
--------------------------------------------------------------------------------
/Custom PlayMaker Actions/Audio Customs/GetAudioProgress.cs:
--------------------------------------------------------------------------------
1 | // License: Attribution 4.0 International (CC BY 4.0)
2 | /*--- __ECO__ __PLAYMAKER__ __ACTION__ ---*/
3 | // Author : Deek
4 |
5 | using UnityEngine;
6 |
7 | namespace HutongGames.PlayMaker.Actions
8 | {
9 | [ActionCategory(ActionCategory.Audio)]
10 | [HelpUrl("http://hutonggames.com/playmakerforum/index.php?topic=15458.0")]
11 | [Tooltip("Retrieve the progress (in %) of the specified AudioSource. Optionally sends an Event when past the specified percentage.")]
12 | public class GetAudioProgress : ComponentAction
13 | {
14 | [CheckForComponent(typeof(AudioSource))]
15 | [Tooltip("The GameObject with the AudioSource component.")]
16 | public FsmOwnerDefault gameObject;
17 |
18 | [UIHint(UIHint.Variable)]
19 | [Tooltip("The progress of currently playing clip.")]
20 | public FsmFloat currentProgress;
21 |
22 | [ActionSection("Optional")]
23 |
24 | [HasFloatSlider(0, 100)]
25 | [Tooltip("Send the Event when this percentage is reached. Must be above 0, otherwise ignores 'Send Event'.")]
26 | public FsmFloat onPercentage;
27 |
28 | [Tooltip("The Event to send when the progress reached the 'On Percentage' amount.")]
29 | public FsmEvent sendEvent;
30 |
31 | private float time;
32 | private float length;
33 | private AudioClip _audioClip;
34 |
35 | public override void Reset()
36 | {
37 | gameObject = null;
38 | currentProgress = 0;
39 | }
40 |
41 | public override void OnEnter()
42 | {
43 | var go = Fsm.GetOwnerDefaultTarget(gameObject);
44 | if(UpdateCache(go))
45 | {
46 | _audioClip = audio.clip as AudioClip;
47 | length = _audioClip.length;
48 | }
49 | }
50 |
51 | public override void OnUpdate()
52 | {
53 | time = audio.time;
54 | currentProgress.Value = (time / length) * 100;
55 |
56 | if(onPercentage.Value > 0)
57 | {
58 | if(currentProgress.Value > onPercentage.Value)
59 | {
60 | Fsm.Event(sendEvent);
61 | Finish();
62 | }
63 | }
64 | }
65 | }
66 | }
67 |
--------------------------------------------------------------------------------
/Custom PlayMaker Actions/Audio Customs/IntSwitchAudioClip.cs:
--------------------------------------------------------------------------------
1 | // License: Attribution 4.0 International (CC BY 4.0)
2 | /*--- __ECO__ __PLAYMAKER__ __ACTION__ ---*/
3 | // Author : Deek
4 |
5 | using UnityEngine;
6 |
7 | namespace HutongGames.PlayMaker.Actions
8 | {
9 | [ActionCategory(ActionCategory.Audio)]
10 | [HelpUrl("http://hutonggames.com/playmakerforum/index.php?topic=15458.0")]
11 | [Tooltip("Get an AudioClip based on the value of an Integer Variable.")]
12 | public class IntSwitchAudioClip : FsmStateAction
13 | {
14 | [RequiredField]
15 | [UIHint(UIHint.Variable)]
16 | public FsmInt intVariable;
17 |
18 | [CompoundArray("Int Switches", "Compare Int", "Assigned Audio Clip")]
19 | public FsmInt[] compareTo;
20 | [ObjectType(typeof(AudioClip))]
21 | public FsmObject[] assignedAudioClip;
22 |
23 | [UIHint(UIHint.Variable)]
24 | [ObjectType(typeof(AudioClip))]
25 | public FsmObject result;
26 | public bool everyFrame;
27 |
28 | public override void Reset()
29 | {
30 | intVariable = null;
31 | compareTo = new FsmInt[1];
32 | assignedAudioClip = new FsmObject[1];
33 | result = null;
34 | everyFrame = false;
35 | }
36 |
37 | public override void OnEnter()
38 | {
39 | DoIntSwitch();
40 |
41 | if(!everyFrame)
42 | Finish();
43 | }
44 |
45 | public override void OnUpdate()
46 | {
47 | DoIntSwitch();
48 | }
49 |
50 | void DoIntSwitch()
51 | {
52 | if(intVariable.IsNone)
53 | return;
54 |
55 | for(int i = 0; i < compareTo.Length; i++)
56 | {
57 | if(intVariable.Value == compareTo[i].Value)
58 | {
59 | result = assignedAudioClip[i];
60 | return;
61 | }
62 | }
63 | }
64 | }
65 | }
66 |
--------------------------------------------------------------------------------
/Custom PlayMaker Actions/Audio Customs/README.MD:
--------------------------------------------------------------------------------
1 | ## GetAudioClipLength.cs
2 | 
3 |
4 | ## GetAudioProgress.cs
5 | 
6 |
7 | ## IntSwitchAudioClip.cs
8 | 
9 |
10 |
--------------------------------------------------------------------------------
/Custom PlayMaker Actions/Camera Customs/README.MD:
--------------------------------------------------------------------------------
1 | ## ColliderIsVisible.cs
2 | 
3 |
4 | ## Collider2DIsVisible.cs
5 | 
6 |
--------------------------------------------------------------------------------
/Custom PlayMaker Actions/Color Customs/README.MD:
--------------------------------------------------------------------------------
1 | ## CompareColors.cs
2 | 
3 |
--------------------------------------------------------------------------------
/Custom PlayMaker Actions/Device Customs/README.MD:
--------------------------------------------------------------------------------
1 | ## GetDeviceLinearAcceleration.cs
2 | 
3 |
4 | ## GetDeviceRollCustom.cs
5 | 
6 |
7 | ## SwipeGestureEventAdvanced.cs
8 | 
--------------------------------------------------------------------------------
/Custom PlayMaker Actions/Enum Customs/EnumGetRandom.cs:
--------------------------------------------------------------------------------
1 | // License: Attribution 4.0 International (CC BY 4.0)
2 | /*--- __ECO__ __PLAYMAKER__ __ACTION__ ---*/
3 | // Author : Deek
4 |
5 | using System;
6 | using System.Collections.Generic;
7 |
8 | namespace HutongGames.PlayMaker.Actions
9 | {
10 | [ActionCategory(ActionCategory.Enum)]
11 | [HelpUrl("http://hutonggames.com/playmakerforum/index.php?topic=15458.0")]
12 | [Tooltip("Get a Random item from an enum.")]
13 | public class EnumGetRandom : FsmStateAction
14 | {
15 | [UIHint(UIHint.Variable)]
16 | [Tooltip("The Enum Variable to get a random Item from.")]
17 | public FsmEnum enumVariable;
18 |
19 | [Tooltip("Repeat every frame while the state is active.")]
20 | public bool everyFrame;
21 |
22 | public override void Reset()
23 | {
24 | enumVariable = null;
25 | everyFrame = false;
26 | }
27 |
28 | public override void OnEnter()
29 | {
30 | DoGetRandomValue();
31 |
32 | if(!everyFrame)
33 | {
34 | Finish();
35 | }
36 | }
37 |
38 | public override void OnUpdate()
39 | {
40 | DoGetRandomValue();
41 | }
42 |
43 | private void DoGetRandomValue()
44 | {
45 | List