diff --git a/LocalPackages/LightingTools.LightProbesVolumes/Editor.meta b/LocalPackages/LightingTools.LightProbesVolumes/Editor.meta new file mode 100644 index 0000000..7e49cf9 --- /dev/null +++ b/LocalPackages/LightingTools.LightProbesVolumes/Editor.meta @@ -0,0 +1,9 @@ +fileFormatVersion: 2 +guid: cee0b306a665f174998de09b82121deb +folderAsset: yes +timeCreated: 1492708210 +licenseType: Pro +DefaultImporter: + userData: + assetBundleName: + assetBundleVariant: diff --git a/LocalPackages/LightingTools.LightProbesVolumes/Editor/LightProbesVolume.png b/LocalPackages/LightingTools.LightProbesVolumes/Editor/LightProbesVolume.png new file mode 100644 index 0000000..f4d915d --- /dev/null +++ b/LocalPackages/LightingTools.LightProbesVolumes/Editor/LightProbesVolume.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:dbf0f4f237a0b5e7cbd0b84acd1f5fa3372df2d05308997444d82413f08851fd +size 7147 diff --git a/LocalPackages/LightingTools.LightProbesVolumes/Editor/LightProbesVolume.png.meta b/LocalPackages/LightingTools.LightProbesVolumes/Editor/LightProbesVolume.png.meta new file mode 100644 index 0000000..21ed444 --- /dev/null +++ b/LocalPackages/LightingTools.LightProbesVolumes/Editor/LightProbesVolume.png.meta @@ -0,0 +1,103 @@ +fileFormatVersion: 2 +guid: 8ef34d7d3b3b45b4d923405b38d36f35 +TextureImporter: + internalIDToNameTable: [] + externalObjects: {} + serializedVersion: 10 + mipmaps: + mipMapMode: 0 + enableMipMap: 0 + sRGBTexture: 1 + linearTexture: 0 + fadeOut: 0 + borderMipMap: 0 + mipMapsPreserveCoverage: 0 + alphaTestReferenceValue: 0.5 + mipMapFadeDistanceStart: 1 + mipMapFadeDistanceEnd: 3 + bumpmap: + convertToNormalMap: 0 + externalNormalMap: 0 + heightScale: 0.25 + normalMapFilter: 0 + isReadable: 0 + streamingMipmaps: 0 + streamingMipmapsPriority: 0 + grayScaleToAlpha: 0 + generateCubemap: 6 + cubemapConvolution: 0 + seamlessCubemap: 0 + textureFormat: 1 + maxTextureSize: 2048 + textureSettings: + serializedVersion: 2 + filterMode: -1 + aniso: -1 + mipBias: -100 + wrapU: 1 + wrapV: 1 + wrapW: -1 + nPOTScale: 0 + lightmap: 0 + compressionQuality: 50 + spriteMode: 1 + spriteExtrude: 1 + spriteMeshType: 1 + alignment: 0 + spritePivot: {x: 0.5, y: 0.5} + spritePixelsToUnits: 100 + spriteBorder: {x: 0, y: 0, z: 0, w: 0} + spriteGenerateFallbackPhysicsShape: 1 + alphaUsage: 1 + alphaIsTransparency: 1 + spriteTessellationDetail: -1 + textureType: 8 + textureShape: 1 + singleChannelComponent: 0 + maxTextureSizeSet: 0 + compressionQualitySet: 0 + textureFormatSet: 0 + platformSettings: + - serializedVersion: 3 + buildTarget: DefaultTexturePlatform + maxTextureSize: 2048 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 1 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + androidETC2FallbackOverride: 0 + forceMaximumCompressionQuality_BC6H_BC7: 1 + - serializedVersion: 3 + buildTarget: Standalone + maxTextureSize: 2048 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 1 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + androidETC2FallbackOverride: 0 + forceMaximumCompressionQuality_BC6H_BC7: 1 + spriteSheet: + serializedVersion: 2 + sprites: [] + outline: [] + physicsShape: [] + bones: [] + spriteID: 5e97eb03825dee720800000000000000 + internalID: 0 + vertices: [] + indices: + edges: [] + weights: [] + secondaryTextures: [] + spritePackingTag: + pSDRemoveMatte: 0 + pSDShowRemoveMatteOption: 0 + userData: + assetBundleName: + assetBundleVariant: diff --git a/LocalPackages/LightingTools.LightProbesVolumes/Editor/LightProbesVolumeEditor.cs b/LocalPackages/LightingTools.LightProbesVolumes/Editor/LightProbesVolumeEditor.cs new file mode 100644 index 0000000..4dac338 --- /dev/null +++ b/LocalPackages/LightingTools.LightProbesVolumes/Editor/LightProbesVolumeEditor.cs @@ -0,0 +1,70 @@ +using UnityEngine; +using UnityEditor; + +namespace LightingTools.LightProbesVolumes +{ + [CustomEditor(typeof(LightProbesVolumeSettings))] + public class LightProbesVolumeEditor : Editor + { + SerializedProperty horizontalSpacing; + SerializedProperty verticalSpacing; + SerializedProperty offsetFromFloor; + SerializedProperty numberOfLayers; + SerializedProperty fillVolume; + SerializedProperty followFloor; + SerializedProperty discardInsideGeometry; + SerializedProperty drawDebug; + + void OnEnable() + { + horizontalSpacing = serializedObject.FindProperty("horizontalSpacing"); + verticalSpacing = serializedObject.FindProperty("verticalSpacing"); + offsetFromFloor = serializedObject.FindProperty("offsetFromFloor"); + numberOfLayers = serializedObject.FindProperty("numberOfLayers"); + fillVolume = serializedObject.FindProperty("fillVolume"); + followFloor = serializedObject.FindProperty("followFloor"); + discardInsideGeometry = serializedObject.FindProperty("discardInsideGeometry"); + drawDebug = serializedObject.FindProperty("drawDebug"); + } + + public override void OnInspectorGUI() + { + var volume = (LightProbesVolumeSettings)target; + + serializedObject.Update(); + EditorGUILayout.DelayedFloatField(horizontalSpacing); + EditorGUILayout.DelayedFloatField(verticalSpacing); + EditorGUILayout.PropertyField(offsetFromFloor); + EditorGUILayout.PropertyField(fillVolume); + serializedObject.ApplyModifiedProperties(); + EditorGUI.BeginDisabledGroup(fillVolume.boolValue); + EditorGUILayout.PropertyField(numberOfLayers); + EditorGUI.EndDisabledGroup(); + EditorGUILayout.PropertyField(followFloor); + EditorGUILayout.PropertyField(discardInsideGeometry); + EditorGUILayout.PropertyField(drawDebug); + + if (GUILayout.Button("Create Light Probes in Selected Volume")) + { + volume.Populate(); + } + + serializedObject.ApplyModifiedProperties(); + } + + [MenuItem("GameObject/Light/Lightprobes Volume", false, 10)] + static void CreateCustomGameObject(MenuCommand menuCommand) + { + // Create a custom game object + GameObject volume = new GameObject("LightprobeVolume"); + // Ensure it gets reparented if this was a context click (otherwise does nothing) + GameObjectUtility.SetParentAndAlign(volume, menuCommand.context as GameObject); + // Register the creation in the undo system + Undo.RegisterCreatedObjectUndo(volume, "Create " + volume.name); + Selection.activeObject = volume; + volume.AddComponent(); + volume.GetComponent().size = new Vector3(5, 2, 5); + volume.GetComponent().isTrigger = true; + } + } +} \ No newline at end of file diff --git a/LocalPackages/LightingTools.LightProbesVolumes/Editor/LightProbesVolumeEditor.cs.meta b/LocalPackages/LightingTools.LightProbesVolumes/Editor/LightProbesVolumeEditor.cs.meta new file mode 100644 index 0000000..a16cdc5 --- /dev/null +++ b/LocalPackages/LightingTools.LightProbesVolumes/Editor/LightProbesVolumeEditor.cs.meta @@ -0,0 +1,12 @@ +fileFormatVersion: 2 +guid: f046a008730fb8f40aca66fe59632d95 +timeCreated: 1490885515 +licenseType: Pro +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/LocalPackages/LightingTools.LightProbesVolumes/Editor/LightingTools.LightProbesVolumes.Editor.asmdef b/LocalPackages/LightingTools.LightProbesVolumes/Editor/LightingTools.LightProbesVolumes.Editor.asmdef new file mode 100644 index 0000000..da18cd2 --- /dev/null +++ b/LocalPackages/LightingTools.LightProbesVolumes/Editor/LightingTools.LightProbesVolumes.Editor.asmdef @@ -0,0 +1,16 @@ +{ + "name": "LightingTools.LightProbesVolumes.Editor", + "references": [ + "LightingTools.LightProbesVolumes" + ], + "optionalUnityReferences": [], + "includePlatforms": [ + "Editor" + ], + "excludePlatforms": [], + "allowUnsafeCode": false, + "overrideReferences": false, + "precompiledReferences": [], + "autoReferenced": true, + "defineConstraints": [] +} \ No newline at end of file diff --git a/LocalPackages/LightingTools.LightProbesVolumes/Editor/LightingTools.LightProbesVolumes.Editor.asmdef.meta b/LocalPackages/LightingTools.LightProbesVolumes/Editor/LightingTools.LightProbesVolumes.Editor.asmdef.meta new file mode 100644 index 0000000..c84c798 --- /dev/null +++ b/LocalPackages/LightingTools.LightProbesVolumes/Editor/LightingTools.LightProbesVolumes.Editor.asmdef.meta @@ -0,0 +1,9 @@ +fileFormatVersion: 2 +guid: 087ff6b4289583947b41b0c03d628d1f +timeCreated: 1546438390 +licenseType: Pro +AssemblyDefinitionImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/LocalPackages/LightingTools.LightProbesVolumes/Editor/RefreshLightProbesVolumes.cs b/LocalPackages/LightingTools.LightProbesVolumes/Editor/RefreshLightProbesVolumes.cs new file mode 100644 index 0000000..2040b66 --- /dev/null +++ b/LocalPackages/LightingTools.LightProbesVolumes/Editor/RefreshLightProbesVolumes.cs @@ -0,0 +1,18 @@ +using UnityEngine; +using UnityEditor; + +namespace LightingTools.LightProbesVolumes +{ + public class RefreshLightProbesVolumes + { + [MenuItem("Lighting/Refresh lightprobes volumes")] + static void Refresh() + { + var volumes = GameObject.FindObjectsOfType(); + foreach (var volume in volumes) + { + volume.Populate(); + } + } + } +} \ No newline at end of file diff --git a/LocalPackages/LightingTools.LightProbesVolumes/Editor/RefreshLightProbesVolumes.cs.meta b/LocalPackages/LightingTools.LightProbesVolumes/Editor/RefreshLightProbesVolumes.cs.meta new file mode 100644 index 0000000..e240dc7 --- /dev/null +++ b/LocalPackages/LightingTools.LightProbesVolumes/Editor/RefreshLightProbesVolumes.cs.meta @@ -0,0 +1,12 @@ +fileFormatVersion: 2 +guid: 69d120c0b1360954680fd20bf7e055e2 +timeCreated: 1490885515 +licenseType: Pro +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/LocalPackages/LightingTools.LightProbesVolumes/README.md b/LocalPackages/LightingTools.LightProbesVolumes/README.md new file mode 100644 index 0000000..426c7e2 --- /dev/null +++ b/LocalPackages/LightingTools.LightProbesVolumes/README.md @@ -0,0 +1,40 @@ +# LightingTools.LightProbesVolumes +Light probes volumes + +Requires Unity 2018.1 or above. + +# Setup instructions : + +- In your project folder create a "LocalPackages" folder next to your "Assets" folder +- In the LocalPackages folder extract this repo under a "LightingTools.LightProbesVolumes" folder +- In the "Packages" folder open the "manifest.json" in a text editing software +- in "manifest.json" under "dependencies" add the line : +"li.lightingtools.core": "file:../LocalPackages/LightingTools.LightProbesVolumes" (you need to add a "," if this is not the last dependency) +- open the project and profit ! + +# How to use it : + +- In the hierarchy view click : Create / Light / Lightprobe Volume +- Set the size of the box collider to the size of the area you want to place lightprobes in ( if you have a ceiling it is recommended to set the vertical bounds lower to the ceiling, or it will spawn probes on top of it). +- Set the " Light probe volume settings" : + - vertical and horizontal spacing ( one probe every X meters ) + - offset from floor is at which vertical distance from the collision you want to spawn the first layer of probes + - number of layers is the number of probes that will be placed vertically above the hit collider + - follow floor : when enabled the script performs raycast in order to place lightprobes above existing static geometry that has a collider. When disabled the lightprobes are just placed above the lower face of the volume. + - fill volume enabled will fill the whole height of the volume instead of just doing X number of layer. When this is enabled the number of layers is ignored. + - discard inside geometry will test if your probe is inside an object with collisions. This will only work if the top face of your volume is not itself inside an object with collisions. In order to check this enable "draw Debug" and fill the volume : the green cross at the top has to be located in the air and not inside a geometry. +- Click the button ! +- When you have several volumes setup in your scene and you want to refresh them all : +- Go to lighting / Refresh lightprobes volumes. This will place again the probes in all the volumes in the scene. + +# Improvements I would like to do : + +- Replace the raycast to colliders by raycast to meshrenderers + +# Troubleshoot : + +- if the script doesn't place any lightprobe, make sure your geometric is marked as static, and that it has a collider. Using colliders isn't ideal but I haven't found a good solution that would work without them. + +# Contributions : + +This was originally based on the script shared by ghostmantis games : http://ghostmantis.com/?p=332 diff --git a/LocalPackages/LightingTools.LightProbesVolumes/README.md.meta b/LocalPackages/LightingTools.LightProbesVolumes/README.md.meta new file mode 100644 index 0000000..c057de2 --- /dev/null +++ b/LocalPackages/LightingTools.LightProbesVolumes/README.md.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: 0e68ecda44ce2814bb8206e78e262818 +TextScriptImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/LocalPackages/LightingTools.LightProbesVolumes/Runtime.meta b/LocalPackages/LightingTools.LightProbesVolumes/Runtime.meta new file mode 100644 index 0000000..0e85062 --- /dev/null +++ b/LocalPackages/LightingTools.LightProbesVolumes/Runtime.meta @@ -0,0 +1,10 @@ +fileFormatVersion: 2 +guid: 814405171c7b05741a1b7aa8a09674eb +folderAsset: yes +timeCreated: 1546438065 +licenseType: Pro +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/LocalPackages/LightingTools.LightProbesVolumes/Runtime/LightProbesPlacement.cs b/LocalPackages/LightingTools.LightProbesVolumes/Runtime/LightProbesPlacement.cs new file mode 100644 index 0000000..9aad859 --- /dev/null +++ b/LocalPackages/LightingTools.LightProbesVolumes/Runtime/LightProbesPlacement.cs @@ -0,0 +1,194 @@ +using System.Collections.Generic; +using UnityEngine; +#if UNITY_EDITOR +using UnityEditor; +#endif + +namespace LightingTools.LightProbesVolumes +{ + public static class LightProbesPlacement + { +#if UNITY_EDITOR + public static void Populate (GameObject gameObject, float horizontalSpacing, float verticalSpacing, float offsetFromFloor, int numberOfLayers, bool drawDebug, bool fillVolume, bool discardInsideGeometry, bool followFloor) + { + BoxCollider boxCollider = gameObject.GetComponent(); + if (boxCollider == null) + { + Debug.LogWarning("Box collider not found on " + gameObject.name); + return; + } + //Make sure collider is a trigger + boxCollider.isTrigger = true; + + //avoid division by 0 + horizontalSpacing = Mathf.Max(horizontalSpacing, 0.01f); + verticalSpacing = Mathf.Max(verticalSpacing, 0.01f); + + //Check if there is already a lightprobegroup component + // if there is destroy it + LightProbeGroup oldLightprobes = gameObject.GetComponent(); + + //Calculate Start Points at the top of the collider + Vector3[] startPositions = StartPoints(boxCollider.size, boxCollider.center, boxCollider.transform, horizontalSpacing); + + float minY = boxCollider.bounds.min.y; + float maxY = boxCollider.bounds.max.y; + + float sizeY = boxCollider.size.y; + int ycount = Mathf.FloorToInt((sizeY-offsetFromFloor) / verticalSpacing) + 1; + + List VertPositions = new List(); + + int currentTrace = 0; + + //if followFloor we raycast from top to down in order to follow the static geometry (with colliders) + if(followFloor) + { + foreach (Vector3 startPos in startPositions) + { + //RaycastHit hit; + RaycastHit[] hits; + Ray ray = new Ray(); + ray.origin = startPos; + ray.direction = -Vector3.up; + hits = Physics.RaycastAll(ray, sizeY + 1, -1, QueryTriggerInteraction.Ignore); + + //Validate hits + foreach (var hit in hits) + { + if (!hit.collider.gameObject.isStatic) + break; + if (hit.point.y + offsetFromFloor < maxY && hit.point.y + offsetFromFloor > minY) + VertPositions.Add(hit.point + new Vector3(0, offsetFromFloor, 0)); + + int maxLayer = fillVolume ? ycount : numberOfLayers; + + for (int i = 1; i < maxLayer; i++) + { + if (hit.point.y + offsetFromFloor + i * verticalSpacing < maxY && hit.point.y + offsetFromFloor + verticalSpacing > minY) + VertPositions.Add(hit.point + new Vector3(0, offsetFromFloor + i * verticalSpacing, 0)); + } + } + EditorUtility.DisplayProgressBar("Tracing floor collisions", currentTrace.ToString() + "/" + startPositions.Length.ToString(), (float)currentTrace / (float)startPositions.Length); + currentTrace++; + } + EditorUtility.ClearProgressBar(); + } + + else + { + int maxLayer = fillVolume ? ycount : numberOfLayers; + + for (int i = 0; i< maxLayer; i++) + { + foreach(Vector3 position in startPositions) + { + VertPositions.Add(position + Vector3.up * verticalSpacing * i - Vector3.up*sizeY + Vector3.up * offsetFromFloor); + } + } + } + + if(drawDebug) + { + foreach(Vector3 position in VertPositions) + { + Debug.DrawLine(position, position + Vector3.up * 0.5f,Color.red,3); + } + } + + List validVertPositions = new List(); + + //Inside Geometry test : take an arbitrary position in space and trace from that position to the probe position and back from the probe position to the arbitrary position. If the number of hits is different for both raycasts the probe is considered to be inside an object. + //When using Draw Debug the arbitrary position is the Green cross in the air. + if (discardInsideGeometry) + { + int j = 0; + Vector3 insideTestPosition = gameObject.transform.position + gameObject.GetComponent().center + new Vector3(0, maxY / 2, 0); + if (drawDebug) + { + Debug.DrawLine(insideTestPosition + Vector3.up, insideTestPosition - Vector3.up, Color.green, 5); + Debug.DrawLine(insideTestPosition + Vector3.right, insideTestPosition - Vector3.right, Color.green, 5); + Debug.DrawLine(insideTestPosition + Vector3.forward, insideTestPosition - Vector3.forward, Color.green, 5); + } + foreach (Vector3 positionCandidate in VertPositions) + { + EditorUtility.DisplayProgressBar("Checking probes inside geometry", j.ToString() + "/" + VertPositions.Count, (float)j / (float)VertPositions.Count); + + Ray forwardRay = new Ray(insideTestPosition, Vector3.Normalize(positionCandidate - insideTestPosition)); + Ray backwardRay = new Ray(positionCandidate, Vector3.Normalize(insideTestPosition - positionCandidate)); + RaycastHit[] hitsForward; + RaycastHit[] hitsBackward; + hitsForward = Physics.RaycastAll(forwardRay, Vector3.Distance(positionCandidate, insideTestPosition), -1, QueryTriggerInteraction.Ignore); + hitsBackward = Physics.RaycastAll(backwardRay, Vector3.Distance(positionCandidate, insideTestPosition), -1, QueryTriggerInteraction.Ignore); + if (hitsForward.Length == hitsBackward.Length) validVertPositions.Add(positionCandidate); + else if (drawDebug) + Debug.DrawRay(backwardRay.origin, backwardRay.direction * Vector3.Distance(positionCandidate, insideTestPosition), Color.cyan, 5); + j++; + } + EditorUtility.ClearProgressBar(); + } + else + validVertPositions = VertPositions; + + + // Check if we have any hits + if (validVertPositions.Count < 1) + { + Debug.Log("no valid hit for " + gameObject.name); + return; + } + + LightProbeGroup LPGroup = oldLightprobes != null ? oldLightprobes : gameObject.AddComponent(); + + // Feed lightprobe positions + Vector3[] ProbePos = new Vector3[validVertPositions.Count]; + for (int i = 0; i < validVertPositions.Count; i++) + { + ProbePos[i] = gameObject.transform.InverseTransformPoint(validVertPositions[i]); + } + LPGroup.probePositions = ProbePos; + + //Finish + Debug.Log("Finished placing " + ProbePos.Length + " probes for " + gameObject.name); + } + + static Vector3[] StartPoints(Vector3 size, Vector3 offset, Transform transform, float horizontalSpacing) + { + // Calculate count and start offset + int xCount = Mathf.FloorToInt(size.x / horizontalSpacing) + 1; + int zCount = Mathf.FloorToInt(size.z / horizontalSpacing) + 1; + float startxoffset = (size.x - (xCount-1) * horizontalSpacing)/2; + float startzoffset = (size.z - (zCount-1) * horizontalSpacing)/2; + + //if lightprobe count fits exactly in bounds, I know the probes at the maximum bounds will be rejected, so add offset + if (startxoffset == 0) + startxoffset = horizontalSpacing / 2; + if (startzoffset == 0) + startzoffset = horizontalSpacing / 2; + + Vector3[] vertPositions = new Vector3[ xCount * zCount ]; + + int vertexnumber = 0; + + for (int i = 0; i < xCount; i++) + { + for (int j = 0; j < zCount; j++ ) + { + Vector3 position = new Vector3 + { + y = size.y / 2, + x = startxoffset + (i * horizontalSpacing) - (size.x / 2), + z = startzoffset + (j * horizontalSpacing) - (size.z / 2) + }; + + vertPositions[vertexnumber] = transform.TransformPoint(position + offset); + + vertexnumber++; + } + } + + return vertPositions; + } +#endif + } +} diff --git a/LocalPackages/net.peeweek.gameplay-ingredients/Runtime/Hooks/OnAwakeHook.cs.meta b/LocalPackages/LightingTools.LightProbesVolumes/Runtime/LightProbesPlacement.cs.meta similarity index 77% rename from LocalPackages/net.peeweek.gameplay-ingredients/Runtime/Hooks/OnAwakeHook.cs.meta rename to LocalPackages/LightingTools.LightProbesVolumes/Runtime/LightProbesPlacement.cs.meta index e83f5d3..3d2b75e 100644 --- a/LocalPackages/net.peeweek.gameplay-ingredients/Runtime/Hooks/OnAwakeHook.cs.meta +++ b/LocalPackages/LightingTools.LightProbesVolumes/Runtime/LightProbesPlacement.cs.meta @@ -1,6 +1,6 @@ fileFormatVersion: 2 -guid: 3bfe7209b5cff4f49b13217ed25f16dd -timeCreated: 1504691534 +guid: 82da266145fa8e8449852cf58020c13d +timeCreated: 1546423551 licenseType: Pro MonoImporter: externalObjects: {} diff --git a/LocalPackages/LightingTools.LightProbesVolumes/Runtime/LightProbesVolumeSettings.cs b/LocalPackages/LightingTools.LightProbesVolumes/Runtime/LightProbesVolumeSettings.cs new file mode 100644 index 0000000..f907e7c --- /dev/null +++ b/LocalPackages/LightingTools.LightProbesVolumes/Runtime/LightProbesVolumeSettings.cs @@ -0,0 +1,31 @@ +using UnityEngine; + +namespace LightingTools.LightProbesVolumes +{ + [ExecuteInEditMode] + [RequireComponent(typeof(BoxCollider))] + public class LightProbesVolumeSettings : MonoBehaviour + { + public float horizontalSpacing = 2.0f; + public float verticalSpacing = 2.0f; + public float offsetFromFloor = 0.5f; + public int numberOfLayers = 2; + public bool fillVolume = false; + public bool followFloor = true; + public bool discardInsideGeometry; + public bool drawDebug = false; + + private void OnEnable() + { + var boxCollider = GetComponent(); + boxCollider.isTrigger = true; + } + + #if UNITY_EDITOR + public void Populate() + { + LightProbesPlacement.Populate(gameObject,horizontalSpacing,verticalSpacing,offsetFromFloor,numberOfLayers,drawDebug,fillVolume,discardInsideGeometry, followFloor); + } + #endif + } +} \ No newline at end of file diff --git a/LocalPackages/LightingTools.LightProbesVolumes/Runtime/LightProbesVolumeSettings.cs.meta b/LocalPackages/LightingTools.LightProbesVolumes/Runtime/LightProbesVolumeSettings.cs.meta new file mode 100644 index 0000000..d21b49c --- /dev/null +++ b/LocalPackages/LightingTools.LightProbesVolumes/Runtime/LightProbesVolumeSettings.cs.meta @@ -0,0 +1,12 @@ +fileFormatVersion: 2 +guid: fc7eebf330e67854398f83add3b50749 +timeCreated: 1490885515 +licenseType: Pro +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {fileID: 2800000, guid: 8ef34d7d3b3b45b4d923405b38d36f35, type: 3} + userData: + assetBundleName: + assetBundleVariant: diff --git a/LocalPackages/LightingTools.LightProbesVolumes/Runtime/LightingTools.LightProbesVolumes.asmdef b/LocalPackages/LightingTools.LightProbesVolumes/Runtime/LightingTools.LightProbesVolumes.asmdef new file mode 100644 index 0000000..b242f8c --- /dev/null +++ b/LocalPackages/LightingTools.LightProbesVolumes/Runtime/LightingTools.LightProbesVolumes.asmdef @@ -0,0 +1,8 @@ +{ + "name": "LightingTools.LightProbesVolumes", + "references": [], + "optionalUnityReferences": [], + "includePlatforms": [], + "excludePlatforms": [], + "allowUnsafeCode": false +} \ No newline at end of file diff --git a/LocalPackages/LightingTools.LightProbesVolumes/Runtime/LightingTools.LightProbesVolumes.asmdef.meta b/LocalPackages/LightingTools.LightProbesVolumes/Runtime/LightingTools.LightProbesVolumes.asmdef.meta new file mode 100644 index 0000000..9c058e2 --- /dev/null +++ b/LocalPackages/LightingTools.LightProbesVolumes/Runtime/LightingTools.LightProbesVolumes.asmdef.meta @@ -0,0 +1,9 @@ +fileFormatVersion: 2 +guid: 636c3e62138bf8548a29334166578537 +timeCreated: 1546438430 +licenseType: Pro +AssemblyDefinitionImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/LocalPackages/LightingTools.LightProbesVolumes/package.json b/LocalPackages/LightingTools.LightProbesVolumes/package.json new file mode 100644 index 0000000..49d923c --- /dev/null +++ b/LocalPackages/LightingTools.LightProbesVolumes/package.json @@ -0,0 +1,7 @@ +{ + "name": "li.lightingtools.lightprobesvolumes", + "displayName": "Light Probes Volumes", + "version": "0.0.1", + "unity": "2018.3", + "description": "Lighting tools test." +} \ No newline at end of file diff --git a/LocalPackages/LightingTools.LightProbesVolumes/package.json.meta b/LocalPackages/LightingTools.LightProbesVolumes/package.json.meta new file mode 100644 index 0000000..6ef74a2 --- /dev/null +++ b/LocalPackages/LightingTools.LightProbesVolumes/package.json.meta @@ -0,0 +1,9 @@ +fileFormatVersion: 2 +guid: 1d6b995f4d143ea40a626591e25d164e +timeCreated: 1546438320 +licenseType: Pro +TextScriptImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/LocalPackages/LightingTools.LightmapSwitcher/CHANGELOG.md b/LocalPackages/LightingTools.LightmapSwitcher/CHANGELOG.md new file mode 100644 index 0000000..5391f74 --- /dev/null +++ b/LocalPackages/LightingTools.LightmapSwitcher/CHANGELOG.md @@ -0,0 +1,11 @@ +# Changelog +All notable changes to this package will be documented in this file. + +The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/) +and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html). + +## [0.1.0] - 2017-MM-DD + +### This is the first release of *Unity Package \*. + +*Short description of this release* diff --git a/LocalPackages/LightingTools.LightmapSwitcher/CHANGELOG.md.meta b/LocalPackages/LightingTools.LightmapSwitcher/CHANGELOG.md.meta new file mode 100644 index 0000000..2d49842 --- /dev/null +++ b/LocalPackages/LightingTools.LightmapSwitcher/CHANGELOG.md.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: 73d00c311b68c0b43b290792f9229142 +TextScriptImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/LocalPackages/LightingTools.LightmapSwitcher/CONTRIBUTING.md b/LocalPackages/LightingTools.LightmapSwitcher/CONTRIBUTING.md new file mode 100644 index 0000000..9f299b1 --- /dev/null +++ b/LocalPackages/LightingTools.LightmapSwitcher/CONTRIBUTING.md @@ -0,0 +1,9 @@ +# Contributing + +## If you are interested in contributing, here are some ground rules: +* ... Define guidelines & rules for what contributors need to know to successfully make Pull requests against your repo ... + +## All contributions are subject to the [Unity Contribution Agreement(UCA)](https://unity3d.com/legal/licenses/Unity_Contribution_Agreement) +By making a pull request, you are confirming agreement to the terms and conditions of the UCA, including that your Contributions are your original creation and that you have complete right and authority to make your Contributions. + +## Once you have a change ready following these ground rules. Simply make a pull request diff --git a/LocalPackages/LightingTools.LightmapSwitcher/CONTRIBUTING.md.meta b/LocalPackages/LightingTools.LightmapSwitcher/CONTRIBUTING.md.meta new file mode 100644 index 0000000..a866154 --- /dev/null +++ b/LocalPackages/LightingTools.LightmapSwitcher/CONTRIBUTING.md.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: 12e422220e727d14aba019c24b31c69c +TextScriptImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/LocalPackages/LightingTools.LightmapSwitcher/Editor.meta b/LocalPackages/LightingTools.LightmapSwitcher/Editor.meta new file mode 100644 index 0000000..8218f45 --- /dev/null +++ b/LocalPackages/LightingTools.LightmapSwitcher/Editor.meta @@ -0,0 +1,9 @@ +fileFormatVersion: 2 +guid: b1ebd9449aa245a42b8cf1842f144df3 +folderAsset: yes +timeCreated: 1479375522 +licenseType: Pro +DefaultImporter: + userData: + assetBundleName: + assetBundleVariant: diff --git a/LocalPackages/LightingTools.LightmapSwitcher/Editor/LevelLightmapDataEditor.cs b/LocalPackages/LightingTools.LightmapSwitcher/Editor/LevelLightmapDataEditor.cs new file mode 100644 index 0000000..addddb5 --- /dev/null +++ b/LocalPackages/LightingTools.LightmapSwitcher/Editor/LevelLightmapDataEditor.cs @@ -0,0 +1,126 @@ +using UnityEngine; +using UnityEngine.SceneManagement; +using UnityEditor; +using UnityEditor.SceneManagement; +using System.Collections; +using Unity.EditorCoroutines.Editor; + +[CustomEditor(typeof(LevelLightmapData))] +public class LevelLightmapDataEditor : Editor +{ + public SerializedProperty lightingScenariosScenes; + public SerializedProperty lightingScenesNames; + public SerializedProperty allowLoadingLightingScenes; + + GUIContent allowLoading = new GUIContent("Allow loading Lighting Scenes", "Allow the Level Lightmap Data script to load a lighting scene additively at runtime if the lighting scenario contains realtime lights."); + + public void OnEnable() + { + lightingScenariosScenes = serializedObject.FindProperty("lightingScenariosScenes"); + lightingScenesNames = serializedObject.FindProperty("lightingScenesNames"); + allowLoadingLightingScenes = serializedObject.FindProperty("allowLoadingLightingScenes"); + } + + public override void OnInspectorGUI() + { + serializedObject.Update(); + LevelLightmapData lightmapData = (LevelLightmapData)target; + + EditorGUI.BeginChangeCheck(); + EditorGUILayout.PropertyField(lightingScenariosScenes, new GUIContent("Lighting Scenarios Scenes"), includeChildren:true); + if (EditorGUI.EndChangeCheck()) + { + serializedObject.ApplyModifiedProperties(); + lightingScenesNames.arraySize = lightingScenariosScenes.arraySize; + + for (int i=0; i(); + var reflectionProbes = FindObjectsOfType(); + + foreach (Light light in lights) + { + if (light.lightmapBakeType == LightmapBakeType.Mixed || light.lightmapBakeType == LightmapBakeType.Realtime) + latestBuildHasRealtimeLights = true; + } + if (reflectionProbes.Length > 0) + latestBuildHasRealtimeLights = true; + + levelLightmapData.latestBuildHasReltimeLights = latestBuildHasRealtimeLights; + } +} \ No newline at end of file diff --git a/LocalPackages/LightingTools.LightmapSwitcher/Editor/LevelLightmapDataEditor.cs.meta b/LocalPackages/LightingTools.LightmapSwitcher/Editor/LevelLightmapDataEditor.cs.meta new file mode 100644 index 0000000..4a4a3df --- /dev/null +++ b/LocalPackages/LightingTools.LightmapSwitcher/Editor/LevelLightmapDataEditor.cs.meta @@ -0,0 +1,12 @@ +fileFormatVersion: 2 +guid: 0f3a223fa901e8b4e96df48bf5dd78ad +timeCreated: 1479375604 +licenseType: Pro +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/LocalPackages/LightingTools.LightmapSwitcher/Editor/LightingTools.LightmapSwitcher.Editor.asmdef b/LocalPackages/LightingTools.LightmapSwitcher/Editor/LightingTools.LightmapSwitcher.Editor.asmdef new file mode 100644 index 0000000..e1ef166 --- /dev/null +++ b/LocalPackages/LightingTools.LightmapSwitcher/Editor/LightingTools.LightmapSwitcher.Editor.asmdef @@ -0,0 +1,18 @@ +{ + "name": "LightingTools.LightmapSwitcher.Editor", + "references": [ + "LightingTools.LightmapSwitcher", + "Unity.EditorCoroutines.Editor" + ], + "includePlatforms": [ + "Editor" + ], + "excludePlatforms": [], + "allowUnsafeCode": false, + "overrideReferences": false, + "precompiledReferences": [], + "autoReferenced": true, + "defineConstraints": [], + "versionDefines": [], + "noEngineReferences": false +} \ No newline at end of file diff --git a/LocalPackages/LightingTools.LightmapSwitcher/Editor/LightingTools.LightmapSwitcher.Editor.asmdef.meta b/LocalPackages/LightingTools.LightmapSwitcher/Editor/LightingTools.LightmapSwitcher.Editor.asmdef.meta new file mode 100644 index 0000000..c0af15d --- /dev/null +++ b/LocalPackages/LightingTools.LightmapSwitcher/Editor/LightingTools.LightmapSwitcher.Editor.asmdef.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: 73cd762c1d4bdaf4891d2710c1f58ae2 +AssemblyDefinitionImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/LocalPackages/LightingTools.LightmapSwitcher/Editor/LightmapSwitcher.png b/LocalPackages/LightingTools.LightmapSwitcher/Editor/LightmapSwitcher.png new file mode 100644 index 0000000..a1d78a6 --- /dev/null +++ b/LocalPackages/LightingTools.LightmapSwitcher/Editor/LightmapSwitcher.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:1656bfbc25c2cc43d6a2cc683fd240120c03b5f06803dbe91c28c8e48e02b67b +size 3715 diff --git a/LocalPackages/LightingTools.LightmapSwitcher/Editor/LightmapSwitcher.png.meta b/LocalPackages/LightingTools.LightmapSwitcher/Editor/LightmapSwitcher.png.meta new file mode 100644 index 0000000..88d4a9d --- /dev/null +++ b/LocalPackages/LightingTools.LightmapSwitcher/Editor/LightmapSwitcher.png.meta @@ -0,0 +1,103 @@ +fileFormatVersion: 2 +guid: 4021dabdeeef1824b871b34d975991b8 +TextureImporter: + internalIDToNameTable: [] + externalObjects: {} + serializedVersion: 10 + mipmaps: + mipMapMode: 1 + enableMipMap: 0 + sRGBTexture: 1 + linearTexture: 0 + fadeOut: 0 + borderMipMap: 0 + mipMapsPreserveCoverage: 0 + alphaTestReferenceValue: 0.5 + mipMapFadeDistanceStart: 1 + mipMapFadeDistanceEnd: 3 + bumpmap: + convertToNormalMap: 0 + externalNormalMap: 0 + heightScale: 0.25 + normalMapFilter: 0 + isReadable: 0 + streamingMipmaps: 0 + streamingMipmapsPriority: 0 + grayScaleToAlpha: 0 + generateCubemap: 6 + cubemapConvolution: 0 + seamlessCubemap: 0 + textureFormat: 1 + maxTextureSize: 2048 + textureSettings: + serializedVersion: 2 + filterMode: 0 + aniso: 1 + mipBias: -100 + wrapU: 1 + wrapV: 1 + wrapW: -1 + nPOTScale: 0 + lightmap: 0 + compressionQuality: 50 + spriteMode: 1 + spriteExtrude: 1 + spriteMeshType: 1 + alignment: 0 + spritePivot: {x: 0.5, y: 0.5} + spritePixelsToUnits: 100 + spriteBorder: {x: 0, y: 0, z: 0, w: 0} + spriteGenerateFallbackPhysicsShape: 0 + alphaUsage: 0 + alphaIsTransparency: 1 + spriteTessellationDetail: -1 + textureType: 8 + textureShape: 1 + singleChannelComponent: 0 + maxTextureSizeSet: 0 + compressionQualitySet: 0 + textureFormatSet: 0 + platformSettings: + - serializedVersion: 3 + buildTarget: DefaultTexturePlatform + maxTextureSize: 2048 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 1 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + androidETC2FallbackOverride: 0 + forceMaximumCompressionQuality_BC6H_BC7: 1 + - serializedVersion: 3 + buildTarget: Standalone + maxTextureSize: 2048 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 1 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + androidETC2FallbackOverride: 0 + forceMaximumCompressionQuality_BC6H_BC7: 1 + spriteSheet: + serializedVersion: 2 + sprites: [] + outline: [] + physicsShape: [] + bones: [] + spriteID: 5e97eb03825dee720800000000000000 + internalID: 0 + vertices: [] + indices: + edges: [] + weights: [] + secondaryTextures: [] + spritePackingTag: + pSDRemoveMatte: 0 + pSDShowRemoveMatteOption: 0 + userData: + assetBundleName: + assetBundleVariant: diff --git a/LocalPackages/LightingTools.LightmapSwitcher/LICENSE.md b/LocalPackages/LightingTools.LightmapSwitcher/LICENSE.md new file mode 100644 index 0000000..9b38f0f --- /dev/null +++ b/LocalPackages/LightingTools.LightmapSwitcher/LICENSE.md @@ -0,0 +1,5 @@ +[MyPackageName] copyright © [YEAR] Unity Technologies ApS + +Licensed under the Unity Companion License for Unity-dependent projects--see [Unity Companion License](http://www.unity3d.com/legal/licenses/Unity_Companion_License). + +Unless expressly provided otherwise, the Software under this license is made available strictly on an “AS IS” BASIS WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED. Please review the license for details on these and other terms and conditions. diff --git a/LocalPackages/LightingTools.LightmapSwitcher/LICENSE.md.meta b/LocalPackages/LightingTools.LightmapSwitcher/LICENSE.md.meta new file mode 100644 index 0000000..96cef6f --- /dev/null +++ b/LocalPackages/LightingTools.LightmapSwitcher/LICENSE.md.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: e85d55989cd833f4ea31cdc5fb0189d3 +TextScriptImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/LocalPackages/LightingTools.LightmapSwitcher/README.md b/LocalPackages/LightingTools.LightmapSwitcher/README.md new file mode 100644 index 0000000..c597e2b --- /dev/null +++ b/LocalPackages/LightingTools.LightmapSwitcher/README.md @@ -0,0 +1,514 @@ +# UPM Package Starter Kit + +The purpose of this package starter kit is to provide the data structure and development guidelines for new packages meant for the **Unity Package Manager (UPM)**. + +This is the first of many steps towards an automated package publishing experience within Unity. This package starter kit is merely a fraction of the creation, edition, validation, and publishing tools that we will end up with. + +We hope you enjoy your experience. You can use **#devs-packman** on Slack to provide feedback or ask questions regarding your package development efforts. + +## Are you ready to become a package? +The Package Manager is a work-in-progress for Unity and, in that sense, there are a few criteria that must be met for your package to be considered on the package list at this time: +- **Your code accesses public Unity C# APIs only.** If you have a native code component, it will need to ship with an official editor release. Internal API access might eventually be possible for Unity made packages, but not at this time. +- **Your code doesn't require security, obfuscation, or conditional access control.** Anyone should be able to download your package and access the source code. + + +## Package structure + +```none + + ├── package.json + ├── README.md + ├── CHANGELOG.md + ├── LICENSE.md + ├── Third Party Notices.md + ├── QAReport.md + ├── Editor + │ ├── Unity.[YourPackageName].Editor.asmdef + │ └── EditorExample.cs + ├── Runtime + │ ├── Unity.[YourPackageName].asmdef + │ └── RuntimeExample.cs + ├── Tests + │ ├── .tests.json + │ ├── Editor + │ │ ├── Unity.[YourPackageName].Editor.Tests.asmdef + │ │ └── EditorExampleTest.cs + │ └── Runtime + │ ├── Unity.[YourPackageName].Tests.asmdef + │ └── RuntimeExampleTest.cs + ├── Samples + │ └── Example + │ ├── .sample.json + │ └── SampleExample.cs + └── Documentation~ + ├── your-package-name.md + └── Images +``` + +## Develop your package +Package development works best within the Unity Editor. Here's how to set that up: + +1. Clone the Package Starter Kit repository locally. + + - In a console (or terminal) application, choose a place to clone the repository and enter the following: + ``` + git clone git@github.cds.internal.unity3d.com:unity/com.unity.package-starter-kit.git + ``` + +1. Create a new repository for your package and clone to your desktop. + + - On Github.cds create a new repository with the name of your package (Example: `"com.unity.terrain-builder"`). + + - In a console (or terminal) application, choose a place to clone the repository and perform the following: + ``` + git clone git@github.cds.internal.unity3d.com:unity/com.unity.[your-package-name] + ``` + +1. Copy the contents of the Package Starter Kit folder to your new package. Be careful not to copy the Package Starter Kit *.git* folder over. + +1. **Fill in your package information.** + + Follow the instructions for [filling out your package manifest](#fill-out-your-package-manifest) (*package.json*). + + Then update the `"createSeparatePackage"` field in the *Tests/.tests.json* file to set up testing for Continuous Integration (CI): + + * Set it to false if you want the tests to remain part of the published package. This is the default value. + + * Set it to true if you want the CI to create a separate package for these tests, and add the metadata at publish time to link the packages together. This allows you to have a large number of tests, or assets, etc. that you don't want to include in your main package, while making it easy to test your package with those tests & fixtures. + +1. Start **Unity**, create a local empty project and import your package into the project. + +1. In a console (or terminal) application, push the package starter kit files you copied in your new package repository to its remote. + - Add them to your repository's list to version + ```git add .``` + - Commit to your new package's remote master + ```git commit``` + - Push to your new package's remote master + ```git push``` + +1. Restart **Unity**. This forces the Package Manager to rescan your project so that it can find the new package that you just embedded. For more information on embedded packages see [Confluence](https://confluence.hq.unity3d.com/display/PAK/How+to+embed+a+package+in+your+project). + +1. **Update the *README.md* file.** + + It should contain all pertinent information for developers using your package, such as: + + * Prerequistes + * External tools or development libraries + * Required installed Software + * Command line examples to build, test, and run your package. + +1. **Rename and update your documentation file(s).** + + Use the samples included in this starter kit to create preliminary, high-level documentation. Your documentation should introduce users to the features and sample files included in your package. For more information, see [Document your package](#document-your-package). + +1. **Rename and update assembly definition files.** + + + Choose a name schema to ensure that the name of the assembly built from the assembly definition file (_.asmdef_) will follow the .Net [Framework Design Guidelines](https://docs.microsoft.com/en-us/dotnet/standard/design-guidelines/index). For more information, see [Name your assembly definition files](#name-your-assembly-definition-files). + +1. **Add samples to your package (code & assets).** + + The Package Manager recognizes the *Samples* directory in a package but does not import samples into Unity when the package is added to a project by default. Users can import samples into their */Assets* directory by clicking the **Import in project** button from the [Details view](https://docs.unity3d.com/Manual/upm-ui-details.html) of your package in the Package Manager window. + + If your package contains a sample: + + * Rename the *Samples/Example* folder, and update the *.sample.json* file in it. + + * If your package contains multiple samples, make a copy of the *Samples/Example* folder for each sample, and update each *.sample.json* file accordingly. + + Delete the *Samples* folder altogether if your package does not need samples. + +1. **Validate your package using the Validation Suite.** + + Before you publish your package, you need to make sure that it passes all the necessary validation checks by using the [Package Validation Suite](https://github.cds.internal.unity3d.com/unity/com.unity.package-validation-suite) extension. This is *required*. + + For more information, see [Validate your package](#validate-your-package). + +1. **Follow our design guidelines** + + Follow these design guidelines when creating your package: + + * The [package design standards](https://confluence.hq.unity3d.com/display/UX/Packages) on Confluence. + + * The [design checklist](https://unitytech.github.io/unityeditor-hig/topics/checklist.html) from Unity's Human Interface Guidelines. + + * The namespace for code in the asmdef *must* match the asmdef name, except the initial `Unity`, which should be replaced with `UnityEngine` or `UnityEditor`. + + * For **Runtime code**, only use the `Unity` namespace for code that has no dependency on anything in `UnityEngine` or `UnityEditor` and instead uses `ECS` and other `Unity`-namespace systems. + +1. **Add tests to your package.** + + For **Editor tests**: + * Write all your Editor Tests in *Tests/Editor* + * If your tests require access to internal methods, add an *AssemblyInfo.cs* file to your Editor code and use `[assembly: InternalsVisibleTo("Unity.[YourPackageName].Editor.Tests")]`. + + For **Playmode Tests**: + * Write all your Playmode Tests in *Tests/Runtime*. + * If your tests require access to internal methods, add an *AssemblyInfo.cs* file to your Runtime code and use `[assembly: InternalsVisibleTo("Unity.[YourPackageName].Tests")]`. + +1. **Setup your package CI.** + + Make sure your package continues to work against trunk or any other branch by setting up automated testing on every commit. See the [Confluence page](https://confluence.hq.unity3d.com/display/PAK/Setting+up+your+package+CI) that explains how to set up your package CI. + + This starter kit contains the minimum recommended workflow for package CI, which provides the barebones to: `pack`, `test` and `publish` your packages. It also contains the required configuration to `promote` your **preview** packages to production. + +1. **Update *CHANGELOG.md*.** + + Every new feature or bug fix should have a trace in this file. For more details on the chosen changelog format, see [Keep a Changelog](http://keepachangelog.com/en/1.0.0/). + + + +### Fill out your package manifest + +1. Update the following required fields in file *package.json* (see [Confluence](https://confluence.hq.unity3d.com/pages/viewpage.action?pageId=39065257) for more information): + + | **Attribute name** | **Description** | + |:---|:---| + | `"name"` | Set the package name, following this naming convention: `"com.unity.[your-package-name]"`, without capital letters. For example, `"com.unity.2d.animation"`. | + | `"displayName"` | Set the package's user-friendly display name. For example, `"Terrain Builder SDK"`.

__Note:__ Use a display name that will help users understand what your package is intended for. | + | `"version"` | Set the package version in `"X.Y.Z"` format, following these [Semantic Versioning](http://semver.org/spec/v2.0.0.html) guidelines:
- To introduce a breaking API change, increment the major version (**X**.Y.Z).
- To introduce a new feature, increment the minor version (X.**Y**.Z).
- To introduce a bug fix, increment the patch version (X.Y.**Z**) | + | `"unity"` | Set the Unity version your package is compatible with. For example: `"2018.1"`. | + | `"unityRelease"` | Specify the Unity patch release your package is compatible with. For example: `"0a8"`.

__Note:__ This field is only required when the specific Unity version has a patch release. | + | `"description"` | This description appears in the Package Manager window when the user selects this package from the list. For best results, use this text to summarize what the package does and how it can benefit the user.

Special formatting characters are supported, including line breaks (`\n`) and unicode characters such as bullets (`\u25AA`). For more information, see the [Writing Package docs](https://confluence.hq.unity3d.com/display/DOCS/Writing+Package+docs) page on Confluence. | + +1. Update the following recommended fields in file **package.json**: + + | **Attribute name** | **Description** | + |:---|:---| + | `"dependencies"` | List of packages this package depends on. All dependencies will also be downloaded and loaded in a project with your package. Here's an example:

`dependencies: {`
    `"com.unity.ads": "1.0.0",`
    `"com.unity.analytics": "2.0.0"`
`}` | + | `"keywords"` | An array of keywords related to the package. This field is currently purely informational. | + | `"type"` | The type of your package. This is used to determine the visibility of your package in the Project Browser and the visibility of its Assets in the Object Picker. The `"tool"` and `"library"` types are used to set your package and its Assets as hidden by default. If not present or set to another value, your package and its Assets are visible by default. | + | `"hideInEditor"` | A boolean value that overrides the package visibility set by the package type. If set to `false`, the default value, your package and its Assets are **always** visible by default; if set to `true`, your package and its Assets are **always** hidden by default. | + + **Notes**: + - For packages in development, neither `"type"` nor `"hideInEditor"` are used. The package is **always** visible in the Project Browser and its Assets are **always** visible in the Object Picker. + - The user is **always** able to toggle the package visibility in the Project Browser, as well as their Assets visibility in the Object Picker. + +### Document your package + +You need to document your public APIs and provide task-oriented documentation for your features: + +1. Document all of [your public APIs](#document-your-public-apis) and [your features](#document-your-features). +2. [Test your documentation locally](#test-your-documentation-locally). +3. [Get your documentation published](#get-your-documentation-published). + +Your package should include the documentation source in your package, but not the generated HTML. + +The page in the user manual that links to package documentation is [Packages documentation](http://docs.hq.unity3d.com/Documentation/Manual/PackagesList.html). + +#### Document your public APIs + +API documentation is generated from any [XmlDoc tagged comments](https://docs.microsoft.com/en-us/dotnet/csharp/programming-guide/xmldoc/xml-documentation-comments) found in the *.cs* files included in the package. + +You can use Visual Studio to autogenerate the correct tags by entering the documentation comments (`///`) in the empty line above your code. Visual Studio automatically detects which tags your code needs and inserts them. For example, if you write a method with two parameters that returns a value, Visual Studio gives you the **summary** tag (for the method description), two **param** tags, and one **returns** tag: + +```c# +/// +/// +/// +/// +/// +/// +public bool TestingXmlDoc(int One, int Two) +{ + +} +``` + +See the [Editor/EditorExample.cs](Editor/EditorExample.cs) file in this package for examples of how to document classes, methods, properties, and enums. + +You need to document all public APIs. If you don't need an API to be accessed by clients, mark it as internal instead: + +1. Add a custom *filter.yml* file to the package *Documentation~* folder. + +2. Add these rules to your custom *filter.yml* file. These rules make the DocFX configuration consistent with packages that don't have a custom filter: + + ```yaml + apiRules: + - exclude: + # inherited Object methods + uidRegex: ^System\.Object\..*$ + type: Method + - exclude: + # mentioning types from System.* namespace + uidRegex: ^System\..*$ + type: Type + - exclude: + hasAttribute: + uid: System.ObsoleteAttribute + type: Member + - exclude: + hasAttribute: + uid: System.ObsoleteAttribute + type: Type + ``` + +3. Specify classes to exclude by UID or by specifying regular expressions. For information about the rules for the filters, see the [DocFX guide](https://dotnet.github.io/docfx/tutorial/howto_filter_out_unwanted_apis_attributes.html). + +#### Document your features + +Write the Manual documentation using [GitHub-flavored Markdown](https://github.com/adam-p/markdown-here/wiki/Markdown-Cheatsheet) in *.md* files stored under the *Documentation~* folder. The *Documentation~* folder is suffixed with `~` to prevent its contents from being loaded in the Editor (recommended). Alternatively, you could use *.Documentation* for the folder name. + +This preliminary, high-level documentation should introduce users to the features and sample files included in your package. + +All packages that expose UI in editor or runtime features should use one of the appropriate documentation example guides under the *Documentation~* folder: + +* [tools-package-guide.md](Documentation~/tools-package-guide.md) for a package that includes features that augment the Unity Editor or Runtime (modules, tools, and libraries) +* [sample-package-guide.md](Documentation~/sample-package-guide.md) for a package that includes sample files +* [test-package-guide.md](Documentation~/test-package-guide.md) for a package that provides tests + +For instructions, see the [documentation guidelines](Documentation~/index.md). + +#### Test your documentation locally + +As you are developing your documentation, you can see what your documentation will look like by using the DocTools package: **com.unity.package-manager-doctools** (optional). + +Once the DocTools package is installed, it displays a **Generate Documentation** button in the Package Manager window's Details view for any installed or embedded packages. To install the extension, see [Installing the DocTools package](https://confluence.hq.unity3d.com/display/DOCS/Package+documentation+with+Git#PackagedocumentationwithGit-InstallingDocTools) on Confluence. + +The DocTools extension is still in preview, if you come across arguable results, please discuss them on **#docs-packman**. + +#### Get your documentation published + +When the documentation is complete, notify the technical writer assigned to your team or project. If you don't know which technical writer is assigned, fill out the [Package Docs Questions](https://docs.google.com/document/d/1vI0zbNX9OausEwYhg_kl9CIDNf4taExjON0fyp2cHS0) form, [log a JIRA DOC ticket](https://unity3d.atlassian.net/secure/CreateIssue!default.jspa?selectedProjectId=12200&issuetype=3) and attach the form to that ticket. + +You can also ask for help or clarification on **#devs-documentation**. + +> **Note:** The package will remain in **preview** mode until the final documentation is completed. Users will have access to the developer-generated documentation only in preview packages. + +After the technical writer reviews the documentation, they will create a pull request in the package git repository. The package's development team will then need to submit a new package version with the updated docs. + + + +### Name your assembly definition files + +If your package contains Editor code, rename and modify [Editor/Unity.YourPackageName.Editor.asmdef](Editor/Unity.YourPackageName.Editor.asmdef). Otherwise, delete the *Editor* directory. + +* Name **must** match your package name, suffixed by `.Editor` (for example, `Unity.[YourPackageName].Editor`). +* Assembly **must** reference `Unity.[YourPackageName]` (if you have any runtime code). +* Platforms **must** include `"Editor"`. + +If your package contains code that needs to be included in Unity runtime builds, rename and modify [Runtime/Unity.YourPackageName.asmdef](Runtime/Unity.YourPackageName.asmdef). Otherwise, delete the *Runtime* directory. + +* Name **must** match your package name (for example,`Unity.[YourPackageName]`) + +If your package has Editor code, you **must** have Editor Tests. In that case, rename and modify [Tests/Editor/Unity.YourPackageName.Editor.Tests.asmdef](Tests/Editor/Unity.YourPackageName.Editor.Tests.asmdef). + +* Name **must** match your package name, suffixed by `.Editor.Tests` (for example, `Unity.[YourPackageName].Editor.Tests`) +* Assembly **must** reference `Unity.[YourPackageName].Editor` and `Unity.[YourPackageName]` (if you have any Runtime code). +* Platforms **must** include `"Editor"`. +* Optional Unity references **must** include `"TestAssemblies"` to allow your Editor Tests to show up in the Test Runner or run on Katana when your package is listed in the project manifest's `testables` field. + +If your package has Runtime code, you **must** have Playmode Tests. In that case, rename and modify [Tests/Runtime/Unity.YourPackageName.Tests.asmdef](Tests/Runtime/Unity.YourPackageName.Tests.asmdef). + +* Name **must** match your package name, suffixed by `.Tests` (for example, `Unity.[YourPackageName].Tests`) +* Assembly **must** reference `Unity.[YourPackageName]`. +* Optional Unity references **must** include `"TestAssemblies"` to allow your Playmode Tests to show up in the Test Runner or run on Katana when your package is listed in the project manifest's `testables` field. + + + +### Validate your package + +To install the extension, follow these steps: + +1. Make sure you have `Package Manager UI v1.9.6` or above. + +2. Make sure your project manifest points to the Candidates registry, which you can do by changing the **registry** line to: + + ```json + "registry": "https://artifactory.prd.cds.internal.unity3d.com/artifactory/api/npm/upm-candidates" + ``` + +3. From the Package Manager window, install the latest version of the **Package Validation Suite** with the scope set to **All Packages**. If you don't see it in the list, make sure **Advanced** > **Show preview packages** is enabled. + +Once the Validation Suite package is installed, a **Validate** button appears in the details pane when you select your installed package from the Package Manager window. + +To run the tests: + +1. Click the **Validate** button to run a series of tests. A **See Results** button appears after the test run. +2. Click the **See Results** button for additional explanation: + * If it succeeds, a green bar displays a **Success** message. + * If it fails, a red bar displays a **Failed** message. + +The validation suite is still in preview, so if you come across arguable results, please discuss them on **#devs-packman**. + + + +## Create a Pre-Release Package +Pre-Release Packages are a great way of getting your features in front of Unity Developers in order to get early feedback on functionality and UI designs. Pre-Release packages need to go through the publishing to production flow, as would any other package, but with diminished requirements: + + * Expected Package structure respected + * Package loads in Unity Editor without errors + * License file present - With third party notices file if necessary + * Test coverage is good - Optional but preferred + * Public APIs documented, minimal feature docs exists- Optional but preferred + +The only supported Pre-Release tag is **preview** which you suffix to the version number of the package in the *package.json* manifest file. For example: + +```json +"version" : "1.2.0-preview" +``` + + + +## Register your package + +If you think you are working on a feature that is a good package candidate, please take a minute to tell Release Management about it in the **#devs-pkg-promotion** channel. + +Working with the board of dev directors and with product management, we will schedule the entry of the candidates in the ecosystem, based on technical challenges and on our feature roadmap. +Don’t hesitate to reach out and join us on **#devs-packman** on Slack. + +## Share your package + +If you want to share your project with other developers, the steps are similar to what's presented above. On the other developer's machine: + +1. Start **Unity** and create a local empty project. + +1. Launch the console (or terminal) application, navigate to the newly created project folder, and then clone your repository in the `Packages` directory: + + ```shell + cd /Packages + git clone https://github.cdsinternal.unity3d.com/unity/[your-package-name].git com.unity.[sub-group].[your-package-name] + ``` + > __Note:__ Your directory name must be the name of your package (Example: `"com.unity.terrain-builder"`). + +## Make sure your package meets all legal requirements + +All packages must COMPLETE AND SUBMIT [THIS FORM](https://docs.google.com/forms/d/e/1FAIpQLSe3H6PARLPIkWVjdB_zMvuIuIVtrqNiGlEt1yshkMCmCMirvA/viewform) to receive approval. It is a simple, streamlined form that tells legal if there are any potential issues that need to be addressed prior to publication. + +If your package has third-party elements and its licenses are approved, then all the licenses must be added to the **Third Party Notices.md** file. If you have more than one license, duplicate the `Component Name/License Type/Provide License Details` section for each additional license. + +> **Note:** A URL can work as long as it actually points to the reproduced license and the copyright information _(if applicable)_. + +If your package does not have third party elements, you can remove the *Third Party Notices.md* file from your package. + +## Preparing your package for the Candidates registry + +Before publishing your package to production, you must send your package on the Package Manager's internal **candidates** repository. The candidates repository is monitored by QA and release management, and is where package validation will take place before it is accepted in production. + +1. Publishing your changes to the Package Manager's **Candidates** registry happens from Github.cds. To do so, set up your project's Continuous integration (CI), which will be triggered by "Tags" on your branches. + + For information see [the Confluence page](https://confluence.hq.unity3d.com/display/PAK/Setting+up+your+package+CI) that describes how to set up CI for your package. + +1. Test your package locally. Once your package is published on the **Candidates** registry, you can test your package in the editor by creating a new project, and editing the project's *manifest.json* file to point to your candidate package: + + ```json + dependencies: { + "com.unity.[sub-group].[your-package-name]": "0.1.0" + }, + "registry": "https://artifactory.prd.cds.internal.unity3d.com/artifactory/api/npm/upm-candidates" + ``` + +## Get your package published to Production + +Packages are promoted to the **Production** registry from the **Candidates** registry, as described above. Your package must meet [certain criteria](https://docs.google.com/document/d/1TSnlSKJ6_h0C-CYO2LvV0fyGxJvH6OxC2-heyN8o-Gw/edit#heading=h.xxfb5jk2jda2) before you can submit a request to promote a package to production. + +Once you feel comfortable that your package meets the list of Release Management Criteria, ask to be promoted from candidates to production by going to **#devs-pkg-promotion**. + +Also, once you have a package in production for a few versions and it was used by real users, you can ask to be whitelisted to appear in the Package Manager window. Your package will not be visible in the Package Manager window until it is published AND whitelisted by Release Management. + +**_Release management will validate your package content, and check that the editor/playmode tests pass before promoting the package to production._** + +### Verified status and bundled packages +If your package is meant to ship with a release of the editor (**Verified Packages** and **Bundled Packages**), follow these steps: +1. To be marked as verified, in trunk, modify the editor manifest (*[root]\External\PackageManager\Editor\manifest.json*) to include your package in the **verified** list. + +1. If your package is not verified, but only bundled with the editor, submit one or more Test Project(s) in Ono, so that your new package can be tested in all ABVs moving forward. + + The following steps will create a test project that will run in ABVs, load your package into the project, and run all the tests found in your package. The better your test coverage, the more confident you'll be that your package works with trunk. + + * Create a branch in Ono, based on the latest branch this package must be compatible with (trunk, or release branch). + * If your package contains **Editor Tests**: + * In *[root]\Tests\Editor.Tests*, create a new EditorTest Project (for new packages use **YourPackageName**) or use an existing project (for new versions of existing package). + + To get a bare package for an EditorTest Project, click [here](https://oc.unity3d.com/index.php/s/Cldvuy6NpxqYy8y). + + * Modify the project’s *manifest.json* file to include the production version of the package (`name@version`). + + * Your project's *manifest.json* file should contain the following line: + + ```json + "testables" : [ "com.unity.[sub-group].[your-package-name]" ] + ``` + * If your package contains **PlaymodeTests**: + * In *[root]\Tests\PlaymodeTests*, create a new PlaymodeTest Project (for new packages use **YourPackageName**) or use an existing project (for new versions of existing package). + + * Modify the project’s *manifest.json* file to include the candidate version of the package (`name@version`). + + * Your project's manifest.json file should contain the following line: + + ```json + "testables" : [ "com.unity.[sub-group].[your-package-name]" ] + ``` + + * Commit your branch changes to Ono, and run all Windows & Mac Editor/PlayMode tests (not full ABV) in Katana. + +1. Once the tests are green on Katana, create your PR, add both **Latest Release Manager** and **Trunk Merge Queue** as reviewers. + + +## FAQ + +**What’s the difference between a preview package and a verified package?** + +A preview package is a great way to develop and get feedback on new features and functionality. Preview package can be created against any version of Unity 2018.1+, and can be made discoverable through the Package Manager UI by issuing a request in #devs-packman. Quality and release schedule is up to the package owner, although minimum bars are set in place to ensure the package contains the right licenses, documentation, and a comprehensive set of tests. + +Once a preview package has been in the field for 2-3 release cycles of the editor, that package can be considered for Verification. Verified packages are tested with a specific version of the editor, and offer our users a compatibility guarantee. Verified packages are the only packages that can be included in the set of templates we ship with the editor (Verified Templates). Code for these packages must follow core development guidelines, including code cutoff dates, and are tested in katana for continued compatibility. + +**What’s the difference between a core package and a default package?** + +A core package is a package that has its code included with the Editor’s core code. This is interesting for packages that plan to change enormously in parallel to editor APIs. By moving package code to the editor’s repo, both core API\functionality changes can be made along with required packages changes in the same PR. +https://docs.google.com/document/d/1CMoanjR3KAdew-6n39JdCFmHkTp1oshs3vkpejapf4Q/edit + +A default package is a verified package that gets installed with every new project users create, regardless of the template they use. We should limit the number of default packages we support, as each default package adds to the project loading time. The list of default packages can be found in the editor manifest (https://ono.unity3d.com/unity/unity/files/de904b9ed9b44580ecd1e883f510daaa08182cc5/External/PackageManager/Editor/manifest.json). + +**What are the requirement for me to publish a preview package?** + +https://docs.google.com/document/d/1epGkAJRayJLN89_weA_-G5LFT_1uFifFZqBzAgvp_Zs/ + + +**What are the requirements for me to get my package verified for a version of unity?** + +https://docs.google.com/document/d/1oWC9XArVfkGMnqN9azR4hW4Pcd7-kQQw8Oy7ckP43JE/ + +**How is my verified package tested in Katana?** + +https://docs.google.com/document/d/1jwTh71ZGtB2vF0SsHEwivt2FunaJWMGDdQJTpYRj3EE/edit + +**How is my template tested in Katana?** + +https://docs.google.com/document/d/1jwTh71ZGtB2vF0SsHEwivt2FunaJWMGDdQJTpYRj3EE/edit + +**How do I add samples to my package?** + +https://docs.google.com/document/d/1rmxGh6Z9gtbQlGUKCsVBaR0RyHvzq_gsWoYs6sttzYA/edit#heading=h.fg1e3sz56048 + +**How do I setup CI or publishing options for my package?** +https://confluence.hq.unity3d.com/display/PAK/Setting+up+your+package+CI + +**How can I add tests to my package?** + +There’s a “Tests” directory in the package starter kit. If you add editor and playmode tests in that directory, they will make up the list of tests for your package. + +**The tests in my package bloat my package too much, what are my options?** + +https://docs.google.com/document/d/19kKIGFetde5ES-gKXQp_P7bxQ9UgBnBUu58-y7c1rTA/edit + +**Can I automate my package publishing yet?** + +Not just yet, but we’re working on it. The first automated publishing we will enable is the push to production for preview packages. Basically, when your package passes validation (loads in the editor without error, the tests in the package pass, validation suite run success), the package will be pushed to production automatically. Other publishing flows will soon be available as well, here’s the full list of internal package publishing flows Unity will support. https://docs.google.com/document/d/1zdMzAtfi-vgM8NMPmwL40yinBeL3YImwTO5gSfGNCgs/edit + +**How do I get a template package started?** + +Start with the Project Template Starter Kit (you can request access in **#devs-packman**). +https://github.cds.internal.unity3d.com/unity/com.unity.template-starter-kit + +**How do I get my package included in a template?** + +First and foremost, your package needs to be on the verified list of packages. Only verified packages can get added to templates we ship with the editor. Then reach out to the templates community in **#devs-template** to open discussions on adding your package to one or more of our existing templates. + +**How can I test my package locally, as a user would?** + +https://confluence.hq.unity3d.com/display/PAK/How+to+add+a+git+package+to+your+project + +**What tests are included by the validation suite?** + +https://docs.google.com/spreadsheets/d/1CdO7D0WSirbZhjnVsdJxJwOPK4UdUDxSRBIqwyjm70w/edit#gid=0 diff --git a/LocalPackages/LightingTools.LightmapSwitcher/README.md.meta b/LocalPackages/LightingTools.LightmapSwitcher/README.md.meta new file mode 100644 index 0000000..20a04ec --- /dev/null +++ b/LocalPackages/LightingTools.LightmapSwitcher/README.md.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: fbde06cfbf0952043b92f05755959f4c +TextScriptImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/LocalPackages/net.peeweek.gameplay-ingredients/Runtime/LevelStreaming.meta b/LocalPackages/LightingTools.LightmapSwitcher/Runtime.meta similarity index 77% rename from LocalPackages/net.peeweek.gameplay-ingredients/Runtime/LevelStreaming.meta rename to LocalPackages/LightingTools.LightmapSwitcher/Runtime.meta index c4b2c77..d5212d0 100644 --- a/LocalPackages/net.peeweek.gameplay-ingredients/Runtime/LevelStreaming.meta +++ b/LocalPackages/LightingTools.LightmapSwitcher/Runtime.meta @@ -1,5 +1,5 @@ fileFormatVersion: 2 -guid: 4187919837946ea479e9dd7d67ba328c +guid: 025606af85fbe2846b479c744861150a folderAsset: yes DefaultImporter: externalObjects: {} diff --git a/LocalPackages/LightingTools.LightmapSwitcher/Runtime/LevelLightmapData.cs b/LocalPackages/LightingTools.LightmapSwitcher/Runtime/LevelLightmapData.cs new file mode 100644 index 0000000..e0ce627 --- /dev/null +++ b/LocalPackages/LightingTools.LightmapSwitcher/Runtime/LevelLightmapData.cs @@ -0,0 +1,383 @@ +using UnityEngine; +using UnityEngine.SceneManagement; +using System; +using System.Collections.Generic; +using UnityEngine.Rendering; +using System.Collections; +#if UNITY_EDITOR +using UnityEditor; +#endif + +[ExecuteInEditMode] +public class LevelLightmapData : MonoBehaviour +{ + [System.Serializable] + public class SphericalHarmonics + { + public float[] coefficients = new float[27]; + } + + [System.Serializable] + public class RendererInfo + { + public Renderer renderer; + public int lightmapIndex; + public Vector4 lightmapOffsetScale; + } + + [System.Serializable] + public class LightingScenarioData { + public RendererInfo[] rendererInfos; + public Texture2D[] lightmaps; + public Texture2D[] lightmapsDir; + public Texture2D[] shadowMasks; + public LightmapsMode lightmapsMode; + public SphericalHarmonics[] lightProbes; + public bool hasRealtimeLights; + } + + public bool latestBuildHasReltimeLights; + public bool allowLoadingLightingScenes = true; + + [SerializeField] + List lightingScenariosData; + +#if UNITY_EDITOR + [SerializeField] + public List lightingScenariosScenes; +#endif + [SerializeField] + public String[] lightingScenesNames = new string[1]; + public int currentLightingScenario = -1; + public int previousLightingScenario = -1; + + private Coroutine m_SwitchSceneCoroutine; + + [SerializeField] + public int lightingScenariosCount; + + //TODO : enable logs only when verbose enabled + public bool verbose = false; + + private List lightProbesRuntime = new List(); + + public void LoadLightingScenario(int index) + { + if(index != currentLightingScenario) + { + previousLightingScenario = currentLightingScenario == -1 ? index : currentLightingScenario; + + currentLightingScenario = index; + + LightmapSettings.lightmapsMode = lightingScenariosData[index].lightmapsMode; + + if(allowLoadingLightingScenes) + m_SwitchSceneCoroutine = StartCoroutine(SwitchSceneCoroutine(lightingScenesNames[previousLightingScenario], lightingScenesNames[currentLightingScenario])); + + var newLightmaps = LoadLightmaps(index); + + ApplyRendererInfo(lightingScenariosData[index].rendererInfos); + + LightmapSettings.lightmaps = newLightmaps; + + LoadLightProbes(currentLightingScenario); + } + } + + private void Start() + { + PrepareLightProbeArrays(); + } + + private void PrepareLightProbeArrays() + { + for (int x = 0; x < lightingScenariosCount; x++) + { + lightProbesRuntime.Add(DeserializeLightProbes(x)); + } + } + + private SphericalHarmonicsL2[] DeserializeLightProbes(int index) + { + var sphericalHarmonicsArray = new SphericalHarmonicsL2[lightingScenariosData[index].lightProbes.Length]; + + for (int i = 0; i < lightingScenariosData[index].lightProbes.Length; i++) + { + var sphericalHarmonics = new SphericalHarmonicsL2(); + + // j is coefficient + for (int j = 0; j < 3; j++) + { + //k is channel ( r g b ) + for (int k = 0; k < 9; k++) + { + sphericalHarmonics[j, k] = lightingScenariosData[index].lightProbes[i].coefficients[j * 9 + k]; + } + } + + sphericalHarmonicsArray[i] = sphericalHarmonics; + } + return sphericalHarmonicsArray; + } + + IEnumerator SwitchSceneCoroutine(string sceneToUnload, string sceneToLoad) + { + AsyncOperation unloadop = null; + AsyncOperation loadop = null; + + if (sceneToUnload != null && sceneToUnload != string.Empty && sceneToUnload != sceneToLoad) + { + unloadop = SceneManager.UnloadSceneAsync(sceneToUnload); + while (!unloadop.isDone) + { + yield return new WaitForEndOfFrame(); + } + } + + if(sceneToLoad != null && sceneToLoad != string.Empty && sceneToLoad != "") + { + loadop = SceneManager.LoadSceneAsync(sceneToLoad, LoadSceneMode.Additive); + while ((!loadop.isDone || loadop == null)) + { + yield return new WaitForEndOfFrame(); + } + SceneManager.SetActiveScene(SceneManager.GetSceneByName(sceneToLoad)); + } + LoadLightProbes(currentLightingScenario); + } + + LightmapData[] LoadLightmaps(int index) + { + if (lightingScenariosData[index].lightmaps == null + || lightingScenariosData[index].lightmaps.Length == 0) + { + Debug.LogWarning("No lightmaps stored in scenario " + index); + return null; + } + + var newLightmaps = new LightmapData[lightingScenariosData[index].lightmaps.Length]; + + for (int i = 0; i < newLightmaps.Length; i++) + { + newLightmaps[i] = new LightmapData(); + newLightmaps[i].lightmapColor = lightingScenariosData[index].lightmaps[i]; + + if (lightingScenariosData[index].lightmapsMode != LightmapsMode.NonDirectional) + { + newLightmaps[i].lightmapDir = lightingScenariosData[index].lightmapsDir[i]; + } + if (lightingScenariosData[index].shadowMasks.Length > 0) + { + newLightmaps[i].shadowMask = lightingScenariosData[index].shadowMasks[i]; + } + } + + return newLightmaps; + } + + public void ApplyRendererInfo(RendererInfo[] infos) + { + try + { + Terrain terrain = FindObjectOfType(); + int i = 0; + if (terrain != null) + { + terrain.lightmapIndex = infos[i].lightmapIndex; + terrain.lightmapScaleOffset = infos[i].lightmapOffsetScale; + i++; + } + + for (int j = i; j < infos.Length; j++) + { + RendererInfo info = infos[j]; + //if (info.renderer == null) + //continue; + info.renderer.lightmapIndex = infos[j].lightmapIndex; + if (!info.renderer.isPartOfStaticBatch) + { + info.renderer.lightmapScaleOffset = infos[j].lightmapOffsetScale; + } + if (info.renderer.isPartOfStaticBatch && verbose == true && Application.isEditor) + { + Debug.Log("Object " + info.renderer.gameObject.name + " is part of static batch, skipping lightmap offset and scale."); + } + } + } + catch (Exception e) + { + Debug.LogError("Error in ApplyRendererInfo:" + e.GetType().ToString()); + } + } + + public void LoadLightProbes(int index) + { + if (Application.isEditor && !Application.isPlaying) + { + PrepareLightProbeArrays(); + } + + try + { + LightmapSettings.lightProbes.bakedProbes = lightProbesRuntime[index]; + } + catch { Debug.LogWarning("Warning, error when trying to load lightprobes for scenario " + index); } + } + + public void StoreLightmapInfos(int index) + { + var newLightingScenarioData = new LightingScenarioData (); + var newRendererInfos = new List(); + var newLightmapsTextures = new List(); + var newLightmapsTexturesDir = new List(); + var newLightmapsMode = new LightmapsMode(); + var newSphericalHarmonicsList = new List(); + var newLightmapsShadowMasks = new List(); + + newLightmapsMode = LightmapSettings.lightmapsMode; + + GenerateLightmapInfo(gameObject, newRendererInfos, newLightmapsTextures, newLightmapsTexturesDir, newLightmapsShadowMasks, newLightmapsMode); + + newLightingScenarioData.lightmapsMode = newLightmapsMode; + + newLightingScenarioData.lightmaps = newLightmapsTextures.ToArray(); + + if (newLightmapsMode != LightmapsMode.NonDirectional) + { + newLightingScenarioData.lightmapsDir = newLightmapsTexturesDir.ToArray(); + } + + //Mixed or realtime support + newLightingScenarioData.hasRealtimeLights = latestBuildHasReltimeLights; + + newLightingScenarioData.shadowMasks = newLightmapsShadowMasks.ToArray(); + + newLightingScenarioData.rendererInfos = newRendererInfos.ToArray(); + + var scene_LightProbes = new SphericalHarmonicsL2[LightmapSettings.lightProbes.bakedProbes.Length]; + scene_LightProbes = LightmapSettings.lightProbes.bakedProbes; + + for (int i = 0; i < scene_LightProbes.Length; i++) + { + var SHCoeff = new SphericalHarmonics(); + + // j is coefficient + for (int j = 0; j < 3; j++) + { + //k is channel ( r g b ) + for (int k = 0; k < 9; k++) + { + SHCoeff.coefficients[j*9+k] = scene_LightProbes[i][j, k]; + } + } + + newSphericalHarmonicsList.Add(SHCoeff); + } + + newLightingScenarioData.lightProbes = newSphericalHarmonicsList.ToArray (); + + if (lightingScenariosData.Count < index + 1) + { + lightingScenariosData.Insert(index, newLightingScenarioData); + } + else + { + lightingScenariosData[index] = newLightingScenarioData; + } + + lightingScenariosCount = lightingScenariosData.Count; + + if (lightingScenesNames == null || lightingScenesNames.Length< lightingScenariosCount) + { + lightingScenesNames = new string[lightingScenariosCount]; + } + } + + static void GenerateLightmapInfo(GameObject root, List newRendererInfos, List newLightmapsLight, List newLightmapsDir, List newLightmapsShadow, LightmapsMode newLightmapsMode) + { + Terrain terrain = FindObjectOfType(); + if (terrain != null && terrain.lightmapIndex != -1 && terrain.lightmapIndex != 65534) + { + RendererInfo terrainRendererInfo = new RendererInfo(); + terrainRendererInfo.lightmapOffsetScale = terrain.lightmapScaleOffset; + + Texture2D lightmaplight = LightmapSettings.lightmaps[terrain.lightmapIndex].lightmapColor; + terrainRendererInfo.lightmapIndex = newLightmapsLight.IndexOf(lightmaplight); + if (terrainRendererInfo.lightmapIndex == -1) + { + terrainRendererInfo.lightmapIndex = newLightmapsLight.Count; + newLightmapsLight.Add(lightmaplight); + } + + if (newLightmapsMode != LightmapsMode.NonDirectional) + { + Texture2D lightmapdir = LightmapSettings.lightmaps[terrain.lightmapIndex].lightmapDir; + terrainRendererInfo.lightmapIndex = newLightmapsDir.IndexOf(lightmapdir); + if (terrainRendererInfo.lightmapIndex == -1) + { + terrainRendererInfo.lightmapIndex = newLightmapsDir.Count; + newLightmapsDir.Add(lightmapdir); + } + } + if (LightmapSettings.lightmaps[terrain.lightmapIndex].shadowMask != null) + { + Texture2D lightmapShadow = LightmapSettings.lightmaps[terrain.lightmapIndex].shadowMask; + terrainRendererInfo.lightmapIndex = newLightmapsShadow.IndexOf(lightmapShadow); + if (terrainRendererInfo.lightmapIndex == -1) + { + terrainRendererInfo.lightmapIndex = newLightmapsShadow.Count; + newLightmapsShadow.Add(lightmapShadow); + } + } + newRendererInfos.Add(terrainRendererInfo); + + if (Application.isEditor) + Debug.Log("Terrain lightmap stored in" + terrainRendererInfo.lightmapIndex.ToString()); + } + + var renderers = FindObjectsOfType(typeof(Renderer)); + + if (Application.isEditor) + Debug.Log("stored info for " + renderers.Length + " meshrenderers"); + + foreach (Renderer renderer in renderers) + { + if (renderer.lightmapIndex != -1 && renderer.lightmapIndex != 65534) + { + RendererInfo info = new RendererInfo(); + info.renderer = renderer; + info.lightmapOffsetScale = renderer.lightmapScaleOffset; + + Texture2D lightmaplight = LightmapSettings.lightmaps[renderer.lightmapIndex].lightmapColor; + info.lightmapIndex = newLightmapsLight.IndexOf(lightmaplight); + if (info.lightmapIndex == -1) + { + info.lightmapIndex = newLightmapsLight.Count; + newLightmapsLight.Add(lightmaplight); + } + + if (newLightmapsMode != LightmapsMode.NonDirectional) + { + Texture2D lightmapdir = LightmapSettings.lightmaps[renderer.lightmapIndex].lightmapDir; + info.lightmapIndex = newLightmapsDir.IndexOf(lightmapdir); + if (info.lightmapIndex == -1) + { + info.lightmapIndex = newLightmapsDir.Count; + newLightmapsDir.Add(lightmapdir); + } + } + if (LightmapSettings.lightmaps[renderer.lightmapIndex].shadowMask != null) + { + Texture2D lightmapShadow = LightmapSettings.lightmaps[renderer.lightmapIndex].shadowMask; + info.lightmapIndex = newLightmapsShadow.IndexOf(lightmapShadow); + if (info.lightmapIndex == -1) + { + info.lightmapIndex = newLightmapsShadow.Count; + newLightmapsShadow.Add(lightmapShadow); + } + } + newRendererInfos.Add(info); + } + } + } +} diff --git a/LocalPackages/LightingTools.LightmapSwitcher/Runtime/LevelLightmapData.cs.meta b/LocalPackages/LightingTools.LightmapSwitcher/Runtime/LevelLightmapData.cs.meta new file mode 100644 index 0000000..3af3c89 --- /dev/null +++ b/LocalPackages/LightingTools.LightmapSwitcher/Runtime/LevelLightmapData.cs.meta @@ -0,0 +1,13 @@ +fileFormatVersion: 2 +guid: 311c76c9ffea5554c82aa90000c874ac +timeCreated: 1435326575 +licenseType: Pro +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {fileID: 2800000, guid: 4021dabdeeef1824b871b34d975991b8, type: 3} + userData: + assetBundleName: + assetBundleVariant: diff --git a/LocalPackages/LightingTools.LightmapSwitcher/Runtime/LightingTools.LightmapSwitcher.asmdef b/LocalPackages/LightingTools.LightmapSwitcher/Runtime/LightingTools.LightmapSwitcher.asmdef new file mode 100644 index 0000000..79b72d5 --- /dev/null +++ b/LocalPackages/LightingTools.LightmapSwitcher/Runtime/LightingTools.LightmapSwitcher.asmdef @@ -0,0 +1,6 @@ +{ + "name": "LightingTools.LightmapSwitcher", + "references": [], + "includePlatforms": [], + "excludePlatforms": [] +} \ No newline at end of file diff --git a/LocalPackages/LightingTools.LightmapSwitcher/Runtime/LightingTools.LightmapSwitcher.asmdef.meta b/LocalPackages/LightingTools.LightmapSwitcher/Runtime/LightingTools.LightmapSwitcher.asmdef.meta new file mode 100644 index 0000000..55790e5 --- /dev/null +++ b/LocalPackages/LightingTools.LightmapSwitcher/Runtime/LightingTools.LightmapSwitcher.asmdef.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: 802596836aa83094ea9d1166a80d7e4e +AssemblyDefinitionImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/LocalPackages/LightingTools.LightmapSwitcher/package.json b/LocalPackages/LightingTools.LightmapSwitcher/package.json new file mode 100644 index 0000000..2145393 --- /dev/null +++ b/LocalPackages/LightingTools.LightmapSwitcher/package.json @@ -0,0 +1,10 @@ +{ + "name": "li.lightingtools.lightmapswitcher", + "displayName": "Lightmap Switcher", + "version": "0.1.0-preview", + "unity": "2019.1", + "description": "Allows you to switch lightmaps at runtime.", + "dependencies": { + "com.unity.editorcoroutines": "0.0.2-preview" + } +} \ No newline at end of file diff --git a/LocalPackages/LightingTools.LightmapSwitcher/package.json.meta b/LocalPackages/LightingTools.LightmapSwitcher/package.json.meta new file mode 100644 index 0000000..1f4f6a8 --- /dev/null +++ b/LocalPackages/LightingTools.LightmapSwitcher/package.json.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: 243e8b565ec911f4dbcf88980a8510af +TextScriptImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/LocalPackages/com.unity.render-pipelines.high-definition-config/CHANGELOG.md b/LocalPackages/com.unity.render-pipelines.high-definition-config/CHANGELOG.md new file mode 100644 index 0000000..b4583c3 --- /dev/null +++ b/LocalPackages/com.unity.render-pipelines.high-definition-config/CHANGELOG.md @@ -0,0 +1,42 @@ +# Changelog +All notable changes to this package will be documented in this file. + +The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/) +and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html). + +## [7.1.6] - 2019-11-22 + +Version Updated +The version number for this package has increased due to a version update of a related graphics package. + +## [7.1.5] - 2019-11-15 + +Version Updated +The version number for this package has increased due to a version update of a related graphics package. + +## [7.1.4] - 2019-11-13 + +Version Updated +The version number for this package has increased due to a version update of a related graphics package. + +## [7.1.3] - 2019-11-04 + +Version Updated +The version number for this package has increased due to a version update of a related graphics package. + +## [7.1.2] - 2019-09-19 + +Version Updated +The version number for this package has increased due to a version update of a related graphics package. + +## [7.1.1] - 2019-09-05 + +Version Updated +The version number for this package has increased due to a version update of a related graphics package. + +## [7.0.1] - 2019-07-25 + +Version Updated +The version number for this package has increased due to a version update of a related graphics package. + +Started Changelog diff --git a/LocalPackages/com.unity.render-pipelines.high-definition-config/CHANGELOG.md.meta b/LocalPackages/com.unity.render-pipelines.high-definition-config/CHANGELOG.md.meta new file mode 100644 index 0000000..fd1225a --- /dev/null +++ b/LocalPackages/com.unity.render-pipelines.high-definition-config/CHANGELOG.md.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: 0b3f7006c7834664ba28a1fa6b51f9fe +TextScriptImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/LocalPackages/com.unity.render-pipelines.high-definition-config/LICENSE.md b/LocalPackages/com.unity.render-pipelines.high-definition-config/LICENSE.md new file mode 100644 index 0000000..0134573 --- /dev/null +++ b/LocalPackages/com.unity.render-pipelines.high-definition-config/LICENSE.md @@ -0,0 +1,5 @@ +Render Pipeline Core copyright © 2019 Unity Technologies ApS + +Licensed under the Unity Companion License for Unity-dependent projects--see [Unity Companion License](http://www.unity3d.com/legal/licenses/Unity_Companion_License). + +Unless expressly provided otherwise, the Software under this license is made available strictly on an “AS IS” BASIS WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED. Please review the license for details on these and other terms and conditions. diff --git a/LocalPackages/com.unity.render-pipelines.high-definition-config/LICENSE.md.meta b/LocalPackages/com.unity.render-pipelines.high-definition-config/LICENSE.md.meta new file mode 100644 index 0000000..ea2acb8 --- /dev/null +++ b/LocalPackages/com.unity.render-pipelines.high-definition-config/LICENSE.md.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: e797817a7447e1f42816cf2c2fa8765d +TextScriptImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/LocalPackages/com.unity.render-pipelines.high-definition-config/Runtime.meta b/LocalPackages/com.unity.render-pipelines.high-definition-config/Runtime.meta new file mode 100644 index 0000000..f39f7b8 --- /dev/null +++ b/LocalPackages/com.unity.render-pipelines.high-definition-config/Runtime.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 5d299198a792a964e9d443aa47506e2c +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/LocalPackages/com.unity.render-pipelines.high-definition-config/Runtime/ShaderConfig.cs b/LocalPackages/com.unity.render-pipelines.high-definition-config/Runtime/ShaderConfig.cs new file mode 100644 index 0000000..4ba6ab3 --- /dev/null +++ b/LocalPackages/com.unity.render-pipelines.high-definition-config/Runtime/ShaderConfig.cs @@ -0,0 +1,49 @@ +//----------------------------------------------------------------------------- +// Configuration +//----------------------------------------------------------------------------- + +namespace UnityEngine.Rendering.HighDefinition +{ + [GenerateHLSL(PackingRules.Exact)] + public enum HDShadowFilteringQuality + { + Low = 0, + Medium = 1, + High = 2, + } + + [GenerateHLSL(PackingRules.Exact)] + public enum ShaderOptions + { + CameraRelativeRendering = 1, // Rendering sets the origin of the world to the position of the primary (scene view) camera + PreExposition = 1, + PrecomputedAtmosphericAttenuation = 0, // Precomputes atmospheric attenuation for the directional light on the CPU, which makes it independent from the fragment's position, which is faster but wrong +#if ENABLE_RAYTRACING + Raytracing = 1, +#else + Raytracing = 0, +#endif +#if ENABLE_VR + XrMaxViews = 2, // Used for single-pass rendering (with fast path in vertex shader code when forced to 2) +#else + XrMaxViews = 1, +#endif + AreaLights = 0, + + DeferredShadowFiltering = HDShadowFilteringQuality.Medium, + BarnDoor = 0 + }; + + // Note: #define can't be use in include file in C# so we chose this way to configure both C# and hlsl + // Changing a value in this enum Config here require to regenerate the hlsl include and recompile C# and shaders + public class ShaderConfig + { + public static int s_CameraRelativeRendering = (int)ShaderOptions.CameraRelativeRendering; + public static int s_PreExposition = (int)ShaderOptions.PreExposition; + public static int s_XrMaxViews = (int)ShaderOptions.XrMaxViews; + public static int s_PrecomputedAtmosphericAttenuation = (int)ShaderOptions.PrecomputedAtmosphericAttenuation; + public static int s_AreaLights = (int)ShaderOptions.AreaLights; + public static int s_BarnDoor = (int)ShaderOptions.BarnDoor; + public static HDShadowFilteringQuality s_DeferredShadowFiltering = (HDShadowFilteringQuality)ShaderOptions.DeferredShadowFiltering; + } +} diff --git a/LocalPackages/com.unity.render-pipelines.high-definition-config/Runtime/ShaderConfig.cs.hlsl b/LocalPackages/com.unity.render-pipelines.high-definition-config/Runtime/ShaderConfig.cs.hlsl new file mode 100644 index 0000000..9779abe --- /dev/null +++ b/LocalPackages/com.unity.render-pipelines.high-definition-config/Runtime/ShaderConfig.cs.hlsl @@ -0,0 +1,27 @@ +// +// This file was automatically generated. Please don't edit by hand. +// + +#ifndef SHADERCONFIG_CS_HLSL +#define SHADERCONFIG_CS_HLSL +// +// UnityEngine.Rendering.HighDefinition.HDShadowFilteringQuality: static fields +// +#define HDSHADOWFILTERINGQUALITY_LOW (0) +#define HDSHADOWFILTERINGQUALITY_MEDIUM (1) +#define HDSHADOWFILTERINGQUALITY_HIGH (2) + +// +// UnityEngine.Rendering.HighDefinition.ShaderOptions: static fields +// +#define SHADEROPTIONS_CAMERA_RELATIVE_RENDERING (1) +#define SHADEROPTIONS_PRE_EXPOSITION (1) +#define SHADEROPTIONS_PRECOMPUTED_ATMOSPHERIC_ATTENUATION (0) +#define SHADEROPTIONS_RAYTRACING (0) +#define SHADEROPTIONS_XR_MAX_VIEWS (2) +#define SHADEROPTIONS_AREA_LIGHTS (1) +#define SHADEROPTIONS_DEFERRED_SHADOW_FILTERING (1) +#define SHADEROPTIONS_BARN_DOOR (0) + + +#endif diff --git a/LocalPackages/com.unity.render-pipelines.high-definition-config/Runtime/ShaderConfig.cs.hlsl.meta b/LocalPackages/com.unity.render-pipelines.high-definition-config/Runtime/ShaderConfig.cs.hlsl.meta new file mode 100644 index 0000000..6398631 --- /dev/null +++ b/LocalPackages/com.unity.render-pipelines.high-definition-config/Runtime/ShaderConfig.cs.hlsl.meta @@ -0,0 +1,9 @@ +fileFormatVersion: 2 +guid: bcb8aa9f314d49b4c97aa1f3f3511e7b +ShaderImporter: + externalObjects: {} + defaultTextures: [] + nonModifiableTextures: [] + userData: + assetBundleName: + assetBundleVariant: diff --git a/LocalPackages/com.unity.render-pipelines.high-definition-config/Runtime/ShaderConfig.cs.meta b/LocalPackages/com.unity.render-pipelines.high-definition-config/Runtime/ShaderConfig.cs.meta new file mode 100644 index 0000000..e4103cd --- /dev/null +++ b/LocalPackages/com.unity.render-pipelines.high-definition-config/Runtime/ShaderConfig.cs.meta @@ -0,0 +1,12 @@ +fileFormatVersion: 2 +guid: 488b9213a64c77540bca3fe167edbe6c +timeCreated: 1475742183 +licenseType: Pro +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/LocalPackages/com.unity.render-pipelines.high-definition-config/Runtime/Unity.RenderPipelines.HighDefinition.Config.Runtime.asmdef b/LocalPackages/com.unity.render-pipelines.high-definition-config/Runtime/Unity.RenderPipelines.HighDefinition.Config.Runtime.asmdef new file mode 100644 index 0000000..6c4dd01 --- /dev/null +++ b/LocalPackages/com.unity.render-pipelines.high-definition-config/Runtime/Unity.RenderPipelines.HighDefinition.Config.Runtime.asmdef @@ -0,0 +1,14 @@ +{ + "name": "Unity.RenderPipelines.HighDefinition.Config.Runtime", + "references": [ + "GUID:df380645f10b7bc4b97d4f5eb6303d95" + ], + "includePlatforms": [], + "excludePlatforms": [], + "allowUnsafeCode": true, + "overrideReferences": false, + "precompiledReferences": [], + "autoReferenced": true, + "defineConstraints": [], + "versionDefines": [] +} \ No newline at end of file diff --git a/LocalPackages/com.unity.render-pipelines.high-definition-config/Runtime/Unity.RenderPipelines.HighDefinition.Config.Runtime.asmdef.meta b/LocalPackages/com.unity.render-pipelines.high-definition-config/Runtime/Unity.RenderPipelines.HighDefinition.Config.Runtime.asmdef.meta new file mode 100644 index 0000000..7ab3dfd --- /dev/null +++ b/LocalPackages/com.unity.render-pipelines.high-definition-config/Runtime/Unity.RenderPipelines.HighDefinition.Config.Runtime.asmdef.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: a075b55b404a34748ac14ea9b6039911 +AssemblyDefinitionImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/LocalPackages/com.unity.render-pipelines.high-definition-config/package.json b/LocalPackages/com.unity.render-pipelines.high-definition-config/package.json new file mode 100644 index 0000000..5fb1829 --- /dev/null +++ b/LocalPackages/com.unity.render-pipelines.high-definition-config/package.json @@ -0,0 +1,16 @@ +{ + "name": "com.unity.render-pipelines.high-definition-config", + "description": "Configuration files for the High Definition Render Pipeline.", + "version": "7.1.6", + "unity": "2019.3", + "unityRelease": "0b13", + "displayName": "High Definition RP Config", + "dependencies": { + "com.unity.render-pipelines.core": "7.1.6" + }, + "repository": { + "type": "git", + "url": "git@github.com:Unity-Technologies/ScriptableRenderPipeline.git", + "revision": "462033f359f783f5d71dc578159bf5827abb41e2" + } +} diff --git a/LocalPackages/com.unity.render-pipelines.high-definition-config/package.json.meta b/LocalPackages/com.unity.render-pipelines.high-definition-config/package.json.meta new file mode 100644 index 0000000..21281d7 --- /dev/null +++ b/LocalPackages/com.unity.render-pipelines.high-definition-config/package.json.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: af6e0e6bb9a468845bfb9c9381e3219b +PackageManifestImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/LocalPackages/net.peeweek.gameplay-ingredients/CHANGELOG.md b/LocalPackages/net.peeweek.gameplay-ingredients/CHANGELOG.md new file mode 100644 index 0000000..2f09f40 --- /dev/null +++ b/LocalPackages/net.peeweek.gameplay-ingredients/CHANGELOG.md @@ -0,0 +1,152 @@ +# Changelog + +## 2019.3.1 + +#### Changed + +* **Messager** is now able to pass instigator Game Object through message broadcast. +* **OnMessageEvent** now passes the optional instigator instead of itself as instigator to the Calls. In order to pass itself use an intermediate **SetInstigatorLogic** that targets the OnMessageEvent owner to replicate the former behaviour. +* **SendMessageAction** now passes its instigator game object to the **Messager** + +#### Added + +* **Call Tree Explorer**: Added Category for Erroneous Calls +* Added **ToggleBehaviourAction** working the same as ToggleGameObjectAction, but for behaviour components instead. +* **SendMessageBehaviour** (Timeline Send Message Tracks/Clips) now displays an instigator game object field in the inspector to be attached to the sent message. +* Added **VFXSetPropertyAction** +* Added **VFXSendEventAction** + +#### Fixed + +* Fixed `OnValidate` for FirstPersonController leading to infinite import loop when displaying the inspector for a Prefab Asset. +* Fix for null Callables in Callable Tree Window. + +## 2019.3.0 + +* Feature Release +* Requires Unity 2019.3.0 or newer + +#### Added + +* **Call Tree Explorer :** Using Window/Gameplay Ingredients/Call Tree Explorer , opens a window that lists the tree of Events, Logic and Actions, State Machines and Event Calling Actions +* **Folders:** In the Game Object creation Menu, Select folder to add a folder in the hierarchy. Automatically adds Static Game Objects with colored icon (Displayed using Advanced Hierarchy View) +* **Global Variables System**: + - Added Global Variables (Globals + Local Scope) + - Added Global Variable Debug Window (`Window/Gameplay Ingredients/Globals Debug`) + - Added Global Variable Set Action + - Added Global Variable Logic + - Added Global Variables Reset Action +* **Timers**: + * Added Timer Component + * Added TimerAction to control Timer + * Added TimerDisplayRig +* Added option in GameplayIngredientsSettings to disable visibility of Callable[] bound to Update Loops. +* Added OnUpdate Event : Perform calls every update +* Added OnColider Event : Perform calls upon collisions +* Added OnJoinBreak Event : Perform calls upon Rigid body joint break +* Added FlipFlop Logic : Two-state latch logic +* Added State Logic : Perform logic based on State Machine current state. +* Added Audio Mix Snapshot Action : Set Mixer Snapshots +* Added RigidBody Action : Perform actions on a rigidbody +* Added SetAnimatorParameterAction : Perform parameter setting on Animators +* Added Sacrifice Oldest option to Factory : When needing a new spawn but no slots left, sacrifices the first spawn of the list +* Added Context Menu in ToggleGameObjectAction to update entries based on current enabled state in scene. + +#### Changed + +- Improved **Find & Replace** window, with a selection-based criteria. +- Moved Menu Items in Window menu into a Gameplay Ingredients Subfolder +- GameManager Resets Global Variables Local Scope on Level Load +- Updated NaughtyAttributes to a more recent version +- Renamed the Add Game Object menu category from `'GameplayIngredients' to 'Gameplay Ingredients'` and adjusted its contents + +#### Fixed + +* Fixed LinkGameView not working in play mode when excluding VirtualCameraManager. +* Fixed Performance issue in GameplayIngredientsSettings when having a big list of Excluded managers. +* Fixed ApplicationExitAction : Exits play mode when in Editor. + +## 2019.1.2 + +#### Changed + +* **[Breaking Change]** Discover Assets now reference many Scenes/SceneSetups + * Action to take: have to re-reference scenes in Discover Asset + +#### Added + +* Added Screenshot Manager (Defaults to F11 to take screenshots) +* Added OnMouseDownEvent +* Added OnMouseHoverEvent +* Added OnVisibilityEvent +* Added SaveDataSwitchOnIntLogic + +#### Fixed + +* Fixed warning in CycleResolutionsAction + + + +## 2019.1.1 + +#### Changed + +#### Added + +* Log Action +* Added Playable Director to objects in discover (to open atimeline at a give playable director) +* Added support of Game Save Value index for Factories (in order to select a blueprint object from a saved value) + +#### Fixed + +* Fixed Import Errors at first project load, including the way we load discover and GameplayIngredients project settings + +* Secure checks in Gathering Manager classes from assembly (skips protected assemblies now) + + + +## 2019.1.0 + +#### Changed + +* Removed counts in OnTriggerEvent +* Callables can now be friendly-named (with default formatting) +* Updated Starter Packages + +#### Added + +- Added NTimesLogic (split from OnTriggerEvent) +- Added Replace Mode for Level Streaming Manager +- Added UIToggle Action and Property Drawer +- Added Audio Play Clip Action +- Added Platform Logic + +- New Welcome Screen, with Wizard +- New optional GameplayIngredients Project Configuration asset + - Toggles for verbose callable logging + - Manager Exclusion List +- New Scene from Template Window + Config SceneTemplateLists Assets + - Helps creating new scenes from user-made templates +- New Discover Window System: + - Adds a new DiscoverAsset to reference Levels / Scene Setups + - Adds new Discover components in scenes + - Discover window helps navigate scenes while in editor and discover content. +- Added improved Game Manager + - Manages loading of main menu & levels directly instead of using LevelStreamingManager + - Manages Level Startup in sync after all scenes have started. + +#### Fixed + +* Fixed code to run on Unity 2019.1 +* Fixed factory managed objects upon destroy +* Fixes in LinkGameView when application is not playing +* Fix in LevelStreamingManager incorrect computation of Scene Counts +* Fixes in VirtualCameraManager +* Fixes in Find/Replace window +* Fixes in Hierarchy View Hints for Unity 2019.3 new skin + + + +## 2018.3.0 + +Initial Version diff --git a/LocalPackages/net.peeweek.gameplay-ingredients/CHANGELOG.md.meta b/LocalPackages/net.peeweek.gameplay-ingredients/CHANGELOG.md.meta new file mode 100644 index 0000000..83d366a --- /dev/null +++ b/LocalPackages/net.peeweek.gameplay-ingredients/CHANGELOG.md.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: a2d80afb13247c646b079b5f51dcb6ac +TextScriptImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/LocalPackages/net.peeweek.gameplay-ingredients/Editor.meta b/LocalPackages/net.peeweek.gameplay-ingredients/Editor.meta new file mode 100644 index 0000000..5a6ff28 --- /dev/null +++ b/LocalPackages/net.peeweek.gameplay-ingredients/Editor.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: dedb43ed8dff48a4ea95d29002e41ca4 +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/LocalPackages/net.peeweek.gameplay-ingredients/Editor/AssetFactory.meta b/LocalPackages/net.peeweek.gameplay-ingredients/Editor/AssetFactory.meta new file mode 100644 index 0000000..55c0abc --- /dev/null +++ b/LocalPackages/net.peeweek.gameplay-ingredients/Editor/AssetFactory.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: e78d538974cc9924792b2707919e382a +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/LocalPackages/net.peeweek.gameplay-ingredients/Editor/AssetFactory/AssetFactory.cs b/LocalPackages/net.peeweek.gameplay-ingredients/Editor/AssetFactory/AssetFactory.cs new file mode 100644 index 0000000..096d68a --- /dev/null +++ b/LocalPackages/net.peeweek.gameplay-ingredients/Editor/AssetFactory/AssetFactory.cs @@ -0,0 +1,43 @@ +using UnityEngine; +using UnityEditor.Callbacks; +using UnityEditor.ProjectWindowCallback; +using System; +using System.IO; +using UnityEditor; + +namespace GameplayIngredients.Editor +{ + public class AssetFactory + { + public static void CreateAssetInProjectWindow(string iconName, string fileName) where T: ScriptableObject + { + var icon = EditorGUIUtility.FindTexture(iconName); + + var namingInstance = new DoCreateGenericAsset(); + namingInstance.type = typeof(T); + ProjectWindowUtil.StartNameEditingIfProjectWindowExists(0, namingInstance, fileName, icon, null); + } + + public static ScriptableObject CreateAssetAtPath(string path, Type type) + { + Debug.Log("CreateAssetAtPath (" + type.Name + ")"); + + ScriptableObject asset = ScriptableObject.CreateInstance(type); + asset.name = Path.GetFileName(path); + AssetDatabase.CreateAsset(asset, path); + return asset; + } + + class DoCreateGenericAsset : EndNameEditAction + { + public Type type; + + public override void Action(int instanceId, string pathName, string resourceFile) + { + ScriptableObject asset = AssetFactory.CreateAssetAtPath(pathName, type); + ProjectWindowUtil.ShowCreatedAsset(asset); + } + } + + } +} diff --git a/LocalPackages/net.peeweek.gameplay-ingredients/Runtime/Actions/AudioMixParameterAction.cs.meta b/LocalPackages/net.peeweek.gameplay-ingredients/Editor/AssetFactory/AssetFactory.cs.meta similarity index 83% rename from LocalPackages/net.peeweek.gameplay-ingredients/Runtime/Actions/AudioMixParameterAction.cs.meta rename to LocalPackages/net.peeweek.gameplay-ingredients/Editor/AssetFactory/AssetFactory.cs.meta index 09475db..2aed1ca 100644 --- a/LocalPackages/net.peeweek.gameplay-ingredients/Runtime/Actions/AudioMixParameterAction.cs.meta +++ b/LocalPackages/net.peeweek.gameplay-ingredients/Editor/AssetFactory/AssetFactory.cs.meta @@ -1,5 +1,5 @@ fileFormatVersion: 2 -guid: 3e93b674f69eb054c8514bd7c501f0e3 +guid: 4833ee2adf8a9cd4c96cbd6dac04fe42 MonoImporter: externalObjects: {} serializedVersion: 2 diff --git a/LocalPackages/net.peeweek.gameplay-ingredients/Editor/CallTree.meta b/LocalPackages/net.peeweek.gameplay-ingredients/Editor/CallTree.meta new file mode 100644 index 0000000..85f3468 --- /dev/null +++ b/LocalPackages/net.peeweek.gameplay-ingredients/Editor/CallTree.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 37d3d697167f89145a81aa7bb6c0acc4 +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/LocalPackages/net.peeweek.gameplay-ingredients/Editor/CallTree/CallTreeWindow.cs b/LocalPackages/net.peeweek.gameplay-ingredients/Editor/CallTree/CallTreeWindow.cs new file mode 100644 index 0000000..9b549b5 --- /dev/null +++ b/LocalPackages/net.peeweek.gameplay-ingredients/Editor/CallTree/CallTreeWindow.cs @@ -0,0 +1,562 @@ +using System.Collections; +using System.Linq; +using System.Collections.Generic; +using System; +using System.Reflection; +using UnityEngine; +using UnityEditor; +using UnityEditor.IMGUI.Controls; +using UnityEditor.SceneManagement; +using GameplayIngredients.Events; +using GameplayIngredients.Logic; +using GameplayIngredients.Actions; +using GameplayIngredients.StateMachines; +using UnityEngine.SceneManagement; + +namespace GameplayIngredients.Editor +{ + public class CallTreeWindow : EditorWindow + { + CallTreeView m_TreeView; + [MenuItem("Window/Gameplay Ingredients/Callable Tree Explorer", priority = MenuItems.kWindowMenuPriority)] + static void OpenWindow() + { + s_Instance = GetWindow(); + } + + public static bool visible = false; + static CallTreeWindow s_Instance; + + private void OnDisable() + { + visible = false; + s_Instance = null; + } + + private void OnEnable() + { + nodeRoots = new Dictionary>(); + m_TreeView = new CallTreeView(nodeRoots); + titleContent = new GUIContent("Callable Tree Explorer", CallTreeView.Styles.Callable); + ReloadCallHierarchy(); + EditorSceneManager.sceneOpened += Reload; + EditorSceneSetup.onSetupLoaded += ReloadSetup; + visible = true; + } + + void Reload(Scene scene, OpenSceneMode mode) + { + ReloadCallHierarchy(); + } + + void ReloadSetup(EditorSceneSetup setup) + { + ReloadCallHierarchy(); + } + + public static void Refresh() + { + s_Instance.ReloadCallHierarchy(); + s_Instance.Repaint(); + } + + private void OnGUI() + { + int tbHeight = 24; + using (new GUILayout.HorizontalScope(EditorStyles.toolbar, GUILayout.Height(tbHeight))) + { + if (GUILayout.Button("Reload", EditorStyles.toolbarButton)) + { + ReloadCallHierarchy(); + } + GUILayout.FlexibleSpace(); + EditorGUI.BeginChangeCheck(); + string filter = EditorGUILayout.DelayedTextField(m_TreeView.stringFilter, EditorStyles.toolbarSearchField); + if (EditorGUI.EndChangeCheck()) + { + m_TreeView.SetStringFilter(filter); + } + + + Rect buttonRect = GUILayoutUtility.GetRect(52, 16); + if (GUI.Button(buttonRect, "Filter", EditorStyles.toolbarDropDown)) + { + GenericMenu menu = new GenericMenu(); + menu.AddItem(new GUIContent("Filter Selected"), false, () => { + m_TreeView.SetAutoFilter(false); + m_TreeView.SetObjectFilter(Selection.activeGameObject); + }); + menu.AddItem(new GUIContent("Clear Filter"), false, () => { + m_TreeView.SetAutoFilter(false); + m_TreeView.SetObjectFilter(null); + m_TreeView.SetStringFilter(string.Empty); + }); + menu.AddSeparator(""); + menu.AddItem(new GUIContent("Automatic Filter"), m_TreeView.AutoFilter, () => { + m_TreeView.ToggleAutoFilter(); + }); + menu.DropDown(buttonRect); + } + + } + Rect r = GUILayoutUtility.GetRect(position.width, position.height - tbHeight); + m_TreeView.OnGUI(r); + } + + Dictionary> nodeRoots; + + List erroneous; + + void ReloadCallHierarchy() + { + if (nodeRoots == null) + nodeRoots = new Dictionary>(); + else + nodeRoots.Clear(); + + erroneous = new List(); + + AddToCategory("Events"); + AddToCategory("State Machines"); + AddToCategory("Factories"); + AddToCategory("Messages"); + CollectErroneousCallables(); + m_TreeView.Reload(); + } + + void CollectErroneousCallables() + { + if (erroneous == null || erroneous.Count == 0) + return; + var root = new List(); + nodeRoots.Add("Erroneous Callables", root); + + foreach(var callable in erroneous) + { + root.Add(new CallTreeNode(callable, CallTreeNodeType.Callable, callable.name)); + } + } + + void AddErroneous(MonoBehaviour bhv) + { + if (!erroneous.Contains(bhv)) + erroneous.Add(bhv); + } + + void AddToCategory(string name) where T:MonoBehaviour + { + var list = Resources.FindObjectsOfTypeAll().ToList(); + + if (list.Count > 0) + nodeRoots.Add(name, new List()); + else + return; + + var listRoot = nodeRoots[name]; + foreach (var item in list) + { + if (item.gameObject.scene == null || !item.gameObject.scene.isLoaded) + continue; + + var stack = new Stack(); + + if(typeof(T) == typeof(StateMachine)) + { + listRoot.Add(GetStateMachineNode(item as StateMachine, stack)); + } + else if(typeof(T) == typeof(SendMessageAction)) + { + listRoot.Add(GetMessageNode(item as SendMessageAction, stack)); + } + else + { + listRoot.Add(GetNode(item, stack)); + } + } + + } + + CallTreeNode GetNode(MonoBehaviour bhv, Stack stack) + { + if(!stack.Contains(bhv)) + { + stack.Push(bhv); + var rootNode = new CallTreeNode(bhv, GetType(bhv), $"{bhv.gameObject.name} ({bhv.GetType().Name})"); + var type = bhv.GetType(); + foreach (var field in type.GetFields()) + { + // Find Fields that are Callable[] + if (field.FieldType.IsAssignableFrom(typeof(Callable[]))) + { + var node = new CallTreeNode(bhv, CallTreeNodeType.Callable, field.Name); + var value = (Callable[])field.GetValue(bhv); + + if (value != null && value.Length > 0) + { + rootNode.Children.Add(node); + // Add Callables from this Callable[] array + foreach (var call in value) + { + if (call != null) + node.Children.Add(GetCallableNode(call, stack)); + else + AddErroneous(node.Target); + } + } + } + } + return rootNode; + } + else + { + return new CallTreeNode(bhv, GetType(bhv), $"RECURSED : {bhv.gameObject.name} ({bhv.GetType().Name})"); + } + } + + CallTreeNode GetCallableNode(Callable c, Stack stack) + { + if (!stack.Contains(c)) + { + stack.Push(c); + var rootNode = new CallTreeNode(c, GetType(c), $"{c.Name} ({c.gameObject.name} : {c.GetType().Name})"); + var type = c.GetType(); + foreach (var field in type.GetFields()) + { + // Find Fields that are Callable[] + if (field.FieldType.IsAssignableFrom(typeof(Callable[]))) + { + var node = new CallTreeNode(c, CallTreeNodeType.Callable, field.Name); + var value = (Callable[])field.GetValue(c); + + if (value != null && value.Length > 0) + { + rootNode.Children.Add(node); + // Add Callables from this Callable[] array + foreach (var call in value) + { + if (call != null) + node.Children.Add(GetCallableNode(call, stack)); + else + AddErroneous(node.Target); + } + } + } + } + return rootNode; + } + else + { + return new CallTreeNode(c, GetType(c), $"RECURSED : {c.Name} ({c.gameObject.name} : {c.GetType().Name})"); + } + } + + CallTreeNode GetMessageNode(SendMessageAction msg, Stack stack) + { + if (!stack.Contains(msg)) + { + stack.Push(msg); + var rootNode = new CallTreeNode(msg, CallTreeNodeType.Message, $"{msg.MessageToSend} : ({msg.gameObject.name}.{msg.Name})"); + var all = Resources.FindObjectsOfTypeAll().Where(o=> o.MessageName == msg.MessageToSend).ToList(); + + foreach(var evt in all) + { + rootNode.Children.Add(GetNode(evt, stack)); + } + return rootNode; + } + else + { + return new CallTreeNode(msg, GetType(msg), $"RECURSED :{msg.MessageToSend} : ({msg.gameObject.name}.{msg.Name})"); + } + } + + + CallTreeNode GetStateMachineNode(StateMachine sm, Stack stack) + { + if (!stack.Contains(sm)) + { + stack.Push(sm); + var rootNode = new CallTreeNode(sm, CallTreeNodeType.StateMachine, sm.gameObject.name); + var type = sm.GetType(); + foreach (var field in type.GetFields()) + { + // Find Fields that are State[] + if (field.FieldType.IsAssignableFrom(typeof(State[]))) + { + // Add Callables from this Callable[] array + var value = (State[])field.GetValue(sm); + foreach (var state in value) + { + if (state != null) + rootNode.Children.Add(GetStateNode(state, stack)); + else + AddErroneous(rootNode.Target); + } + } + } + return rootNode; + } + else + { + return new CallTreeNode(sm, GetType(sm), $"RECURSED :{sm.gameObject.name}"); + } + + } + + CallTreeNode GetStateNode(State st, Stack stack) + { + if (!stack.Contains(st)) + { + stack.Push(st); + var rootNode = new CallTreeNode(st, CallTreeNodeType.State, st.gameObject.name); + var type = st.GetType(); + foreach (var field in type.GetFields()) + { + // Find Fields that are Callable[] + if (field.FieldType.IsAssignableFrom(typeof(Callable[]))) + { + var node = new CallTreeNode(st, CallTreeNodeType.Callable, field.Name); + rootNode.Children.Add(node); + // Add Callables from this Callable[] array + var value = (Callable[])field.GetValue(st); + foreach (var call in value) + { + if (call != null) + node.Children.Add(GetNode(call, stack)); + else + AddErroneous(rootNode.Target); + } + } + } + return rootNode; + } + else + { + return new CallTreeNode(st, GetType(st), $"RECURSED :{st.gameObject.name}"); + } + } + + CallTreeNodeType GetType(MonoBehaviour bhv) + { + if (bhv == null) + return CallTreeNodeType.Callable; + else if (bhv is EventBase) + return CallTreeNodeType.Event; + else if (bhv is LogicBase) + return CallTreeNodeType.Logic; + else if (bhv is ActionBase) + return CallTreeNodeType.Action; + else if (bhv is StateMachine) + return CallTreeNodeType.StateMachine; + else if (bhv is State) + return CallTreeNodeType.State; + else if (bhv is Factory) + return CallTreeNodeType.Factory; + else if (bhv is OnMessageEvent || bhv is SendMessageAction) + return CallTreeNodeType.Message; + else + return CallTreeNodeType.Callable; + } + + class CallTreeNode + { + public string Name; + public MonoBehaviour Target; + public List Children; + public CallTreeNodeType Type; + public CallTreeNode(MonoBehaviour target, CallTreeNodeType type, string name = "") + { + Name = string.IsNullOrEmpty(name) ? target.GetType().Name : name; + Target = target; + Type = type; + Children = new List(); + } + + public bool Filter(GameObject go, string filter) + { + bool keep = (go == null || this.Target.gameObject == go) + && (string.IsNullOrEmpty(filter) ? true : this.Name.Contains(filter)); + + if(!keep) + { + foreach (var node in Children) + keep = keep || node.Filter(go, filter); + } + + return keep; + } + } + + public enum CallTreeNodeType + { + Callable, + Event, + Logic, + Action, + Message, + StateMachine, + State, + Factory + } + + class CallTreeView : TreeView + { + Dictionary> m_Roots; + Dictionary m_Bindings; + + public CallTreeView(Dictionary> roots) : base(new TreeViewState()) + { + m_Roots = roots; + m_Bindings = new Dictionary(); + } + + public string stringFilter { get { return m_StringFilter; } } + + [SerializeField] + GameObject m_filter = null; + [SerializeField] + string m_StringFilter = ""; + + public bool AutoFilter { get; private set; } + public void ToggleAutoFilter() + { + SetAutoFilter(!AutoFilter); + } + + public void SetAutoFilter(bool value) + { + AutoFilter = value; + if (AutoFilter) + { + Selection.selectionChanged += UpdateAutoFilter; + if(this.HasSelection()) + { + SetObjectFilter(m_Bindings[this.GetSelection()[0]].Target.gameObject); + } + } + else + Selection.selectionChanged -= UpdateAutoFilter; + } + + void UpdateAutoFilter() + { + if (Selection.activeGameObject != null) + SetObjectFilter(Selection.activeGameObject); + } + + public void SetObjectFilter(GameObject filter = null) + { + m_filter = filter; + Reload(); + } + + public void SetStringFilter(string stringFilter) + { + m_StringFilter = stringFilter; + Reload(); + } + + protected override TreeViewItem BuildRoot() + { + int id = -1; + m_Bindings.Clear(); + var treeRoot = new TreeViewItem(++id, -1, "~Root"); + + foreach(var kvp in m_Roots) + { + if (kvp.Value == null || kvp.Value.Count == 0) + continue; + + var currentRoot = new TreeViewItem(++id, 0, kvp.Key); + treeRoot.AddChild(currentRoot); + foreach (var node in kvp.Value) + { + if (node.Filter(m_filter, m_StringFilter)) + { + currentRoot.AddChild(GetNode(node, ref id, 1)); + } + } + } + if (treeRoot.children == null) + { + treeRoot.AddChild(new TreeViewItem(1, 0, "(No Results)")); + } + + return treeRoot; + } + + TreeViewItem GetNode(CallTreeNode node, ref int id, int depth) + { + id++; + var item = new TreeViewItem(id, depth, $"{node.Name}"); + item.icon = GetIcon(node.Target, node.Type); + m_Bindings.Add(id, node); + + foreach(var child in node.Children) + { + item.AddChild(GetNode(child, ref id, depth + 1)); + } + return item; + } + + Texture2D GetIcon(MonoBehaviour bhv, CallTreeNodeType type) + { + if(bhv != null && type != CallTreeNodeType.Callable) + { + var texture = EditorGUIUtility.ObjectContent(bhv, bhv.GetType()).image; + if (texture != null) + return texture as Texture2D; + } + + switch(type) + { + default: + case CallTreeNodeType.Callable: + return Styles.Callable; + case CallTreeNodeType.Action: + return Styles.Action; + case CallTreeNodeType.Logic: + return Styles.Logic; + case CallTreeNodeType.Event: + return Styles.Event; + case CallTreeNodeType.Message: + return Styles.Message; + case CallTreeNodeType.State: + return Styles.State; + case CallTreeNodeType.Factory: + return Styles.Factory; + case CallTreeNodeType.StateMachine: + return Styles.StateMachine; + } + } + + protected override void SelectionChanged(IList selectedIds) + { + if (AutoFilter) + return; + + base.SelectionChanged(selectedIds); + if (selectedIds.Count > 0 && m_Bindings.ContainsKey(selectedIds[0])) + Selection.activeObject = m_Bindings[selectedIds[0]].Target; + } + + public static class Styles + { + public static Texture2D Callable = Icon("Misc/ic-callable.png"); + public static Texture2D Action = Icon("Actions/ic-action-generic.png"); + public static Texture2D Logic = Icon("Logic/ic-generic-logic.png"); + public static Texture2D Event = Icon("Events/ic-event-generic.png"); + public static Texture2D Message = Icon("Events/ic-event-message .png"); + public static Texture2D StateMachine = Icon("Misc/ic-StateMachine.png"); + public static Texture2D State = Icon("Misc/ic-State.png"); + public static Texture2D Factory = Icon("Misc/ic-Factory.png"); + + static Texture2D Icon(string path) + { + return AssetDatabase.LoadAssetAtPath($"Packages/net.peeweek.gameplay-ingredients/Icons/{path}"); + } + } + } + } +} + diff --git a/LocalPackages/net.peeweek.gameplay-ingredients/Runtime/Actions/ActionBase.cs.meta b/LocalPackages/net.peeweek.gameplay-ingredients/Editor/CallTree/CallTreeWindow.cs.meta similarity index 83% rename from LocalPackages/net.peeweek.gameplay-ingredients/Runtime/Actions/ActionBase.cs.meta rename to LocalPackages/net.peeweek.gameplay-ingredients/Editor/CallTree/CallTreeWindow.cs.meta index b99649a..450aace 100644 --- a/LocalPackages/net.peeweek.gameplay-ingredients/Runtime/Actions/ActionBase.cs.meta +++ b/LocalPackages/net.peeweek.gameplay-ingredients/Editor/CallTree/CallTreeWindow.cs.meta @@ -1,5 +1,5 @@ fileFormatVersion: 2 -guid: 446b3e7e2cf55584fa1555b54658d4ab +guid: 07aa515d40867f64686276ce5db0e51d MonoImporter: externalObjects: {} serializedVersion: 2 diff --git a/LocalPackages/net.peeweek.gameplay-ingredients/Editor/CustomInspectors.meta b/LocalPackages/net.peeweek.gameplay-ingredients/Editor/CustomInspectors.meta new file mode 100644 index 0000000..0069275 --- /dev/null +++ b/LocalPackages/net.peeweek.gameplay-ingredients/Editor/CustomInspectors.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: b3467fc18385f3f41a4050759dc020e7 +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/LocalPackages/net.peeweek.gameplay-ingredients/Editor/CustomInspectors/FolderEditor.cs b/LocalPackages/net.peeweek.gameplay-ingredients/Editor/CustomInspectors/FolderEditor.cs new file mode 100644 index 0000000..24e6db7 --- /dev/null +++ b/LocalPackages/net.peeweek.gameplay-ingredients/Editor/CustomInspectors/FolderEditor.cs @@ -0,0 +1,46 @@ +using System.Collections; +using System.Collections.Generic; +using UnityEngine; +using UnityEditor; + +namespace GameplayIngredients.Editor +{ + [CustomEditor(typeof(Folder))] + public class FolderEditor : UnityEditor.Editor + { + [MenuItem("GameObject/Folder", false, 10)] + static void CreateFolder() + { + var go = new GameObject("Folder", typeof(Folder)); + if(Selection.activeGameObject != null && Selection.activeGameObject.scene != null) + { + go.transform.parent = Selection.activeGameObject.transform; + } + } + + SerializedProperty m_Color; + + private void OnEnable() + { + m_Color = serializedObject.FindProperty("Color"); + } + + public override bool HasPreviewGUI() + { + return false; + } + + public override void OnInspectorGUI() + { + EditorGUI.BeginChangeCheck(); + var color = EditorGUILayout.ColorField("Folder Color", m_Color.colorValue); + if(EditorGUI.EndChangeCheck()) + { + m_Color.colorValue = color; + serializedObject.ApplyModifiedProperties(); + } + } + + } +} + diff --git a/LocalPackages/net.peeweek.gameplay-ingredients/Runtime/Actions/AudioMixParameterCurveAction.cs.meta b/LocalPackages/net.peeweek.gameplay-ingredients/Editor/CustomInspectors/FolderEditor.cs.meta similarity index 83% rename from LocalPackages/net.peeweek.gameplay-ingredients/Runtime/Actions/AudioMixParameterCurveAction.cs.meta rename to LocalPackages/net.peeweek.gameplay-ingredients/Editor/CustomInspectors/FolderEditor.cs.meta index f4da90b..61e9ec7 100644 --- a/LocalPackages/net.peeweek.gameplay-ingredients/Runtime/Actions/AudioMixParameterCurveAction.cs.meta +++ b/LocalPackages/net.peeweek.gameplay-ingredients/Editor/CustomInspectors/FolderEditor.cs.meta @@ -1,5 +1,5 @@ fileFormatVersion: 2 -guid: 483b9101733f40747b8c858a4e30c737 +guid: 474b95a56281dc44483708a7186ba29d MonoImporter: externalObjects: {} serializedVersion: 2 diff --git a/LocalPackages/net.peeweek.gameplay-ingredients/Editor/Discover.meta b/LocalPackages/net.peeweek.gameplay-ingredients/Editor/Discover.meta new file mode 100644 index 0000000..319a454 --- /dev/null +++ b/LocalPackages/net.peeweek.gameplay-ingredients/Editor/Discover.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 1654aa6a98f49614c87efd8f50c2785c +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/LocalPackages/net.peeweek.gameplay-ingredients/Editor/Discover/DiscoverAsset.cs b/LocalPackages/net.peeweek.gameplay-ingredients/Editor/Discover/DiscoverAsset.cs new file mode 100644 index 0000000..0f8a329 --- /dev/null +++ b/LocalPackages/net.peeweek.gameplay-ingredients/Editor/Discover/DiscoverAsset.cs @@ -0,0 +1,68 @@ +using System.Collections; +using System.Collections.Generic; +using UnityEngine; +using UnityEditor; +using UnityEditor.Callbacks; + +namespace GameplayIngredients.Editor +{ + public class DiscoverAsset : ScriptableObject + { + [MenuItem("Assets/Create/Discover Asset", priority = 202)] + static void Create() + { + AssetFactory.CreateAssetInProjectWindow(null, "New DiscoverAsset.asset"); + } + + [OnOpenAsset] + static bool OpenAsset(int instanceID, int line) + { + var asset = EditorUtility.InstanceIDToObject(instanceID); + if (asset is DiscoverAsset) + { + DiscoverWindow.ShowDiscoverWindow(asset as DiscoverAsset); + return true; + } + else + return false; + } + + [Header("General Properties")] + public string WindowTitle = "Discover"; + public Texture2D HeaderTexture; + + [Tooltip("Width of the Window, in pixels")] + public int WindowWidth = 640; + [Tooltip("Height of the Window, in pixels")] + public int WindowHeight = 520; + [Tooltip("Width of the Discover List, in pixels")] + public int DiscoverListWidth = 180; + + [Header("Show At Startup")] + public bool EnableShowAtStartup = true; + [Tooltip("The name of the preference for auto showing at startup, will be ")] + public string PreferenceName = "Discover"; + + [Header("Content")] + public string Title = "Welcome!"; + [Multiline] + public string Description = "This is a sample body for your discover window."; + [Header("Scenes")] + public DiscoverSceneInfo[] Scenes; + + [Header("Debug")] + public bool Debug = false; + } + + [System.Serializable] + public struct DiscoverSceneInfo + { + public string Title; + [Multiline] + public string Description; + public EditorSceneSetup[] SceneSetups; + public SceneAsset[] SingleScenes; + } +} + + diff --git a/LocalPackages/net.peeweek.gameplay-ingredients/Editor/Discover/DiscoverAsset.cs.meta b/LocalPackages/net.peeweek.gameplay-ingredients/Editor/Discover/DiscoverAsset.cs.meta new file mode 100644 index 0000000..4f1f54e --- /dev/null +++ b/LocalPackages/net.peeweek.gameplay-ingredients/Editor/Discover/DiscoverAsset.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 99c49654b9bada340bfd165d70dc8296 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {fileID: 2800000, guid: e61da4d7fe9ddd647bd4fd18999ff0f0, type: 3} + userData: + assetBundleName: + assetBundleVariant: diff --git a/LocalPackages/net.peeweek.gameplay-ingredients/Editor/Discover/DiscoverEditor.cs b/LocalPackages/net.peeweek.gameplay-ingredients/Editor/Discover/DiscoverEditor.cs new file mode 100644 index 0000000..5d0b45e --- /dev/null +++ b/LocalPackages/net.peeweek.gameplay-ingredients/Editor/Discover/DiscoverEditor.cs @@ -0,0 +1,215 @@ +using System; +using System.Collections.Generic; +using UnityEngine; +using UnityEditor; +using UnityEngine.Playables; +#if UNITY_2019_3_OR_NEWER +using UnityEngine.VFX; +#else +using UnityEngine.Experimental.VFX; +#endif +using UnityEngine.Timeline; + +namespace GameplayIngredients.Editor +{ + [CustomEditor(typeof(Discover))] + public class DiscoverEditor : UnityEditor.Editor + { + const string kEditPreferenceName = "GameplayIngredients.DiscoverEditor.Editing"; + + static bool editing + { + get { return EditorPrefs.GetBool(kEditPreferenceName, false); } + set { if (value != editing) EditorPrefs.SetBool(kEditPreferenceName, value); } + } + + Discover m_Discover; + + private void OnEnable() + { + m_Discover = serializedObject.targetObject as Discover; + if (m_Discover.transform.hideFlags != HideFlags.HideInInspector) + m_Discover.transform.hideFlags = HideFlags.HideInInspector; + } + + public override void OnInspectorGUI() + { + using (new GUILayout.HorizontalScope()) + { + if (GUILayout.Button("Align Discover to View")) + { + var transform = (serializedObject.targetObject as Discover).gameObject.transform; + var svTransform = SceneView.lastActiveSceneView.camera.transform; + + transform.position = svTransform.position; + transform.rotation = svTransform.rotation; + transform.localScale = Vector3.one; + } + + GUILayout.FlexibleSpace(); + editing = GUILayout.Toggle(editing, "Edit", EditorStyles.miniButton, GUILayout.Width(48)); + } + + if (editing) + DrawDefaultInspector(); + else + DrawDiscoverContentGUI(m_Discover); + } + + public static void DrawDiscoverContentGUI(Discover discover) + { + if(!string.IsNullOrEmpty(discover.Category)) + GUILayout.Label(discover.Category, DiscoverWindow.Styles.subHeader); + + GUILayout.Label(discover.Name, DiscoverWindow.Styles.header); + + using (new GUILayout.VerticalScope(DiscoverWindow.Styles.indent)) + { + if (discover.Description != null && discover.Description != string.Empty) + { + GUILayout.Label(discover.Description, DiscoverWindow.Styles.body); + } + + GUILayout.Space(8); + + foreach (var section in discover.Sections) + { + SectionGUI(section); + GUILayout.Space(16); + } + } + } + + public static void SectionGUI(DiscoverSection section) + { + using (new DiscoverWindow.GroupLabelScope(section.SectionName)) + { + using (new GUILayout.VerticalScope(DiscoverWindow.Styles.slightIndent)) + { + GUILayout.Label(section.SectionContent, DiscoverWindow.Styles.body); + + if (section.Actions != null && section.Actions.Length > 0) + { + GUILayout.Space(8); + + using (new GUILayout.VerticalScope(GUI.skin.box)) + { + foreach (var action in section.Actions) + { + using (new GUILayout.HorizontalScope()) + { + GUILayout.Label(action.Description); + GUILayout.FlexibleSpace(); + using (new GUILayout.HorizontalScope(GUILayout.MinWidth(160), GUILayout.Height(22))) + { + ActionButtonGUI(action.Target); + } + } + } + } + } + } + } + } + + static void ActionButtonGUI(UnityEngine.Object target) + { + if (target == null) + { + EditorGUI.BeginDisabledGroup(true); + GUILayout.Button("(No Object)"); + EditorGUI.EndDisabledGroup(); + return; + } + + + Type t = target.GetType(); + + if (t == typeof(GameObject)) + { + GameObject go = target as GameObject; + + if (GUILayout.Button(" Select ", DiscoverWindow.Styles.buttonLeft)) + { + Selection.activeObject = go; + } + + if(PrefabUtility.GetPrefabAssetType(go) == PrefabAssetType.NotAPrefab) + { + if (GUILayout.Button(" Go to ", DiscoverWindow.Styles.buttonRight)) + { + + Selection.activeObject = go; + SceneView.lastActiveSceneView.FrameSelected(); + } + } + else + { + if (GUILayout.Button(" Open ", DiscoverWindow.Styles.buttonRight)) + { + AssetDatabase.OpenAsset(go); + } + } + } + else if (t == typeof(Discover)) + { + if (GUILayout.Button("Discover")) + { + var discover = target as Discover; + Selection.activeGameObject = discover.gameObject; + DiscoverWindow.SelectDiscover(discover); + } + } + else if (t == typeof(VisualEffectAsset)) + { + if (GUILayout.Button("Open VFX Graph")) + { + VisualEffectAsset graph = target as VisualEffectAsset; + AssetDatabase.OpenAsset(graph); + } + } + else if (t == typeof(Animation)) + { + if (GUILayout.Button("Open Animation")) + { + Animation animation = target as Animation; + AssetDatabase.OpenAsset(animation); + } + } + else if (t == typeof(TimelineAsset)) + { + if (GUILayout.Button("Open Timeline")) + { + TimelineAsset timeline = target as TimelineAsset; + AssetDatabase.OpenAsset(timeline); + } + } + else if (t == typeof(PlayableDirector)) + { + if (GUILayout.Button("Open Director")) + { + PlayableDirector director = target as PlayableDirector; + + AssetDatabase.OpenAsset(director.playableAsset); + Selection.activeObject = director.gameObject; + } + } + else if (t == typeof(Shader)) + { + if (GUILayout.Button("Open Shader")) + { + Shader shader = target as Shader; + AssetDatabase.OpenAsset(shader); + } + } + else + { + if (GUILayout.Button("Select")) + { + Selection.activeObject = target; + } + } + } + } +} + diff --git a/LocalPackages/net.peeweek.gameplay-ingredients/Runtime/Actions/ApplicationExitAction.cs.meta b/LocalPackages/net.peeweek.gameplay-ingredients/Editor/Discover/DiscoverEditor.cs.meta similarity index 83% rename from LocalPackages/net.peeweek.gameplay-ingredients/Runtime/Actions/ApplicationExitAction.cs.meta rename to LocalPackages/net.peeweek.gameplay-ingredients/Editor/Discover/DiscoverEditor.cs.meta index da3b82e..52bbef5 100644 --- a/LocalPackages/net.peeweek.gameplay-ingredients/Runtime/Actions/ApplicationExitAction.cs.meta +++ b/LocalPackages/net.peeweek.gameplay-ingredients/Editor/Discover/DiscoverEditor.cs.meta @@ -1,5 +1,5 @@ fileFormatVersion: 2 -guid: ec5c4aa8c38a45743b935b39eceb9b44 +guid: b1c258c43239c974080376d0bf372421 MonoImporter: externalObjects: {} serializedVersion: 2 diff --git a/LocalPackages/net.peeweek.gameplay-ingredients/Editor/Discover/DiscoverWindow.cs b/LocalPackages/net.peeweek.gameplay-ingredients/Editor/Discover/DiscoverWindow.cs new file mode 100644 index 0000000..17286d1 --- /dev/null +++ b/LocalPackages/net.peeweek.gameplay-ingredients/Editor/Discover/DiscoverWindow.cs @@ -0,0 +1,604 @@ +using System.Linq; +using System.Collections.Generic; +using UnityEngine; +using System; +using UnityEngine.Experimental.VFX; +using UnityEngine.SceneManagement; +using UnityEditor; +using UnityEditor.SceneManagement; +using UnityEngine.Timeline; + +namespace GameplayIngredients.Editor +{ + public class DiscoverWindow : EditorWindow + { + static List s_StartupDiscoverAssets; + + static bool GetShowOnStartup(string name) + { + return EditorPrefs.GetBool($"{name}.ShowAtStartup", true); + } + + static void SetShowOnStartup(string name, bool value) + { + if (value != GetShowOnStartup(name)) EditorPrefs.SetBool($"{name}.ShowAtStartup", value); + } + + public static void SelectDiscover(Discover discover) + { + foreach(var window in s_Windows) + { + foreach(var categoryKvp in window.discoverObjects) + { + if (categoryKvp.Value.Contains(discover)) + { + window.SetSelectedDiscover(discover); + break; + } + } + } + } + + public static void Reload() + { + EditorApplication.update -= ShowAtStartup; + s_StartupDiscoverAssets = null; + InitShowAtStartup(); + } + + [InitializeOnLoadMethod] + static void InitShowAtStartup() + { + string[] guids = AssetDatabase.FindAssets("t:DiscoverAsset"); + foreach (var guid in guids) + { + DiscoverAsset asset = AssetDatabase.LoadAssetAtPath(AssetDatabase.GUIDToAssetPath(guid)); + if (asset.EnableShowAtStartup) + { + if (s_StartupDiscoverAssets == null) + s_StartupDiscoverAssets = new List(); + + s_StartupDiscoverAssets.Add(asset); + } + } + + if (s_StartupDiscoverAssets != null && s_StartupDiscoverAssets.Count > 0) + EditorApplication.update += ShowAtStartup; + } + + static void ShowAtStartup() + { + if (!Application.isPlaying && s_StartupDiscoverAssets != null) + { + foreach (var discoverAsset in s_StartupDiscoverAssets) + { + if (GetShowOnStartup(discoverAsset.PreferenceName)) + ShowDiscoverWindow(discoverAsset); + } + } + EditorApplication.update -= ShowAtStartup; + } + + static List s_Windows; + + public static void ShowDiscoverWindow(DiscoverAsset discoverAsset) + { + if (discoverAsset != null) + { + var window = GetWindow(true); + window.SetDiscoverAsset(discoverAsset); + } + else + { + Debug.LogError("Could not open Discover Window : discoverAsset is null"); + } + } + + public DiscoverAsset discoverAsset { get; private set; } + Texture2D header; + bool forceGlobal; + + void SetDiscoverAsset(DiscoverAsset discover) + { + discoverAsset = discover; + titleContent = new GUIContent(discoverAsset.WindowTitle); + minSize = new Vector2(discoverAsset.WindowWidth, discoverAsset.WindowHeight); + maxSize = new Vector2(discoverAsset.WindowWidth, discoverAsset.WindowHeight); + } + + private void OnEnable() + { + UpdateDiscoverObjects(); + EditorSceneManager.newSceneCreated += UpdateDiscoverObjectsOnCreate; + EditorSceneManager.sceneOpened += UpdateDiscoverObjectsOnLoad; + EditorSceneSetup.onSetupLoaded += UpdateDiscoverObjectsOnLoadSetup; + + if (s_Windows == null) + s_Windows = new List(); + + if(!s_Windows.Contains(this)) + s_Windows.Add(this); + } + + private void OnDisable() + { + EditorSceneManager.newSceneCreated -= UpdateDiscoverObjectsOnCreate; + EditorSceneManager.sceneOpened -= UpdateDiscoverObjectsOnLoad; + EditorSceneSetup.onSetupLoaded -= UpdateDiscoverObjectsOnLoadSetup; + + if (s_Windows.Contains(this)) + s_Windows.Remove(this); + } + + Dictionary> discoverObjects = null; + + void UpdateDiscoverObjectsOnLoadSetup(EditorSceneSetup setup) + { + forceGlobal = false; + UpdateDiscoverObjects(); + } + + void UpdateDiscoverObjectsOnCreate(Scene scene, NewSceneSetup setup, NewSceneMode mode) + { + forceGlobal = false; + UpdateDiscoverObjects(); + } + + void UpdateDiscoverObjectsOnLoad(Scene s, OpenSceneMode s2) + { + forceGlobal = false; + UpdateDiscoverObjects(); + } + + void UpdateDiscoverObjects(bool clear = false) + { + if (discoverObjects == null) + discoverObjects = new Dictionary>(); + + if (clear) + discoverObjects.Clear(); + + Discover[] newOnes = FindObjectsOfType(); + + // Add new ones + foreach (var item in newOnes) + { + if (!discoverObjects.ContainsKey(item.Category)) + { + discoverObjects.Add(item.Category, new List()); + } + + if (!discoverObjects[item.Category].Contains(item)) + { + discoverObjects[item.Category].Add(item); + } + } + + // Cleanup Empty Entries + Dictionary> cleanedUpLists = new Dictionary>(); + + foreach (var categoryKvp in discoverObjects) + { + cleanedUpLists.Add(categoryKvp.Key, categoryKvp.Value.Where((o) => o != null).ToList()); + } + foreach (var categoryKvp in cleanedUpLists) + { + discoverObjects[categoryKvp.Key] = categoryKvp.Value; + } + + // Cleanup Empty Categories + List toDelete = new List(); + foreach (var categoryKvp in discoverObjects) + { + if (categoryKvp.Value == null || categoryKvp.Value.Count == 0) + toDelete.Add(categoryKvp.Key); + } + foreach (var category in toDelete) + { + discoverObjects.Remove(category); + } + + // Finally, sort items in each category + foreach (var categoryKvp in discoverObjects) + { + discoverObjects[categoryKvp.Key].Sort((a, b) => { return Comparer.Default.Compare(a.Priority, b.Priority); }); + } + + // Ensure something is selected is possible + + if (selectedDiscover == null) // Try Fetching a default + { + foreach (var categoryKvp in discoverObjects) + { + selectedDiscover = categoryKvp.Value.FirstOrDefault(o => o.DefaultSelected == true); + if (selectedDiscover != null) + break; + } + } + if (selectedDiscover == null && discoverObjects != null && discoverObjects.Count > 0) + { + selectedDiscover = discoverObjects.First().Value.First(); + } + + Repaint(); + } + + private void OnGUI() + { + // Draw Header Image + if (discoverAsset.HeaderTexture != null) + { + if (header == null || header != discoverAsset.HeaderTexture) + header = discoverAsset.HeaderTexture; + + Rect headerRect = GUILayoutUtility.GetRect(header.width, header.height); + GUI.DrawTexture(headerRect, header); + } + else + { + Rect headerRect = GUILayoutUtility.GetRect(discoverAsset.WindowWidth, 80); + EditorGUI.DrawRect(headerRect, new Color(0,0,0,0.2f)); + headerRect.xMin += 16; + headerRect.yMin += 16; + GUI.Label(headerRect, discoverAsset.WindowTitle, Styles.header); + } + + bool hasContent = discoverObjects != null && discoverObjects.Count > 0; + + // Draw Navigation Bar + EditorGUI.BeginDisabledGroup(!hasContent); + using (new GUILayout.AreaScope(new Rect(discoverAsset.WindowWidth - 168, 8, 160, 20))) + { + using (new GUILayout.HorizontalScope(Styles.tabContainer)) + { + bool value = forceGlobal; + EditorGUI.BeginChangeCheck(); + value = GUILayout.Toggle(forceGlobal || !hasContent, "Levels", Styles.buttonLeft); + if (EditorGUI.EndChangeCheck()) + { + forceGlobal = true; + } + + EditorGUI.BeginChangeCheck(); + value = GUILayout.Toggle(!forceGlobal && hasContent, "Discover", Styles.buttonRight); + if (EditorGUI.EndChangeCheck()) + { + forceGlobal = false; + } + } + } + EditorGUI.EndDisabledGroup(); + + // Draw Content + if (!hasContent || forceGlobal) + GlobalContentGUI(); + else + SceneContentGUI(); + + // Draw Footer + Rect line = GUILayoutUtility.GetRect(discoverAsset.WindowWidth, 1); + EditorGUI.DrawRect(line, Color.black); + using (new GUILayout.HorizontalScope()) + { + if(discoverAsset.EnableShowAtStartup) + { + EditorGUI.BeginChangeCheck(); + bool showOnStartup = GUILayout.Toggle(GetShowOnStartup(discoverAsset.PreferenceName), " Show this window on startup"); + if (EditorGUI.EndChangeCheck()) + { + SetShowOnStartup(discoverAsset.PreferenceName, showOnStartup); + } + } + + GUILayout.FlexibleSpace(); + + if(discoverAsset.Debug) + { + if (GUILayout.Button("Select DiscoverAsset")) + Selection.activeObject = discoverAsset; + + if (GUILayout.Button("Reload")) + UpdateDiscoverObjects(true); + } + + if (GUILayout.Button("Close")) + { + Close(); + } + } + } + + Vector2 globalContentScroll; + + void GlobalContentGUI() + { + globalContentScroll = GUILayout.BeginScrollView(globalContentScroll); + using (new GUILayout.VerticalScope(Styles.indent)) + { + GUILayout.Label(discoverAsset.Title, Styles.header); + using (new GUILayout.VerticalScope(Styles.indent)) + { + GUILayout.Label(discoverAsset.Description, Styles.body); + + if(discoverAsset.Scenes != null) + { + foreach (var map in discoverAsset.Scenes) + { + using (new GroupLabelScope(map.Title)) + { + GUILayout.Label(map.Description, Styles.body); + + using (new GUILayout.HorizontalScope()) + { + GUILayout.FlexibleSpace(); + + if (map.SceneSetups != null) + { + foreach(var sceneSetup in map.SceneSetups) + { + if (sceneSetup != null && GUILayout.Button($"Open {sceneSetup.name}")) + LoadSceneSetup(sceneSetup); + } + } + if(map.SingleScenes != null) + { + foreach(var singleScene in map.SingleScenes) + { + if (singleScene != null && GUILayout.Button($"Open {singleScene.name}")) + LoadSingleScene(singleScene); + } + } + + } + } + } + } + } + } + GUILayout.FlexibleSpace(); + GUILayout.EndScrollView(); + } + + Discover selectedDiscover; + Vector2 listScroll; + Vector2 contentScroll; + + void SceneContentGUI() + { + using (new GUILayout.HorizontalScope()) + { + using (new GUILayout.VerticalScope()) + { + listScroll = GUILayout.BeginScrollView(listScroll, GUI.skin.box, GUILayout.Width(discoverAsset.DiscoverListWidth)); + using (new GUILayout.VerticalScope(GUILayout.ExpandHeight(true))) + { + foreach (var category in discoverObjects.Keys.OrderBy((x) => x.ToString())) + { + if(!string.IsNullOrEmpty(category)) + GUILayout.Label(category, EditorStyles.boldLabel); + + foreach (var item in discoverObjects[category]) + { + EditorGUI.BeginChangeCheck(); + bool value = GUILayout.Toggle(item == selectedDiscover, item.Name, Styles.listItem); + + if (value) + { + // Select the new one if not selected + if(selectedDiscover != item) + { + if (EditorGUI.EndChangeCheck()) + { + if (discoverAsset.Debug) + Selection.activeObject = item; + + SetSelectedDiscover(item); + } + } + + Rect r = GUILayoutUtility.GetLastRect(); + int c = EditorGUIUtility.isProSkin ? 1 : 0; + EditorGUI.DrawRect(r, new Color(c, c, c, 0.1f)); + } + } + } + + GUILayout.FlexibleSpace(); + } + GUILayout.EndScrollView(); + } + GUILayout.Space(4); + + using (new GUILayout.VerticalScope(GUILayout.Width(440))) + { + contentScroll = GUILayout.BeginScrollView(contentScroll); + GUILayout.Space(8); + + DiscoverEditor.DrawDiscoverContentGUI(selectedDiscover); + + GUILayout.FlexibleSpace(); + GUILayout.EndScrollView(); + } + } + } + + void SetSelectedDiscover(Discover newSelection) + { + + if (SceneView.lastActiveSceneView != null && newSelection.AlignViewToTransform) + { + SceneView.lastActiveSceneView.AlignViewToObject(newSelection.transform); + } + + if (selectedDiscover.ObjectsToToggle != null) + { + // Reverse Toggle previous GameObjects state + foreach (var go in selectedDiscover.ObjectsToToggle) + { + if (go.GameObject == null) + continue; + + switch (go.State) + { + case Actions.ToggleGameObjectAction.GameObjectToggle.GameObjectToggleState.Disable: + go.GameObject.SetActive(true); + break; + case Actions.ToggleGameObjectAction.GameObjectToggle.GameObjectToggleState.Enable: + go.GameObject.SetActive(false); + break; + case Actions.ToggleGameObjectAction.GameObjectToggle.GameObjectToggleState.Toggle: + go.GameObject.SetActive(go.GameObject.activeSelf); + break; + } + } + } + + // Set the new item + selectedDiscover = newSelection; + + if (selectedDiscover.ObjectsToToggle != null) + { + // Toggle Next GameObjects State + foreach (var go in selectedDiscover.ObjectsToToggle) + { + if (go.GameObject == null) + continue; + + switch (go.State) + { + case Actions.ToggleGameObjectAction.GameObjectToggle.GameObjectToggleState.Disable: + go.GameObject.SetActive(false); + break; + case Actions.ToggleGameObjectAction.GameObjectToggle.GameObjectToggleState.Enable: + go.GameObject.SetActive(true); + break; + case Actions.ToggleGameObjectAction.GameObjectToggle.GameObjectToggleState.Toggle: + go.GameObject.SetActive(go.GameObject.activeSelf); + break; + } + } + } + contentScroll = Vector2.zero; + } + + void LoadSceneSetup(EditorSceneSetup setup) + { + try + { + EditorUtility.DisplayProgressBar("Discover", $"Opening {setup.name}...", 0.9f); + forceGlobal = false; + EditorSceneSetup.RestoreSetup(setup); + } + catch + { + Debug.LogError($"Could not load EditorSceneSetup : {setup.name}"); + } + finally + { + EditorUtility.ClearProgressBar(); + UpdateDiscoverObjects(); + } + } + + void LoadSingleScene(SceneAsset scene) + { + try + { + EditorUtility.DisplayProgressBar("Discover", $"Opening {scene.name}...", 0.9f); + forceGlobal = false; + EditorSceneManager.OpenScene(AssetDatabase.GetAssetPath(scene), OpenSceneMode.Single); + } + catch + { + Debug.LogError($"Could not load Scene : {scene.name}"); + } + finally + { + EditorUtility.ClearProgressBar(); + UpdateDiscoverObjects(); + } + } + + public class GroupLabelScope : GUILayout.VerticalScope + { + public GroupLabelScope(string name) : base(Styles.box) + { + if(!string.IsNullOrWhiteSpace(name)) + { + GUIContent n = new GUIContent(name); + Rect r = GUILayoutUtility.GetRect(n, Styles.boxHeader, GUILayout.ExpandWidth(true)); + GUI.Label(r, n, Styles.boxHeader); + } + + } + } + + public static class Styles + { + public static GUIStyle indent; + public static GUIStyle slightIndent; + + public static GUIStyle header; + public static GUIStyle subHeader; + public static GUIStyle body; + + public static GUIStyle box; + public static GUIStyle boxHeader; + + public static GUIStyle listItem; + + public static GUIStyle buttonLeft; + public static GUIStyle buttonMid; + public static GUIStyle buttonRight; + + public static GUIStyle tabContainer; + + static Styles() + { + header = new GUIStyle(EditorStyles.wordWrappedLabel); + header.fontSize = 24; + header.padding = new RectOffset(0, 0, -4, -4); + header.richText = true; + + subHeader = new GUIStyle(EditorStyles.wordWrappedLabel); + subHeader.fontSize = 11; + subHeader.fontStyle = FontStyle.Italic; + + body = new GUIStyle(EditorStyles.wordWrappedLabel); + body.fontSize = 11; + body.richText = true; + + indent = new GUIStyle(); + indent.padding = new RectOffset(12, 12, 12, 12); + + slightIndent = new GUIStyle(); + slightIndent.padding = new RectOffset(6, 6, 0, 6); + + box = new GUIStyle(EditorStyles.helpBox); + + boxHeader = new GUIStyle(GUI.skin.box); + boxHeader.normal.textColor = GUI.skin.label.normal.textColor; + boxHeader.fixedHeight = 20; + boxHeader.fontSize = 11; + boxHeader.fontStyle = FontStyle.Bold; + boxHeader.alignment = TextAnchor.UpperLeft; + boxHeader.margin = new RectOffset(0, 0, 0, 6); + + listItem = new GUIStyle(EditorStyles.label); + listItem.padding = new RectOffset(12, 0, 2, 2); + + buttonLeft = new GUIStyle(EditorStyles.miniButtonLeft); + buttonLeft.fontSize = 11; + buttonMid = new GUIStyle(EditorStyles.miniButtonMid); + buttonMid.fontSize = 11; + buttonRight = new GUIStyle(EditorStyles.miniButtonRight); + buttonRight.fontSize = 11; + + tabContainer = new GUIStyle(EditorStyles.miniButton); + tabContainer.padding = new RectOffset(4, 4, 0, 0); + + } + } + } + +} diff --git a/LocalPackages/net.peeweek.gameplay-ingredients/Editor/Discover/DiscoverWindow.cs.meta b/LocalPackages/net.peeweek.gameplay-ingredients/Editor/Discover/DiscoverWindow.cs.meta new file mode 100644 index 0000000..6ff66c9 --- /dev/null +++ b/LocalPackages/net.peeweek.gameplay-ingredients/Editor/Discover/DiscoverWindow.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 6206e16563e844a4f897a8cc92efc86a +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/LocalPackages/net.peeweek.gameplay-ingredients/Editor/EditorSceneSetup.meta b/LocalPackages/net.peeweek.gameplay-ingredients/Editor/EditorSceneSetup.meta new file mode 100644 index 0000000..c4ed9a3 --- /dev/null +++ b/LocalPackages/net.peeweek.gameplay-ingredients/Editor/EditorSceneSetup.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: da253dff53554a5498211c4caae380cc +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/LocalPackages/net.peeweek.gameplay-ingredients/Editor/EditorSceneSetup/EditorSceneSetup.cs b/LocalPackages/net.peeweek.gameplay-ingredients/Editor/EditorSceneSetup/EditorSceneSetup.cs new file mode 100644 index 0000000..bab266f --- /dev/null +++ b/LocalPackages/net.peeweek.gameplay-ingredients/Editor/EditorSceneSetup/EditorSceneSetup.cs @@ -0,0 +1,108 @@ +using UnityEngine; +using UnityEditor; +using UnityEngine.SceneManagement; +using UnityEditor.SceneManagement; +using UnityEditor.Callbacks; + +namespace GameplayIngredients.Editor +{ + public class EditorSceneSetup : ScriptableObject + { + [MenuItem("File/Save Scene Setup As... #%&S", priority = 171)] + static void SaveSetup() + { + string path = EditorUtility.SaveFilePanelInProject("Save EditorSceneSetup", "New EditorSceneSetup", "asset", "Save EditorSceneSetup?"); + if(path != string.Empty) + { + EditorSceneSetup setup = GetCurrentSetup(); + AssetDatabase.CreateAsset(setup, path); + } + + } + + public delegate void EditorSceneSetupLoadedDelegate(EditorSceneSetup setup); + public static event EditorSceneSetupLoadedDelegate onSetupLoaded; + + [OnOpenAsset] + static bool OnOpenAsset(int instanceID, int line) + { + var obj = EditorUtility.InstanceIDToObject(instanceID); + if(obj is EditorSceneSetup) + { + EditorSceneSetup setup = (EditorSceneSetup)obj; + int active = setup.ActiveScene; + + try + { + EditorUtility.DisplayProgressBar("Loading Scenes", string.Format("Loading Scene Setup {0}....", setup.name), 1.0f); + RestoreSetup(setup); + } + finally + { + EditorUtility.ClearProgressBar(); + } + return true; + } + return false; + } + + [MenuItem("Assets/Create/Editor Scene Setup", priority = 200)] + static void CreateAsset() + { + AssetFactory.CreateAssetInProjectWindow("SceneSet Icon", "New SceneSetup.asset"); + } + + public int ActiveScene; + public EditorScene[] LoadedScenes; + + [System.Serializable] + public struct EditorScene + { + public SceneAsset Scene; + public bool Loaded; + } + + public static EditorSceneSetup GetCurrentSetup() + { + var scenesetups = EditorSceneManager.GetSceneManagerSetup(); + + var editorSetup = CreateInstance(); + + int i = 0; + editorSetup.LoadedScenes = new EditorScene[scenesetups.Length]; + foreach(var setup in scenesetups) + { + if (setup.isActive) + editorSetup.ActiveScene = i; + + editorSetup.LoadedScenes[i].Scene = AssetDatabase.LoadAssetAtPath(setup.path); + editorSetup.LoadedScenes[i].Loaded = setup.isLoaded; + + i++; + } + return editorSetup; + } + + public static void RestoreSetup(EditorSceneSetup editorSetup) + { + SceneSetup[] setups = new SceneSetup[editorSetup.LoadedScenes.Length]; + + for(int i = 0; i < setups.Length; i++) + { + setups[i] = new SceneSetup(); + string path = AssetDatabase.GetAssetPath(editorSetup.LoadedScenes[i].Scene); + setups[i].path = path; + setups[i].isLoaded = editorSetup.LoadedScenes[i].Loaded; + setups[i].isActive = (editorSetup.ActiveScene == i); + } + + EditorSceneManager.RestoreSceneManagerSetup(setups); + + if(onSetupLoaded != null) + onSetupLoaded.Invoke(editorSetup); + } + + } +} + + diff --git a/LocalPackages/net.peeweek.gameplay-ingredients/Editor/EditorSceneSetup/EditorSceneSetup.cs.meta b/LocalPackages/net.peeweek.gameplay-ingredients/Editor/EditorSceneSetup/EditorSceneSetup.cs.meta new file mode 100644 index 0000000..69f00ef --- /dev/null +++ b/LocalPackages/net.peeweek.gameplay-ingredients/Editor/EditorSceneSetup/EditorSceneSetup.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 8bf8857f1af056d4894bee553e091ceb +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {fileID: 5498606499726036565, guid: 0000000000000000d000000000000000, type: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/LocalPackages/net.peeweek.gameplay-ingredients/Editor/EditorSceneSetup/EditorSceneSetupEditor.cs b/LocalPackages/net.peeweek.gameplay-ingredients/Editor/EditorSceneSetup/EditorSceneSetupEditor.cs new file mode 100644 index 0000000..7edba88 --- /dev/null +++ b/LocalPackages/net.peeweek.gameplay-ingredients/Editor/EditorSceneSetup/EditorSceneSetupEditor.cs @@ -0,0 +1,88 @@ +using System.Collections; +using System.Collections.Generic; +using UnityEngine; +using UnityEditor; +using UnityEditorInternal; +using System; + +namespace GameplayIngredients.Editor +{ + [CustomEditor(typeof(EditorSceneSetup))] + public class EditorSceneSetupEditor : UnityEditor.Editor + { + ReorderableList m_List; + + SerializedProperty m_LoadedScenes; + SerializedProperty m_ActiveScene; + + private void OnEnable() + { + m_ActiveScene = serializedObject.FindProperty("ActiveScene"); + m_LoadedScenes = serializedObject.FindProperty("LoadedScenes"); + + m_List = new ReorderableList(serializedObject, m_LoadedScenes, true, true, true, true); + m_List.drawElementCallback = OnDrawElement; + m_List.drawHeaderCallback = OnDrawHeader; + + } + + private void OnDrawHeader(Rect rect) + { + GUI.Label(rect, "Scene List"); + } + + private void OnDrawElement(Rect rect, int index, bool isActive, bool isFocused) + { + var toggleRect = rect; + toggleRect.width = 16; + toggleRect.yMin += 2; + + var sceneRect = rect; + sceneRect.xMin += 24; + sceneRect.xMax -= 80; + sceneRect.yMin += 2; + sceneRect.height = 16; + + var loadedRect = rect; + loadedRect.xMin = rect.xMax - 80; + loadedRect.yMin += 2; + + bool active = m_ActiveScene.intValue == index; + bool newActive = GUI.Toggle(toggleRect, active, GUIContent.none); + if(GUI.changed && newActive != active) + { + m_ActiveScene.intValue = index; + } + + var sceneAsset = (SceneAsset)EditorGUI.ObjectField(sceneRect, m_LoadedScenes.GetArrayElementAtIndex(index).FindPropertyRelative("Scene").objectReferenceValue, typeof(SceneAsset), false); + if (GUI.changed) + { + m_LoadedScenes.GetArrayElementAtIndex(index).FindPropertyRelative("Scene").objectReferenceValue = sceneAsset; + } + + EditorGUI.BeginDisabledGroup(index == 0); + int visible = m_LoadedScenes.GetArrayElementAtIndex(index).FindPropertyRelative("Loaded").boolValue ? 1 : 0; + visible = EditorGUI.IntPopup(loadedRect, visible, kLoadedItems, kLoadedIndices); + + if(GUI.changed) + { + m_LoadedScenes.GetArrayElementAtIndex(index).FindPropertyRelative("Loaded").boolValue = visible == 1 ? true : false; + } else if(index == 0) + { + m_LoadedScenes.GetArrayElementAtIndex(index).FindPropertyRelative("Loaded").boolValue = true; + } + EditorGUI.EndDisabledGroup(); + serializedObject.ApplyModifiedProperties(); + } + + static readonly int[] kLoadedIndices = new int[2] { 0, 1 }; + static readonly GUIContent[] kLoadedItems = new GUIContent[2] { new GUIContent("Not Loaded"), new GUIContent("Loaded") }; + + public override void OnInspectorGUI() + { + m_List.DoLayoutList(); + } + } +} + + diff --git a/LocalPackages/net.peeweek.gameplay-ingredients/Editor/EditorSceneSetup/EditorSceneSetupEditor.cs.meta b/LocalPackages/net.peeweek.gameplay-ingredients/Editor/EditorSceneSetup/EditorSceneSetupEditor.cs.meta new file mode 100644 index 0000000..fbcd746 --- /dev/null +++ b/LocalPackages/net.peeweek.gameplay-ingredients/Editor/EditorSceneSetup/EditorSceneSetupEditor.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: a0875758aceaa3a4b96c65bf4fb85f50 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/LocalPackages/net.peeweek.gameplay-ingredients/Editor/FindAndReplace.meta b/LocalPackages/net.peeweek.gameplay-ingredients/Editor/FindAndReplace.meta new file mode 100644 index 0000000..2426b7d --- /dev/null +++ b/LocalPackages/net.peeweek.gameplay-ingredients/Editor/FindAndReplace.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 869fd8f9cbfa0cd468609db02f580990 +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/LocalPackages/net.peeweek.gameplay-ingredients/Editor/FindAndReplace/FindAndReplaceWindow.cs b/LocalPackages/net.peeweek.gameplay-ingredients/Editor/FindAndReplace/FindAndReplaceWindow.cs new file mode 100644 index 0000000..3e401ce --- /dev/null +++ b/LocalPackages/net.peeweek.gameplay-ingredients/Editor/FindAndReplace/FindAndReplaceWindow.cs @@ -0,0 +1,462 @@ +using System.Reflection; +using System; +using System.Linq; +using System.Collections.Generic; +using UnityEngine; +using UnityEngine.SceneManagement; +using UnityEditor; +using UnityEditor.IMGUI.Controls; + +namespace GameplayIngredients.Editor +{ + public class FindAndReplaceWindow : EditorWindow + { + [MenuItem("Edit/Find And Replace... %&#F", priority = 144)] + static void OpenWindow() + { + GetWindow(); + } + + static readonly Dictionary s_assemblyTypes = GetTypes(); + + private static Dictionary GetTypes() + { + Dictionary all = new Dictionary(); + + foreach (var assembly in AppDomain.CurrentDomain.GetAssemblies()) + { + foreach (Type t in assembly.GetTypes()) + { + if (typeof(Component).IsAssignableFrom(t) && !all.ContainsKey(t.Name)) + all.Add(t.Name, t); + } + } + + return all; + } + + + + public enum SearchBy + { + Name, + ComponentType, + Tag, + Layer, + Mesh, + Material, + Selection + } + + private void OnEnable() + { + titleContent = Contents.title; + minSize = new Vector2(640, 280); + } + + private void OnGUI() + { + using (new GUILayout.HorizontalScope()) + { + using (new GUILayout.VerticalScope(GUILayout.Width(320))) + { + SearchControlsGUI(); + } + + using (new GUILayout.VerticalScope(GUILayout.Width(4))) + { + GUILayout.FlexibleSpace(); + Rect r = GUILayoutUtility.GetLastRect(); + EditorGUI.DrawRect(r, Color.black); + } + + using (new GUILayout.VerticalScope()) + { + SearchResultsGUI(); + } + + } + } + + [SerializeField] + GameObject prefabReplacement; + [SerializeField] + SearchBy searchBy; + + [SerializeField] + string nameSearch = "GameObject"; + [SerializeField] + string tagSearch = "Player"; + [SerializeField] + string layerSearch = "PostProcessing"; + [SerializeField] + string componentSearch = "Light"; + [SerializeField] + Mesh meshSearch; + [SerializeField] + Material materialSearch; + [SerializeField] + bool selectionRecurse = false; + + [SerializeField] + bool keepPosition = true; + [SerializeField] + bool keepRotation = true; + [SerializeField] + bool keepScale = false; + [SerializeField] + bool keepParenting = true; + [SerializeField] + bool keepName = true; + [SerializeField] + bool keepTag = false; + [SerializeField] + bool keepLayer = true; + [SerializeField] + bool keepStatic = false; + [SerializeField] + bool unpackPrefab = false; + + enum SearchOp + { + Find, + Add, + Refine + } + + void SearchControlsGUI() + { + EditorGUIUtility.labelWidth = 120; + GUILayout.Space(4); + GUILayout.Label("Search Scene Objects", Styles.boldLabel); + searchBy = (SearchBy)EditorGUILayout.EnumPopup(Contents.criteria, searchBy); + switch (searchBy) + { + case SearchBy.Name: + nameSearch = EditorGUILayout.TextField(Contents.nameSearch, nameSearch); + SearchButtonsGUI(searchBy, nameSearch); + break; + case SearchBy.Tag: + tagSearch = EditorGUILayout.TextField(Contents.tagSearch, tagSearch); + SearchButtonsGUI(searchBy, tagSearch); + break; + case SearchBy.Layer: + layerSearch = EditorGUILayout.TextField(Contents.layerSearch, layerSearch); + SearchButtonsGUI(searchBy, layerSearch); + break; + case SearchBy.ComponentType: + componentSearch = EditorGUILayout.TextField(Contents.componentSearch, componentSearch); + SearchButtonsGUI(searchBy, componentSearch); + break; + case SearchBy.Mesh: + meshSearch = (Mesh)EditorGUILayout.ObjectField(Contents.meshSearch, meshSearch, typeof(Mesh), true); + SearchButtonsGUI(searchBy, meshSearch); + break; + case SearchBy.Material: + materialSearch = (Material)EditorGUILayout.ObjectField(Contents.materialSearch, materialSearch, typeof(Material), true); + SearchButtonsGUI(searchBy, materialSearch); + break; + case SearchBy.Selection: + selectionRecurse = EditorGUILayout.Toggle(Contents.selectionRecurse, selectionRecurse); + SearchButtonsGUI(searchBy, selectionRecurse); + break; + + } + + + GUILayout.FlexibleSpace(); + GUILayout.Label("Replace Results", Styles.boldLabel); + prefabReplacement = (GameObject)EditorGUILayout.ObjectField(Contents.prefabReplacement, prefabReplacement, typeof(GameObject), true); + + if (prefabReplacement != null) + { + PrefabAssetType type = PrefabUtility.GetPrefabAssetType(prefabReplacement); + bool isAPrefab = type == PrefabAssetType.Model || type == PrefabAssetType.Regular || type == PrefabAssetType.Variant; + if(isAPrefab) + unpackPrefab = EditorGUILayout.Toggle("Unpack Prefab", unpackPrefab); + } + EditorGUI.BeginDisabledGroup(prefabReplacement == null); + + GUILayout.Label("Keep Properties from Original:"); + + using (new GUILayout.HorizontalScope()) + { + keepPosition = GUILayout.Toggle(keepPosition, "Position", EditorStyles.miniButtonLeft, GUILayout.Height(16)); + keepRotation = GUILayout.Toggle(keepRotation, "Rotation", EditorStyles.miniButtonMid, GUILayout.Height(16)); + keepScale = GUILayout.Toggle(keepScale, "Scale", EditorStyles.miniButtonMid, GUILayout.Height(16)); + keepParenting = GUILayout.Toggle(keepParenting, "Parenting", EditorStyles.miniButtonRight, GUILayout.Height(16)); + } + using (new GUILayout.HorizontalScope()) + { + keepName = GUILayout.Toggle(keepName, "Name", EditorStyles.miniButtonLeft, GUILayout.Height(16)); + keepTag = GUILayout.Toggle(keepTag, "Tag", EditorStyles.miniButtonMid, GUILayout.Height(16)); + keepLayer = GUILayout.Toggle(keepLayer, "Layer", EditorStyles.miniButtonMid, GUILayout.Height(16)); + keepStatic = GUILayout.Toggle(keepStatic, "Static", EditorStyles.miniButtonRight, GUILayout.Height(16)); + } + + if (GUILayout.Button("Replace All", Styles.bigButton, GUILayout.Height(24)) && prefabReplacement != null) + { + Undo.RecordObjects(searchResults.ToArray(), "Replace Objects"); + + for(int i = 0; i < searchResults.Count; i++) + { + var obj = searchResults[i]; + var newObj = SwapObject(obj, prefabReplacement, searchResults); + searchResults[i] = newObj; + } + } + EditorGUI.EndDisabledGroup(); + GUILayout.Space(8); + } + + GameObject SwapObject(GameObject toReplace, GameObject replacement, List others) + { + GameObject newObj; + + if (PrefabUtility.GetPrefabAssetType(replacement) != PrefabAssetType.NotAPrefab && !unpackPrefab) + newObj = (GameObject)PrefabUtility.InstantiatePrefab(replacement); + else + newObj = Instantiate(replacement); + + if (keepName) + newObj.name = toReplace.name; + + if(keepPosition) + newObj.transform.position = toReplace.transform.position; + if(keepRotation) + newObj.transform.rotation = toReplace.transform.rotation; + if(keepParenting) + newObj.transform.parent = toReplace.transform.parent; + if(keepScale) + newObj.transform.localScale = toReplace.transform.localScale; + + if(keepTag) + newObj.tag = toReplace.tag; + if(keepLayer) + newObj.layer = toReplace.layer; + if(keepStatic) + newObj.isStatic = toReplace.isStatic; + + foreach(var other in others) + { + if(other.transform.parent == toReplace.transform) + { + other.transform.parent = newObj.transform; + } + } + + DestroyImmediate(toReplace); + + return newObj; + } + + void SearchButtonsGUI(SearchBy by, object criteria) + { + using (new GUILayout.HorizontalScope()) + { + if (GUILayout.Button("Find", Styles.bigButton, GUILayout.Height(24))) + Search(SearchOp.Find, by, criteria); + + if (GUILayout.Button("Add", Styles.bigButton, GUILayout.Height(24))) + Search(SearchOp.Add, by, criteria); + + if (GUILayout.Button("Refine", Styles.bigButton, GUILayout.Height(24))) + Search(SearchOp.Refine, by, criteria); + + } + } + + static GameObject[] FindAllSceneObjects() + { + var all = Resources.FindObjectsOfTypeAll(); + all = all.Where(o => o.scene.isLoaded).ToArray(); + return all; + } + + void Search(SearchOp op, SearchBy by, object criteria) + { + List query = new List(); + + var all = FindAllSceneObjects(); + + switch (by) + { + case SearchBy.Name: + foreach(var go in all) + { + if (go.name.Contains((string)criteria)) + query.Add(go); + } + break; + case SearchBy.Tag: + query.AddRange(GameObject.FindGameObjectsWithTag((string)criteria)); + break; + case SearchBy.Layer: + foreach (var go in all) + { + if (go.layer == LayerMask.NameToLayer((string)criteria)) + query.Add(go); + } + break; + case SearchBy.ComponentType: + if(s_assemblyTypes.ContainsKey((string)criteria)) + { + Type t = s_assemblyTypes[(string)criteria]; + if( typeof(Component).IsAssignableFrom(t)) + { + Component[] components = (Component[])Resources.FindObjectsOfTypeAll(t); + if(components != null) + { + foreach(var c in components) + { + if (c.gameObject.scene != null && !query.Contains(c.gameObject)) + query.Add(c.gameObject); + } + } + } + } + break; + case SearchBy.Mesh: + Mesh mesh = (Mesh)criteria; + foreach (var go in all) + { + MeshFilter filter = go.GetComponent(); + if (filter != null && filter.sharedMesh == mesh) + { + query.Add(go); + } + } + break; + case SearchBy.Material: + Material mat = (Material)criteria; + foreach (var go in all) + { + Renderer renderer = go.GetComponent(); + if (renderer != null) + { + if(renderer.sharedMaterials.Contains(mat)) + { + query.Add(go); + } + } + } + break; + case SearchBy.Selection: + + foreach(var selected in Selection.gameObjects) + { + bool recurse = (bool)criteria; + if(!recurse) + query.Add(selected); + else + query.AddRange(selected.GetAllChildren()); + } + break; + } + + switch (op) + { + case SearchOp.Find: + searchResults = query; + break; + case SearchOp.Add: + foreach(var item in query) + { + if (!searchResults.Contains(item)) + searchResults.Add(item); + } + break; + case SearchOp.Refine: + List refined = new List(); + foreach (var item in searchResults) + { + if (query.Contains(item)) + refined.Add(item); + } + searchResults = refined; + break; + } + } + + [SerializeField] + List searchResults= new List(); + Vector2 scroll; + + void SearchResultsGUI() + { + using (new GUILayout.HorizontalScope()) + { + GUILayout.Label("Search Results", Styles.boldLabel); + GUILayout.FlexibleSpace(); + + if(GUILayout.Button("Select in Scene", GUILayout.Height(24))) + { + Selection.objects = searchResults.ToArray(); + } + if(GUILayout.Button("Clear", GUILayout.Height(24))) + { + searchResults.Clear(); + } + } + + scroll = GUILayout.BeginScrollView(scroll, EditorStyles.helpBox); + { + GameObject toRemove = null; + + // Trim all nulls + searchResults = searchResults.Where(o => o != null).ToList(); + + foreach(var obj in searchResults) + { + using (new GUILayout.HorizontalScope(EditorStyles.textField)) + { + GUILayout.Label(obj.name, EditorStyles.label); + if(GUILayout.Button("X", GUILayout.Width(32))) + { + toRemove = obj; + } + } + } + + if (toRemove != null) + searchResults.Remove(toRemove); + } + GUILayout.EndScrollView(); + + } + + static class Contents + { + public static GUIContent title = new GUIContent("Find and Replace", (Texture)EditorGUIUtility.LoadRequired("ViewToolZoom On")); + public static GUIContent criteria = new GUIContent("Criteria"); + public static GUIContent nameSearch = new GUIContent("GameObject Name"); + public static GUIContent tagSearch = new GUIContent("Tag"); + public static GUIContent layerSearch = new GUIContent("Layer"); + public static GUIContent componentSearch = new GUIContent("Component Type"); + public static GUIContent meshSearch = new GUIContent("Mesh"); + public static GUIContent materialSearch = new GUIContent("Material"); + public static GUIContent selectionRecurse = new GUIContent("Include Children"); + public static GUIContent prefabReplacement = new GUIContent("Prefab Replacement"); + } + + static class Styles + { + public static readonly GUIStyle boldLabel = GetBoldLabel(); + public static readonly GUIStyle bigButton = GetBigButton(); + + static GUIStyle GetBoldLabel() + { + var style = new GUIStyle(EditorStyles.boldLabel); + style.fontSize = 14; + return style; + } + + static GUIStyle GetBigButton() + { + var style = new GUIStyle(EditorStyles.miniButton); + style.fontSize = 14; + return style; + } + } + } +} diff --git a/LocalPackages/net.peeweek.gameplay-ingredients/Editor/FindAndReplace/FindAndReplaceWindow.cs.meta b/LocalPackages/net.peeweek.gameplay-ingredients/Editor/FindAndReplace/FindAndReplaceWindow.cs.meta new file mode 100644 index 0000000..4510084 --- /dev/null +++ b/LocalPackages/net.peeweek.gameplay-ingredients/Editor/FindAndReplace/FindAndReplaceWindow.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 2ee173722a41c4c4c8388b7206e59a83 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/LocalPackages/net.peeweek.gameplay-ingredients/Editor/GameViewLink.meta b/LocalPackages/net.peeweek.gameplay-ingredients/Editor/GameViewLink.meta new file mode 100644 index 0000000..863569e --- /dev/null +++ b/LocalPackages/net.peeweek.gameplay-ingredients/Editor/GameViewLink.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 0b748787917f8d7459fa7973629a9afe +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/LocalPackages/net.peeweek.gameplay-ingredients/Editor/GameViewLink/LinkGameView.cs b/LocalPackages/net.peeweek.gameplay-ingredients/Editor/GameViewLink/LinkGameView.cs new file mode 100644 index 0000000..985919b --- /dev/null +++ b/LocalPackages/net.peeweek.gameplay-ingredients/Editor/GameViewLink/LinkGameView.cs @@ -0,0 +1,203 @@ +using System.Collections; +using System.Collections.Generic; +using UnityEngine; +using UnityEditor; + +namespace GameplayIngredients.Editor +{ + public static class LinkGameView + { + static readonly string kPreferenceName = "GameplayIngredients.LinkGameView"; + static readonly string kLinkCameraName = "___LINK__SCENE__VIEW__CAMERA___"; + + public static bool Active + { + get + { + // Get preference only when not playing + if (!Application.isPlaying) + m_Active = EditorPrefs.GetBool(kPreferenceName, false); + + return m_Active; + } + + set + { + // Update preference only when not playing + if(!Application.isPlaying) + EditorPrefs.SetBool(kPreferenceName, value); + + m_Active = value; + + if(s_GameObject != null) + s_GameObject.SetActive(value); + + UnityEditorInternal.InternalEditorUtility.RepaintAllViews(); + } + } + + static bool m_Active = false; + + + public static SceneView LockedSceneView + { + get + { + return s_LockedSceneView; + } + + set + { + s_LockedSceneView = value; + } + } + + static SceneView s_LockedSceneView; + + [InitializeOnLoadMethod] + static void Initialize() + { + SceneView.duringSceneGui += Update; + EditorApplication.playModeStateChanged += OnPlayModeChanged; + } + + static void OnPlayModeChanged(PlayModeStateChange state) + { + // Reset State when entering editmode or play mode + if(state == PlayModeStateChange.EnteredEditMode || state == PlayModeStateChange.EnteredPlayMode) + { + if (Active) + Active = true; + else + Active = false; + } + else // Cleanup before switching state + { + if (s_GameObject != null) + Object.DestroyImmediate(s_GameObject); + } + } + + const string kMenuPath = "Edit/Link SceneView and GameView %,"; + public const int kMenuPriority = 230; + + [MenuItem(kMenuPath, priority = kMenuPriority, validate = false)] + static void Toggle() + { + if (Active) + Active = false; + else + Active = true; + } + + [MenuItem(kMenuPath, priority = kMenuPriority, validate = true)] + static bool ToggleCheck() + { + Menu.SetChecked(kMenuPath, Active); + return SceneView.sceneViews.Count > 0; + } + + static GameObject s_GameObject; + + + static void Update(SceneView sceneView) + { + // Check if camera Exists + if (s_GameObject == null) + { + // If disconnected (should not happen, but hey...) + var result = GameObject.Find(kLinkCameraName); + + if (result != null) // reconnect + s_GameObject = result; + else // Create the camera if it does not exist + s_GameObject = CreateLinkedCamera(); + + if (Application.isPlaying) + Active = false; + } + + // If we have a VirtualCameraManager, manage its state here + if(Application.isPlaying && Manager.Has()) + { + var camera = Manager.Get().gameObject; + + if(camera.activeInHierarchy && Active) // We need to disable the VirtualCameraManager + { + camera.SetActive(false); + } + else if (!camera.activeInHierarchy && !Active) // We need to re-enable the VirtualCameraManager + { + camera.SetActive(true); + } + } + + if (Active) + { + var sv = s_LockedSceneView == null ? SceneView.lastActiveSceneView : s_LockedSceneView; + var sceneCamera = sv.camera; + var camera = s_GameObject.GetComponent(); + bool needRepaint = sceneCamera.transform.position != camera.transform.position + || sceneCamera.transform.rotation != camera.transform.rotation + || sceneCamera.fieldOfView != camera.fieldOfView; + + if(needRepaint) + { + s_GameObject.transform.position = sceneCamera.transform.position; + s_GameObject.transform.rotation = sceneCamera.transform.rotation; + camera.orthographic = sceneCamera.orthographic; + camera.fieldOfView = sceneCamera.fieldOfView; + camera.orthographicSize = sceneCamera.orthographicSize; + + UnityEditorInternal.InternalEditorUtility.RepaintAllViews(); + needRepaint = false; + } + } + } + + const string kDefaultPrefabName = "LinkGameViewCamera"; + + static GameObject CreateLinkedCamera() + { + // Try to find an Asset named as the default name + string[] assets = AssetDatabase.FindAssets(kDefaultPrefabName); + if(assets.Length > 0) + { + string path = AssetDatabase.GUIDToAssetPath(assets[0]); + GameObject obj = (GameObject)AssetDatabase.LoadAssetAtPath(path, typeof(GameObject)); + + if (obj != null) + { + var instance = GameObject.Instantiate(obj); + if(instance.GetComponent() != null) + { + instance.hideFlags = HideFlags.HideAndDontSave; + instance.tag = "MainCamera"; + instance.name = kLinkCameraName; + instance.SetActive(Active); + instance.GetComponent().depth = int.MaxValue; + return instance; + } + else + { + Debug.LogWarning("LinkGameView Found default prefab but has no camera!"); + } + } + else + Debug.LogWarning("LinkGameView Found default prefab but is not gameobject!"); + } + + + // Otherwise ... Create default from code + var go = new GameObject(kLinkCameraName); + go.hideFlags = HideFlags.HideAndDontSave; + go.tag = "MainCamera"; + var camera = go.AddComponent(); + camera.depth = int.MaxValue; + go.SetActive(Active); + return go; + } + + } +} + diff --git a/LocalPackages/net.peeweek.gameplay-ingredients/Editor/GameViewLink/LinkGameView.cs.meta b/LocalPackages/net.peeweek.gameplay-ingredients/Editor/GameViewLink/LinkGameView.cs.meta new file mode 100644 index 0000000..d795ec1 --- /dev/null +++ b/LocalPackages/net.peeweek.gameplay-ingredients/Editor/GameViewLink/LinkGameView.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: b80d5428a5e868b41ba603471f379a02 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/LocalPackages/net.peeweek.gameplay-ingredients/Editor/GameplayIngredients-Editor.asmdef b/LocalPackages/net.peeweek.gameplay-ingredients/Editor/GameplayIngredients-Editor.asmdef new file mode 100644 index 0000000..ab40aca --- /dev/null +++ b/LocalPackages/net.peeweek.gameplay-ingredients/Editor/GameplayIngredients-Editor.asmdef @@ -0,0 +1,20 @@ +{ + "name": "GameplayIngredients-Editor", + "references": [ + "NaughtyAttributes.Core", + "NaughtyAttributes>Editor", + "GameplayIngredients", + "Unity.ugui", + "Unity.Timeline" + ], + "includePlatforms": [ + "Editor" + ], + "excludePlatforms": [], + "allowUnsafeCode": false, + "overrideReferences": false, + "precompiledReferences": [], + "autoReferenced": true, + "defineConstraints": [], + "versionDefines": [] +} \ No newline at end of file diff --git a/LocalPackages/net.peeweek.gameplay-ingredients/Editor/GameplayIngredients-Editor.asmdef.meta b/LocalPackages/net.peeweek.gameplay-ingredients/Editor/GameplayIngredients-Editor.asmdef.meta new file mode 100644 index 0000000..4c98496 --- /dev/null +++ b/LocalPackages/net.peeweek.gameplay-ingredients/Editor/GameplayIngredients-Editor.asmdef.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: a4e1a37fe12446f47976df6a3019ef5f +AssemblyDefinitionImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/LocalPackages/net.peeweek.gameplay-ingredients/Editor/GameplayIngredientsAssetPostprocessor.cs b/LocalPackages/net.peeweek.gameplay-ingredients/Editor/GameplayIngredientsAssetPostprocessor.cs new file mode 100644 index 0000000..aeee4d3 --- /dev/null +++ b/LocalPackages/net.peeweek.gameplay-ingredients/Editor/GameplayIngredientsAssetPostprocessor.cs @@ -0,0 +1,33 @@ +using System.Linq; +using System.Collections.Generic; +using UnityEditor; +using UnityEngine; + +namespace GameplayIngredients.Editor +{ + public class GameplayIngredientsAssetPostprocessor : AssetPostprocessor + { + static void OnPostprocessAllAssets(string[] importedAssets, string[] deletedAssets, string[] movedAssets, string[] movedFromAssetPaths) + { + if (importedAssets.Contains(WelcomeScreen.kSettingsAssetPath)) + { + Debug.Log("Imported GameplayIngredientsSettings"); + WelcomeScreen.Reload(); + } + + string[] allDiscovery = AssetDatabase.FindAssets("t:DiscoverAsset"); + bool needDiscoveryReload = false; + foreach(var guid in allDiscovery) + { + string path = AssetDatabase.GUIDToAssetPath(guid); + if(importedAssets.Contains(path)) + { + needDiscoveryReload = true; + break; + } + } + if (needDiscoveryReload) + DiscoverWindow.Reload(); + } + } +} diff --git a/LocalPackages/net.peeweek.gameplay-ingredients/Editor/GameplayIngredientsAssetPostprocessor.cs.meta b/LocalPackages/net.peeweek.gameplay-ingredients/Editor/GameplayIngredientsAssetPostprocessor.cs.meta new file mode 100644 index 0000000..458ad0b --- /dev/null +++ b/LocalPackages/net.peeweek.gameplay-ingredients/Editor/GameplayIngredientsAssetPostprocessor.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: a13118b22a04c0d4d95bb500a88e59ab +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/LocalPackages/net.peeweek.gameplay-ingredients/Editor/GlobalsDebugWindow.meta b/LocalPackages/net.peeweek.gameplay-ingredients/Editor/GlobalsDebugWindow.meta new file mode 100644 index 0000000..ac85c54 --- /dev/null +++ b/LocalPackages/net.peeweek.gameplay-ingredients/Editor/GlobalsDebugWindow.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: e3cfe5bb18bcf554b83a3f0646547273 +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/LocalPackages/net.peeweek.gameplay-ingredients/Editor/GlobalsDebugWindow/GlobalsDebugWindow.cs b/LocalPackages/net.peeweek.gameplay-ingredients/Editor/GlobalsDebugWindow/GlobalsDebugWindow.cs new file mode 100644 index 0000000..fdd36f9 --- /dev/null +++ b/LocalPackages/net.peeweek.gameplay-ingredients/Editor/GlobalsDebugWindow/GlobalsDebugWindow.cs @@ -0,0 +1,122 @@ +using System.Collections; +using System.Collections.Generic; +using System.Linq; +using UnityEngine; +using UnityEditor; + +namespace GameplayIngredients.Editor +{ + public class GlobalsDebugWindow : EditorWindow + { + [MenuItem("Window/Gameplay Ingredients/Globals Debug")] + static void Open() + { + GetWindow(); + } + + private void OnEnable() + { + titleContent = new GUIContent("Globals Debug"); + minSize = new Vector2(360, 140); + Globals.OnGlobalsUpdated += Globals_OnGlobalsUpdated; + } + + private void Globals_OnGlobalsUpdated (Globals.Type t, string name, object value) + { + Repaint(); + } + + private void OnDisable() + { + Globals.OnGlobalsUpdated -= Globals_OnGlobalsUpdated; + } + + Vector2 scroll; + private void OnGUI() + { + var localBools = Globals.GetBoolNames(Globals.Scope.Local); + var globalBools = Globals.GetBoolNames(Globals.Scope.Global); + var localInts = Globals.GetIntNames(Globals.Scope.Local); + var globalInts = Globals.GetIntNames(Globals.Scope.Global); + var localFloats = Globals.GetFloatNames(Globals.Scope.Local); + var globalFloats = Globals.GetFloatNames(Globals.Scope.Global); + var localStrings = Globals.GetStringNames(Globals.Scope.Local); + var globalStrings = Globals.GetStringNames(Globals.Scope.Global); + var localObjects = Globals.GetObjectNames(Globals.Scope.Local); + var globalObjects = Globals.GetObjectNames(Globals.Scope.Global); + + GUI.backgroundColor = new Color(0.8f, 0.8f, 0.8f, 1); + using(new GUILayout.HorizontalScope(EditorStyles.toolbar)) + { + GUILayout.Label("Name", Styles.header); + GUILayout.Label("Global", Styles.header, GUILayout.Width(64)); + GUILayout.Label("Type", Styles.header, GUILayout.Width(64)); + GUILayout.Label("Value", Styles.header, GUILayout.Width(128)); + } + GUI.backgroundColor = Color.white; + + scroll = EditorGUILayout.BeginScrollView(scroll); + + foreach (var item in globalBools.OrderBy(o => o)) { DrawItem(item, Globals.Scope.Global, Globals.Type.Boolean); } + foreach (var item in localBools.OrderBy(o => o)) { DrawItem(item, Globals.Scope.Local, Globals.Type.Boolean); } + foreach (var item in globalInts.OrderBy(o => o)) { DrawItem(item, Globals.Scope.Global, Globals.Type.Integer); } + foreach (var item in localInts.OrderBy(o => o)) { DrawItem(item, Globals.Scope.Local, Globals.Type.Integer); } + foreach (var item in globalFloats.OrderBy(o => o)) { DrawItem(item, Globals.Scope.Global, Globals.Type.Float); } + foreach (var item in localFloats.OrderBy(o => o)) { DrawItem(item, Globals.Scope.Local, Globals.Type.Float); } + foreach (var item in globalStrings.OrderBy(o => o)) { DrawItem(item, Globals.Scope.Global, Globals.Type.String); } + foreach (var item in localStrings.OrderBy(o => o)) { DrawItem(item, Globals.Scope.Local, Globals.Type.String); } + foreach (var item in globalObjects.OrderBy(o => o)) { DrawItem(item, Globals.Scope.Global, Globals.Type.GameObject); } + foreach (var item in localObjects.OrderBy(o => o)) { DrawItem(item, Globals.Scope.Local, Globals.Type.GameObject); } + + EditorGUILayout.EndScrollView(); + } + + void DrawItem(string name, Globals.Scope scope, Globals.Type type) + { + using(new GUILayout.HorizontalScope()) + { + GUILayout.Label(name, Styles.cell); + GUILayout.Label(scope.ToString(), Styles.cell, GUILayout.Width(64)); + GUILayout.Label(type.ToString(), Styles.cell, GUILayout.Width(64)); + switch (type) + { + case Globals.Type.Boolean: + GUILayout.Toggle(Globals.GetBool(name, scope),"", GUILayout.Width(128)); + break; + case Globals.Type.Integer: + GUILayout.TextField(Globals.GetInt(name, scope).ToString(), GUILayout.Width(128)); + break; + case Globals.Type.String: + GUILayout.TextField(Globals.GetString(name, scope).ToString(), GUILayout.Width(128)); + break; + case Globals.Type.Float: + GUILayout.TextField(Globals.GetFloat(name, scope).ToString(), GUILayout.Width(128)); + break; + case Globals.Type.GameObject: + EditorGUILayout.ObjectField("",Globals.GetObject(name, scope), typeof(GameObject), true, GUILayout.Width(128)); + break; + default: + break; + } + } + } + + static class Styles + { + public static GUIStyle header; + public static GUIStyle cell; + + static Styles() + { + header = new GUIStyle(EditorStyles.toolbarButton); + header.alignment = TextAnchor.MiddleLeft; + header.fontStyle = FontStyle.Bold; + + cell = new GUIStyle(EditorStyles.toolbarButton); + cell.alignment = TextAnchor.MiddleLeft; + cell.fontSize = 10; + + } + } + } +} diff --git a/LocalPackages/net.peeweek.gameplay-ingredients/Editor/GlobalsDebugWindow/GlobalsDebugWindow.cs.meta b/LocalPackages/net.peeweek.gameplay-ingredients/Editor/GlobalsDebugWindow/GlobalsDebugWindow.cs.meta new file mode 100644 index 0000000..7c4703c --- /dev/null +++ b/LocalPackages/net.peeweek.gameplay-ingredients/Editor/GlobalsDebugWindow/GlobalsDebugWindow.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: afc22b24e415f0d4a87bcfd086d002cc +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/LocalPackages/net.peeweek.gameplay-ingredients/Editor/HiearchyItems.cs b/LocalPackages/net.peeweek.gameplay-ingredients/Editor/HiearchyItems.cs new file mode 100644 index 0000000..eb47d95 --- /dev/null +++ b/LocalPackages/net.peeweek.gameplay-ingredients/Editor/HiearchyItems.cs @@ -0,0 +1,85 @@ +using UnityEngine; +using UnityEditor; + +namespace GameplayIngredients +{ + static class HiearchyItems + { + #region TRIGGERS + + [MenuItem("GameObject/Gameplay Ingredients/Events/Trigger (Box)", false, 10)] + static void CreateTriggerBox() + { + var go = new GameObject(); + var col = go.AddComponent(); + col.isTrigger = true; + var evt = go.AddComponent(); + go.name = "Box Trigger"; + + if (Selection.activeGameObject != null) + go.transform.parent = Selection.activeGameObject.transform; + } + + [MenuItem("GameObject/Gameplay Ingredients/Events/Trigger (Sphere)", false, 10)] + static void CreateTriggerSphere() + { + var go = new GameObject(); + var col = go.AddComponent(); + col.isTrigger = true; + var evt = go.AddComponent(); + go.name = "Sphere Trigger"; + + if (Selection.activeGameObject != null) + go.transform.parent = Selection.activeGameObject.transform; + } + + [MenuItem("GameObject/Gameplay Ingredients/Events/Trigger (Capsule)", false, 10)] + static void CreateTriggerCapsule() + { + var go = new GameObject(); + var col = go.AddComponent(); + col.isTrigger = true; + var evt = go.AddComponent(); + go.name = "Capsule Trigger"; + + if (Selection.activeGameObject != null) + go.transform.parent = Selection.activeGameObject.transform; + } + + [MenuItem("GameObject/Gameplay Ingredients/Events/On Awake", false, 10)] + static void CreateOnAwake() + { + var go = new GameObject(); + var evt = go.AddComponent(); + go.name = "On Awake"; + + if (Selection.activeGameObject != null) + go.transform.parent = Selection.activeGameObject.transform; + } + + [MenuItem("GameObject/Gameplay Ingredients/Events/On Enable", false, 10)] + static void CreateOnEnableDisable() + { + var go = new GameObject(); + var evt = go.AddComponent(); + go.name = "On Enable/Disable"; + + if (Selection.activeGameObject != null) + go.transform.parent = Selection.activeGameObject.transform; + } + + [MenuItem("GameObject/Gameplay Ingredients/Events/On Start", false, 10)] + static void CreateOnStart() + { + var go = new GameObject(); + var evt = go.AddComponent(); + go.name = "On Start"; + + if (Selection.activeGameObject != null) + go.transform.parent = Selection.activeGameObject.transform; + } + #endregion + + } +} + diff --git a/LocalPackages/net.peeweek.gameplay-ingredients/Editor/HiearchyItems.cs.meta b/LocalPackages/net.peeweek.gameplay-ingredients/Editor/HiearchyItems.cs.meta new file mode 100644 index 0000000..fd04222 --- /dev/null +++ b/LocalPackages/net.peeweek.gameplay-ingredients/Editor/HiearchyItems.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 28d66973767a30643a54411070050920 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/LocalPackages/net.peeweek.gameplay-ingredients/Editor/HierarchyHints.meta b/LocalPackages/net.peeweek.gameplay-ingredients/Editor/HierarchyHints.meta new file mode 100644 index 0000000..e0a7341 --- /dev/null +++ b/LocalPackages/net.peeweek.gameplay-ingredients/Editor/HierarchyHints.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: d5dcb83e338ada74c9a36ec453e5fa26 +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/LocalPackages/net.peeweek.gameplay-ingredients/Editor/HierarchyHints/HierarchyHints.cs b/LocalPackages/net.peeweek.gameplay-ingredients/Editor/HierarchyHints/HierarchyHints.cs new file mode 100644 index 0000000..8e1412c --- /dev/null +++ b/LocalPackages/net.peeweek.gameplay-ingredients/Editor/HierarchyHints/HierarchyHints.cs @@ -0,0 +1,212 @@ +using System; +using System.Collections.Generic; +using UnityEngine; +using UnityEngine.UI; +#if UNITY_2019_3_OR_NEWER +using UnityEngine.VFX; +#else +using UnityEngine.Experimental.VFX; +#endif +using UnityEditor; +using GameplayIngredients.StateMachines; +using UnityEngine.Playables; + +namespace GameplayIngredients.Editor +{ + [InitializeOnLoad] + public static class HierarchyHints + { + const string kMenuPath = "Edit/Advanced Hierarchy View %."; + public const int kMenuPriority = 230; + + [MenuItem(kMenuPath, priority = kMenuPriority, validate = false)] + static void Toggle() + { + if (Active) + Active = false; + else + Active = true; + } + + [MenuItem(kMenuPath, priority = kMenuPriority, validate = true)] + static bool ToggleCheck() + { + Menu.SetChecked(kMenuPath, Active); + return SceneView.sceneViews.Count > 0; + } + + + static readonly string kPreferenceName = "GameplayIngredients.HierarchyHints"; + + public static bool Active + { + get + { + return EditorPrefs.GetBool(kPreferenceName, false); + } + + set + { + EditorPrefs.SetBool(kPreferenceName, value); + UnityEditorInternal.InternalEditorUtility.RepaintAllViews(); + } + } + + static HierarchyHints() + { + EditorApplication.hierarchyWindowItemOnGUI -= HierarchyOnGUI; + EditorApplication.hierarchyWindowItemOnGUI += HierarchyOnGUI; + } + + static Dictionary s_Definitions = new Dictionary() + { + { typeof(Folder), "Folder Icon"}, + { typeof(MonoBehaviour), "cs Script Icon"}, + { typeof(Camera), "Camera Icon"}, + { typeof(MeshRenderer), "MeshRenderer Icon"}, + { typeof(SkinnedMeshRenderer), "SkinnedMeshRenderer Icon"}, + { typeof(BoxCollider), "BoxCollider Icon"}, + { typeof(SphereCollider), "SphereCollider Icon"}, + { typeof(CapsuleCollider), "CapsuleCollider Icon"}, + { typeof(MeshCollider), "MeshCollider Icon"}, + { typeof(AudioSource), "AudioSource Icon"}, + { typeof(Animation), "Animation Icon"}, + { typeof(Animator), "Animator Icon"}, + { typeof(PlayableDirector), "PlayableDirector Icon"}, + { typeof(Light), "Light Icon"}, + { typeof(LightProbeGroup), "LightProbeGroup Icon"}, + { typeof(LightProbeProxyVolume), "LightProbeProxyVolume Icon"}, + { typeof(ReflectionProbe), "ReflectionProbe Icon"}, + { typeof(VisualEffect), "VisualEffect Icon"}, + { typeof(ParticleSystem), "ParticleSystem Icon"}, + { typeof(Canvas), "Canvas Icon"}, + { typeof(Image), "Image Icon"}, + { typeof(Text), "Text Icon"}, + { typeof(Button), "Button Icon"}, + { typeof(StateMachine), "Packages/net.peeweek.gameplay-ingredients/Icons/Misc/ic-StateMachine.png"}, + { typeof(State), "Packages/net.peeweek.gameplay-ingredients/Icons/Misc/ic-State.png"}, + }; + + static void HierarchyOnGUI(int instanceID, Rect selectionRect) + { + if (!Active) return; + + var fullRect = selectionRect; +#if UNITY_2019_3_OR_NEWER + fullRect.xMin = 32; +#else + fullRect.xMin = 16; +#endif + fullRect.xMax = EditorGUIUtility.currentViewWidth; + GameObject o = EditorUtility.InstanceIDToObject(instanceID) as GameObject; + if (o == null) return; + + var c = GUI.color; + + bool isFolder = o.GetComponent() != null; + + if(isFolder) + { + fullRect.xMin += 28 + 14 * GetObjectDepth(o.transform); + fullRect.width = 16; + EditorGUI.DrawRect(fullRect, EditorGUIUtility.isProSkin? Styles.proBackground : Styles.personalBackground); + DrawIcon(fullRect, Contents.GetContent(typeof(Folder)), o.GetComponent().Color); + } + else + { + if (o.isStatic) + { + GUI.Label(fullRect, " S"); + EditorGUI.DrawRect(fullRect, Colors.dimGray); + } + + foreach (var type in s_Definitions.Keys) + { + if (o.GetComponents(type).Length > 0) selectionRect = DrawIcon(selectionRect, Contents.GetContent(type), Color.white); + } + } + GUI.color = c; + } + + static int GetObjectDepth(Transform t, int depth=0) + { + if (t.parent == null) + return depth; + else + return GetObjectDepth(t.parent, depth + 1); + } + + + static Rect DrawIcon(Rect rect, GUIContent content, Color color, int size = 16) + { + GUI.color = color; + GUI.Label(rect, content, Styles.icon); + rect.width = rect.width - size; + return rect; + } + + static class Contents + { + static Dictionary s_Icons = new Dictionary(); + + public static void AddIcon(Type type, string IconName) + { + GUIContent icon; + + Texture texture = AssetDatabase.LoadAssetAtPath(IconName); + + if (texture == null) + icon = EditorGUIUtility.IconContent(IconName); + else + icon = new GUIContent(texture); + + s_Icons.Add(type, icon); + } + + public static GUIContent GetContent(Type t) + { + if (!s_Icons.ContainsKey(t) && s_Definitions.ContainsKey(t)) + AddIcon(t,s_Definitions[t]); + + return s_Icons[t]; + } + } + + static class Colors + { + public static Color orange = new Color(1.0f, 0.7f, 0.1f); + public static Color red = new Color(1.0f, 0.4f, 0.3f); + public static Color yellow = new Color(0.8f, 1.0f, 0.1f); + public static Color green = new Color(0.2f, 1.0f, 0.1f); + public static Color blue = new Color(0.5f, 0.8f, 1.0f); + public static Color violet = new Color(0.8f, 0.5f, 1.0f); + public static Color purple = new Color(1.0f, 0.5f, 0.8f); + public static Color dimGray = new Color(0.4f, 0.4f, 0.4f, 0.2f); + } + + static class Styles + { + public static GUIStyle rightLabel; + public static GUIStyle icon; + + public static Color proBackground = new Color(0.25f, 0.25f, 0.25f, 1.0f); + public static Color personalBackground = new Color(0.75f, 0.75f, 0.75f, 1.0f); + + static Styles() + { + rightLabel = new GUIStyle(EditorStyles.label); + rightLabel.alignment = TextAnchor.MiddleRight; + rightLabel.normal.textColor = Color.white; + rightLabel.onNormal.textColor = Color.white; + + rightLabel.active.textColor = Color.white; + rightLabel.onActive.textColor = Color.white; + + icon = new GUIStyle(rightLabel); + icon.padding = new RectOffset(); + icon.margin = new RectOffset(); + } + } + + } +} diff --git a/LocalPackages/net.peeweek.gameplay-ingredients/Editor/HierarchyHints/HierarchyHints.cs.meta b/LocalPackages/net.peeweek.gameplay-ingredients/Editor/HierarchyHints/HierarchyHints.cs.meta new file mode 100644 index 0000000..2fac98a --- /dev/null +++ b/LocalPackages/net.peeweek.gameplay-ingredients/Editor/HierarchyHints/HierarchyHints.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: a6ca563f0dba0814c804f2cdbef717d9 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/LocalPackages/net.peeweek.gameplay-ingredients/Editor/MenuItems.cs b/LocalPackages/net.peeweek.gameplay-ingredients/Editor/MenuItems.cs new file mode 100644 index 0000000..783c99d --- /dev/null +++ b/LocalPackages/net.peeweek.gameplay-ingredients/Editor/MenuItems.cs @@ -0,0 +1,146 @@ +using System.Collections.Generic; +using UnityEngine; +using UnityEditor; +using System; +using System.Reflection; +using UnityEngine.SceneManagement; + +namespace GameplayIngredients.Editor +{ + public static class MenuItems + { + public const int kWindowMenuPriority = 100; + public const int kPlayMenuPriority = 160; + public const int kMenuPriority = 330; + + #region PLAY HERE + + [MenuItem("Edit/Play from SceneView Position #%&P", priority = kPlayMenuPriority)] + static void PlayHere() + { + EditorApplication.isPlaying = true; + } + + [MenuItem("Edit/Play from SceneView Position #%&P", priority = kPlayMenuPriority, validate = true)] + static bool PlayHereValidate() + { + return PlayFromHere.IsReady; + } + + #endregion + + #region GROUP_UNGROUP + + const int kGroupMenuIndex = 500; + const string kGroupMenuString = "Edit/Group Selected %G"; + const string kUnGroupMenuString = "Edit/Un-Group Selected %#G"; + + [MenuItem(kGroupMenuString, priority = kGroupMenuIndex, validate = false)] + static void Group() + { + if (Selection.gameObjects.Length <= 1) + return; + + var selected = Selection.gameObjects; + Transform parent = selected[0].transform.parent; + Scene scene = selected[0].scene; + + bool sparseParents = false; + + foreach (var obj in selected) + { + if (obj.transform.parent != parent || obj.scene != scene) + { + sparseParents = true; + break; + } + } + + if (sparseParents) + { + parent = null; + scene = SceneManager.GetActiveScene(); + } + + Vector3 posSum = Vector3.zero; + + foreach (var go in selected) + { + posSum += go.transform.position; + } + + GameObject groupObj = new GameObject("Group"); + groupObj.transform.position = posSum / selected.Length; + groupObj.transform.parent = parent; + groupObj.isStatic = true; + + foreach (var go in selected) + go.transform.parent = groupObj.transform; + + // Expand by pinging the first object + EditorGUIUtility.PingObject(selected[0]); + + } + + [MenuItem(kGroupMenuString, priority = kGroupMenuIndex, validate = true)] + static bool GroupCheck() + { + return (Selection.gameObjects.Length > 1); + } + + + [MenuItem(kUnGroupMenuString, priority = kGroupMenuIndex+1, validate = false)] + static void UnGroup() + { + if (Selection.gameObjects.Length == 0) + return; + + var selected = Selection.gameObjects; + List oldParents = new List(); + foreach(var go in selected) + { + if(go.transform.parent != null) + { + if(!oldParents.Contains(go.transform.parent)) + oldParents.Add(go.transform.parent); + + go.transform.parent = go.transform.parent.parent; + } + } + + List toDelete = new List(); + + // Cleanup old parents + foreach(var parent in oldParents) + { + var go = parent.gameObject; + if(parent.childCount == 0 && parent.GetComponents().Length == 1) // if no more children and only transform/rectTransform + { + toDelete.Add(go); + } + } + + foreach (var trash in toDelete) + GameObject.DestroyImmediate(trash); + + } + + [MenuItem(kUnGroupMenuString, priority = kGroupMenuIndex+1, validate = true)] + static bool UnGroupCheck() + { + return (Selection.gameObjects.Length > 0); + } + + #endregion + + #region ASSETS + + [UnityEditor.MenuItem("Assets/Create/Game Level")] + static void CreateGameLevel() + { + GameplayIngredients.Editor.AssetFactory.CreateAssetInProjectWindow("", "New Game Level.asset"); + } + + #endregion + } +} diff --git a/LocalPackages/net.peeweek.gameplay-ingredients/Editor/MenuItems.cs.meta b/LocalPackages/net.peeweek.gameplay-ingredients/Editor/MenuItems.cs.meta new file mode 100644 index 0000000..ce7dff1 --- /dev/null +++ b/LocalPackages/net.peeweek.gameplay-ingredients/Editor/MenuItems.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 9b95ff60e46051544a400d4a0afa962b +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/LocalPackages/net.peeweek.gameplay-ingredients/Editor/NewSceneWindow.meta b/LocalPackages/net.peeweek.gameplay-ingredients/Editor/NewSceneWindow.meta new file mode 100644 index 0000000..22caa29 --- /dev/null +++ b/LocalPackages/net.peeweek.gameplay-ingredients/Editor/NewSceneWindow.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: abc8c99e8458f7f468eee26216bd1879 +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/LocalPackages/net.peeweek.gameplay-ingredients/Editor/NewSceneWindow/NewSceneWindow.cs b/LocalPackages/net.peeweek.gameplay-ingredients/Editor/NewSceneWindow/NewSceneWindow.cs new file mode 100644 index 0000000..47d6f39 --- /dev/null +++ b/LocalPackages/net.peeweek.gameplay-ingredients/Editor/NewSceneWindow/NewSceneWindow.cs @@ -0,0 +1,238 @@ +using System.Collections; +using System.Collections.Generic; +using UnityEngine; +using UnityEditor; +using UnityEngine.SceneManagement; +using UnityEditor.SceneManagement; + +namespace GameplayIngredients.Editor +{ + public class NewSceneWindow : EditorWindow + { + const int WindowWidth = 640; + const int WindowHeight = 380; + + [MenuItem("File/New Scene From Template... &%N", priority = 150)] + static void ShowNewSceneWindow() + { + GetWindow(true); + } + + private void OnEnable() + { + titleContent = new GUIContent("New Scene From Template"); + this.position = new Rect((Screen.width / 2.0f) - WindowWidth / 2, (Screen.height / 2.0f) - WindowHeight / 2, WindowWidth, WindowHeight); + this.minSize = new Vector2(WindowWidth, WindowHeight); + this.maxSize = new Vector2(WindowWidth, WindowHeight); + ReloadList(); + } + + private void OnGUI() + { + using (new GUILayout.HorizontalScope()) + { + GUILayout.Space(8); + GUILayout.Label("Available Templates", EditorStyles.boldLabel, GUILayout.Width(188)); + GUILayout.Label("Description", EditorStyles.boldLabel); + } + + using (new GUILayout.HorizontalScope(GUILayout.ExpandHeight(true))) + { + GUILayout.Space(8); + using (new GUILayout.VerticalScope(Styles.listBox, GUILayout.Width(180))) + { + DrawTemplateList(); + } + GUILayout.Space(4); + templateDetailsScroll = EditorGUILayout.BeginScrollView(templateDetailsScroll); + using (new GUILayout.VerticalScope(Styles.detailBox)) + { + DrawTemplateDetails(); + } + EditorGUILayout.EndScrollView(); + GUILayout.Space(4); + } + using (new GUILayout.HorizontalScope()) + { + GUILayout.FlexibleSpace(); + EditorGUI.BeginDisabledGroup(selectedTemplate.Scene == null); + + + if (GUILayout.Button(" Create ", Styles.buttonLeft)) + { + // Creates a new map and replaces the current setup + CreateSceneFromTemplate(selectedTemplate.Scene); + this.Close(); + } + + if (GUILayout.Button(" Append ", Styles.buttonRight)) + { + bool canCreateScene = false; + + if (EditorSceneManager.GetActiveScene().path == string.Empty) + { + // We need to save active scene First + if(EditorUtility.DisplayDialog("Create new Scene", "You can only append a new scene if the current active scene has been saved, do you want to save it first?","Yes","No")) + { + string path = EditorUtility.SaveFilePanelInProject("Save Scene", "New Scene", "unity", "New Scene"); + if(path != string.Empty) + { + if(EditorSceneManager.SaveScene(EditorSceneManager.GetActiveScene(), path)) + canCreateScene = true; + } + } + } + + if(canCreateScene) + { + // Creates a new map that is added to the current setup + CreateSceneFromTemplate(selectedTemplate.Scene,true); + this.Close(); + } + } + + EditorGUI.EndDisabledGroup(); + GUILayout.Space(4); + } + GUILayout.Space(8); + } + + static void CreateSceneFromTemplate(SceneAsset template, bool append = false) + { + var newScene = EditorSceneManager.NewScene(NewSceneSetup.EmptyScene, append? NewSceneMode.Additive: NewSceneMode.Single); + var temp = EditorSceneManager.OpenScene(AssetDatabase.GetAssetPath(template), OpenSceneMode.Additive); + var objects = temp.GetRootGameObjects(); + foreach(var obj in objects) + { + SceneManager.MoveGameObjectToScene(obj, newScene); + } + EditorSceneManager.CloseScene(temp, true); + + } + + public static void ReloadList() + { + if (templateLists == null) + templateLists = new List(); + else + templateLists.Clear(); + + string[] all = AssetDatabase.FindAssets("t:" + typeof(SceneTemplateList).Name); + foreach(var guid in all) + { + templateLists.Add(AssetDatabase.LoadAssetAtPath(AssetDatabase.GUIDToAssetPath(guid))); + } + } + + static List templateLists; + static SceneWindowTemplate selectedTemplate; + + Vector2 scrollList = Vector2.zero; + + void DrawTemplateList() + { + GUILayout.BeginScrollView(scrollList); + int i = 0; + foreach(var list in templateLists) + { + if(i > 0) + { + GUILayout.Space(8); + } + + GUILayout.Label(list.ListName, Styles.listHeader); + EditorGUI.indentLevel++; + foreach (var template in list.Templates) + { + if(GUILayout.Button(template.Name, Styles.listItem)) + { + selectedTemplate = template; + } + if(template.Name == selectedTemplate.Name && template.Scene == selectedTemplate.Scene) + { + Rect hl = GUILayoutUtility.GetLastRect(); + EditorGUI.DrawRect(hl, new Color(1, 1, 1, 0.05f)); + } + } + EditorGUI.indentLevel--; + i++; + } + GUILayout.FlexibleSpace(); + GUILayout.EndScrollView(); + } + + Vector2 templateDetailsScroll; + + void DrawTemplateDetails() + { + if(selectedTemplate.Scene != null) + { + GUILayout.Label(selectedTemplate.Name, Styles.detailsTitle); + GUILayout.Space(16); + GUILayout.Label(selectedTemplate.Description, Styles.detailsBody); + } + else + { + GUILayout.Label("No Template Selected"); + } + + GUILayout.FlexibleSpace(); + + if(selectedTemplate.ScreenShot != null) + { + GUILayout.Box(GUIContent.none, GUILayout.ExpandWidth(true), GUILayout.Height(180)); + Rect r = GUILayoutUtility.GetLastRect(); + RectOffset off = new RectOffset(6, 6, 6, 6); + r = off.Remove(r); + EditorGUI.DrawPreviewTexture(r, selectedTemplate.ScreenShot, null, ScaleMode.ScaleAndCrop); + } + } + + static class Styles + { + public static GUIStyle buttonLeft; + public static GUIStyle buttonMid; + public static GUIStyle buttonRight; + + public static GUIStyle listBox; + public static GUIStyle listHeader; + public static GUIStyle listItem; + public static GUIStyle detailBox; + + public static GUIStyle detailsTitle; + public static GUIStyle detailsBody; + + static Styles() + { + buttonLeft = new GUIStyle(EditorStyles.miniButtonLeft); + buttonMid = new GUIStyle(EditorStyles.miniButtonMid); + buttonRight = new GUIStyle(EditorStyles.miniButtonRight); + buttonLeft.fontSize = 12; + buttonMid.fontSize = 12; + buttonRight.fontSize = 12; + + listHeader = new GUIStyle("ShurikenModuleTitle"); + listHeader.padding= new RectOffset(0,0,2,2); + listHeader.fontSize = 12; + listHeader.stretchWidth = false; + listHeader.fixedWidth = 172; + listHeader.stretchHeight = true; + listHeader.fixedHeight = 24; + + listBox = new GUIStyle(EditorStyles.helpBox); + detailBox = new GUIStyle(listBox); + detailBox.padding = new RectOffset(12, 12, 12, 12); + + listItem = new GUIStyle(EditorStyles.label); + listItem.padding = new RectOffset(16, 0, 1, 1); + + detailsTitle = new GUIStyle(EditorStyles.label); + detailsTitle.fontSize = 24; + + detailsBody = new GUIStyle(EditorStyles.wordWrappedLabel); + detailsBody.fontSize = 14; + + } + } + } +} diff --git a/LocalPackages/net.peeweek.gameplay-ingredients/Editor/NewSceneWindow/NewSceneWindow.cs.meta b/LocalPackages/net.peeweek.gameplay-ingredients/Editor/NewSceneWindow/NewSceneWindow.cs.meta new file mode 100644 index 0000000..1c80fd8 --- /dev/null +++ b/LocalPackages/net.peeweek.gameplay-ingredients/Editor/NewSceneWindow/NewSceneWindow.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 6af9ca5ec6a20d3488386a4eb9919ed9 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/LocalPackages/net.peeweek.gameplay-ingredients/Editor/NewSceneWindow/SceneTemplateList.cs b/LocalPackages/net.peeweek.gameplay-ingredients/Editor/NewSceneWindow/SceneTemplateList.cs new file mode 100644 index 0000000..a8fe777 --- /dev/null +++ b/LocalPackages/net.peeweek.gameplay-ingredients/Editor/NewSceneWindow/SceneTemplateList.cs @@ -0,0 +1,30 @@ +using System.Collections; +using System.Collections.Generic; +using UnityEngine; +using UnityEditor; + +namespace GameplayIngredients.Editor +{ + public class SceneTemplateList : ScriptableObject + { + [MenuItem("Assets/Create/Scene Template List", priority = 201)] + static void CreateSceneTemplateListAsset() + { + AssetFactory.CreateAssetInProjectWindow("", "New SceneTemplateList.asset"); + } + + public string ListName = "New Template List"; + public SceneWindowTemplate[] Templates; + } + + [System.Serializable] + public struct SceneWindowTemplate + { + public string Name; + [Multiline] + public string Description; + [NonNullCheck] + public SceneAsset Scene; + public Texture2D ScreenShot; + } +} diff --git a/LocalPackages/net.peeweek.gameplay-ingredients/Editor/NewSceneWindow/SceneTemplateList.cs.meta b/LocalPackages/net.peeweek.gameplay-ingredients/Editor/NewSceneWindow/SceneTemplateList.cs.meta new file mode 100644 index 0000000..fe71a7b --- /dev/null +++ b/LocalPackages/net.peeweek.gameplay-ingredients/Editor/NewSceneWindow/SceneTemplateList.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 261311c8711012d489943f40ba26402d +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/LocalPackages/net.peeweek.gameplay-ingredients/Editor/Pickup.meta b/LocalPackages/net.peeweek.gameplay-ingredients/Editor/Pickup.meta new file mode 100644 index 0000000..a9af200 --- /dev/null +++ b/LocalPackages/net.peeweek.gameplay-ingredients/Editor/Pickup.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 0bde61e4f2da9974483510627b7babec +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/LocalPackages/net.peeweek.gameplay-ingredients/Editor/Pickup/PickupItemEditor.cs b/LocalPackages/net.peeweek.gameplay-ingredients/Editor/Pickup/PickupItemEditor.cs new file mode 100644 index 0000000..8be843e --- /dev/null +++ b/LocalPackages/net.peeweek.gameplay-ingredients/Editor/Pickup/PickupItemEditor.cs @@ -0,0 +1,40 @@ +using System.Collections; +using System.Collections.Generic; +using UnityEngine; +using UnityEditor; +using UnityEditorInternal; +using GameplayIngredients.Pickup; + +namespace GameplayIngredients.Editor +{ + [CustomEditor(typeof(PickupItem))] + public class PickupItemEditor : UnityEditor.Editor + { + ReorderableList m_RList; + SerializedProperty m_OnPickup; + + private void OnEnable() + { + m_RList = new ReorderableList(((PickupItem)serializedObject.targetObject).effects, typeof(PickupEffectBase), false, true, false, false); + m_RList.drawElementCallback = DrawElement; + m_OnPickup = serializedObject.FindProperty("OnPickup"); + } + + void DrawElement(Rect rect, int index, bool isActive, bool isFocused) + { + GUI.Label(rect,string.Format("#{0} - {1}", index+1, ObjectNames.NicifyVariableName(((PickupItem)serializedObject.targetObject).effects[index].GetType().Name))); + } + + public override void OnInspectorGUI() + { + GUILayout.Space(8); + m_RList.DoLayoutList(); + + serializedObject.Update(); + EditorGUILayout.PropertyField(m_OnPickup,true); + serializedObject.ApplyModifiedProperties(); + } + + } +} + diff --git a/LocalPackages/net.peeweek.gameplay-ingredients/Editor/Pickup/PickupItemEditor.cs.meta b/LocalPackages/net.peeweek.gameplay-ingredients/Editor/Pickup/PickupItemEditor.cs.meta new file mode 100644 index 0000000..5054471 --- /dev/null +++ b/LocalPackages/net.peeweek.gameplay-ingredients/Editor/Pickup/PickupItemEditor.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: b2d5d799cf5e557479da3a5dc71cd59f +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/LocalPackages/net.peeweek.gameplay-ingredients/Editor/PlayFromHere.cs b/LocalPackages/net.peeweek.gameplay-ingredients/Editor/PlayFromHere.cs new file mode 100644 index 0000000..09f579d --- /dev/null +++ b/LocalPackages/net.peeweek.gameplay-ingredients/Editor/PlayFromHere.cs @@ -0,0 +1,91 @@ +using System.Collections; +using System.Collections.Generic; +using UnityEngine; +using UnityEditor; + +namespace GameplayIngredients.Editor +{ + public static class PlayFromHere + { + public delegate void PlayFromHereDelegate(Vector3 position, Vector3 forward); + + public static event PlayFromHereDelegate OnPlayFromHere; + + [InitializeOnLoadMethod] + static void Initialize() + { + EditorApplication.playModeStateChanged -= OnEnterPlayMode; + EditorApplication.playModeStateChanged += OnEnterPlayMode; + } + + public static bool IsReady + { + get + { + return OnPlayFromHere != null && OnPlayFromHere.GetInvocationList().Length > 0; + } + } + + public static void Play(SceneView sceneView) + { + var forward = sceneView.camera.transform.forward; + var position = sceneView.camera.transform.position; + + EditorPrefs.SetInt("PlayFromHere", 1); + EditorPrefs.SetFloat("PlayFromHere.position.x", position.x); + EditorPrefs.SetFloat("PlayFromHere.position.y", position.y); + EditorPrefs.SetFloat("PlayFromHere.position.z", position.z); + EditorPrefs.SetFloat("PlayFromHere.forward.x", forward.x); + EditorPrefs.SetFloat("PlayFromHere.forward.y", forward.y); + EditorPrefs.SetFloat("PlayFromHere.forward.z", forward.z); + + EditorUtility.DisplayProgressBar("Play From Here", "Entering Play From here mode...", 1.0f); + + EditorApplication.isPlaying = true; + } + + static void OnEnterPlayMode(PlayModeStateChange state) + { + if(state == PlayModeStateChange.ExitingPlayMode) + { + PlayerPrefs.SetInt("PlayFromHere", 0); + } + if(state == PlayModeStateChange.ExitingEditMode) + { + if(EditorPrefs.GetInt("PlayFromHere") == 1) + { + PlayerPrefs.SetInt("PlayFromHere", 1); + } + else + { + PlayerPrefs.SetInt("PlayFromHere", 0); + } + } + + if (state == PlayModeStateChange.EnteredPlayMode && (PlayerPrefs.GetInt("PlayFromHere") == 1)) + { + EditorUtility.ClearProgressBar(); + + if (OnPlayFromHere != null) + { + Vector3 position = new Vector3( + EditorPrefs.GetFloat("PlayFromHere.position.x"), + EditorPrefs.GetFloat("PlayFromHere.position.y"), + EditorPrefs.GetFloat("PlayFromHere.position.z")); + Vector3 forward = new Vector3( + EditorPrefs.GetFloat("PlayFromHere.forward.x"), + EditorPrefs.GetFloat("PlayFromHere.forward.y"), + EditorPrefs.GetFloat("PlayFromHere.forward.z")); + OnPlayFromHere.Invoke(position, forward); + } + else + { + Debug.LogWarning("Play From Here : No Actions to take. Please add events to PlayFromHere.OnPlayFromHere()"); + } + + EditorPrefs.SetInt("PlayFromHere", 0); + } + + } + } +} diff --git a/LocalPackages/net.peeweek.gameplay-ingredients/Editor/PlayFromHere.cs.meta b/LocalPackages/net.peeweek.gameplay-ingredients/Editor/PlayFromHere.cs.meta new file mode 100644 index 0000000..6b85a1c --- /dev/null +++ b/LocalPackages/net.peeweek.gameplay-ingredients/Editor/PlayFromHere.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 0a474d3e13883394eae0cc77c0c8634e +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/LocalPackages/net.peeweek.gameplay-ingredients/Editor/PropertyDrawers.meta b/LocalPackages/net.peeweek.gameplay-ingredients/Editor/PropertyDrawers.meta new file mode 100644 index 0000000..91fd9c1 --- /dev/null +++ b/LocalPackages/net.peeweek.gameplay-ingredients/Editor/PropertyDrawers.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: bdcec947a544c434fa0c9e9fc6d20f2b +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/LocalPackages/net.peeweek.gameplay-ingredients/Editor/PropertyDrawers/BehaviourTogglePropertyDrawer.cs b/LocalPackages/net.peeweek.gameplay-ingredients/Editor/PropertyDrawers/BehaviourTogglePropertyDrawer.cs new file mode 100644 index 0000000..71f0cd8 --- /dev/null +++ b/LocalPackages/net.peeweek.gameplay-ingredients/Editor/PropertyDrawers/BehaviourTogglePropertyDrawer.cs @@ -0,0 +1,29 @@ +using UnityEngine; +using UnityEditor; + +namespace GameplayIngredients.Editor +{ + [CustomPropertyDrawer(typeof(Actions.ToggleBehaviourAction.BehaviourToggle))] + public class BehaviourTogglePropertyDrawer : PropertyDrawer + { + public override void OnGUI(Rect position, SerializedProperty property, GUIContent label) + { + var toggle = property.FindPropertyRelative("State"); + var bhv = property.FindPropertyRelative("Behaviour"); + + var toggleRect = new Rect(position); + toggleRect.xMin = toggleRect.xMax - 80; + + var objRect = new Rect(position); + objRect.xMax -= 80; + + toggle.intValue = EditorGUI.IntPopup(toggleRect, toggle.intValue, labels, values); + bhv.objectReferenceValue = EditorGUI.ObjectField(objRect, bhv.objectReferenceValue, typeof(Behaviour), true); + } + + static GUIContent[] labels = { new GUIContent("Disable"), new GUIContent("Enable"), new GUIContent("Toggle") }; + static int[] values = { 0, 1, 2 }; + } +} + + diff --git a/LocalPackages/net.peeweek.gameplay-ingredients/Editor/PropertyDrawers/BehaviourTogglePropertyDrawer.cs.meta b/LocalPackages/net.peeweek.gameplay-ingredients/Editor/PropertyDrawers/BehaviourTogglePropertyDrawer.cs.meta new file mode 100644 index 0000000..77ff036 --- /dev/null +++ b/LocalPackages/net.peeweek.gameplay-ingredients/Editor/PropertyDrawers/BehaviourTogglePropertyDrawer.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: f9cc2708038acf742980191ecb1fa105 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/LocalPackages/net.peeweek.gameplay-ingredients/Editor/PropertyDrawers/CallablePropertyDrawer.cs b/LocalPackages/net.peeweek.gameplay-ingredients/Editor/PropertyDrawers/CallablePropertyDrawer.cs new file mode 100644 index 0000000..baabff1 --- /dev/null +++ b/LocalPackages/net.peeweek.gameplay-ingredients/Editor/PropertyDrawers/CallablePropertyDrawer.cs @@ -0,0 +1,93 @@ +using UnityEngine; +using UnityEditor; + +namespace GameplayIngredients.Editor +{ + + [CustomPropertyDrawer(typeof(Callable))] + public class CallablePropertyDrawer : PropertyDrawer + { + private Callable setNextObjectValue = null; + + public override void OnGUI(Rect position, SerializedProperty property, GUIContent label) + { + if(setNextObjectValue != null) + { + property.objectReferenceValue = setNextObjectValue; + setNextObjectValue = null; + if(CallTreeWindow.visible) + { + CallTreeWindow.Refresh(); + } + } + + if(property.objectReferenceValue == null) + { + GUI.backgroundColor = Color.red; + EditorGUI.DrawRect(position, new Color(1.0f,0,0,0.25f)); + } + + var pickRect = new Rect(position); + pickRect.xMin = pickRect.xMax - 184; + pickRect.xMax -= 30; + + var gotoRect = new Rect(position); + gotoRect.xMin = gotoRect.xMax - 24; + + var objRect = new Rect(position); + objRect.xMax -= 188; + + + + var obj = EditorGUI.ObjectField(objRect, property.objectReferenceValue, typeof(Callable), true); + + if (GUI.changed) + property.objectReferenceValue = obj; + + + if(property.objectReferenceValue != null) + { + if (GUI.Button(gotoRect, ">")) + { + Selection.activeObject = property.objectReferenceValue; + } + + if (GUI.Button(pickRect, (property.objectReferenceValue as Callable).Name, EditorStyles.popup)) + { + ShowMenu(property); + } + } + else + { + EditorGUI.BeginDisabledGroup(true); + GUI.Label(pickRect, "No Callable Selected", EditorStyles.popup); + EditorGUI.EndDisabledGroup(); + } + + GUI.backgroundColor = Color.white; + + } + + void ShowMenu(SerializedProperty property) + { + GenericMenu menu = new GenericMenu(); + var components = (property.objectReferenceValue as Callable).gameObject.GetComponents(); + foreach(var component in components) + { + menu.AddItem(new GUIContent(component.GetType().Name + " - " + component.Name), component == property.objectReferenceValue, SetMenu, component); + } + + menu.ShowAsContext(); + } + + void SetMenu(object o) + { + Callable component = o as Callable; + setNextObjectValue = component; + + } + + } +} + + diff --git a/LocalPackages/net.peeweek.gameplay-ingredients/Editor/PropertyDrawers/CallablePropertyDrawer.cs.meta b/LocalPackages/net.peeweek.gameplay-ingredients/Editor/PropertyDrawers/CallablePropertyDrawer.cs.meta new file mode 100644 index 0000000..f1d0b79 --- /dev/null +++ b/LocalPackages/net.peeweek.gameplay-ingredients/Editor/PropertyDrawers/CallablePropertyDrawer.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 818c20fe94e0b0b4983ef38d6bc0eea4 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/LocalPackages/net.peeweek.gameplay-ingredients/Editor/PropertyDrawers/GameObjectTogglePropertyDrawer.cs b/LocalPackages/net.peeweek.gameplay-ingredients/Editor/PropertyDrawers/GameObjectTogglePropertyDrawer.cs new file mode 100644 index 0000000..8ad0beb --- /dev/null +++ b/LocalPackages/net.peeweek.gameplay-ingredients/Editor/PropertyDrawers/GameObjectTogglePropertyDrawer.cs @@ -0,0 +1,29 @@ +using UnityEngine; +using UnityEditor; + +namespace GameplayIngredients.Editor +{ + [CustomPropertyDrawer(typeof(Actions.ToggleGameObjectAction.GameObjectToggle))] + public class GameObjectTogglePropertyDrawer : PropertyDrawer + { + public override void OnGUI(Rect position, SerializedProperty property, GUIContent label) + { + var toggle = property.FindPropertyRelative("State"); + var obj = property.FindPropertyRelative("GameObject"); + + var toggleRect = new Rect(position); + toggleRect.xMin = toggleRect.xMax - 80; + + var objRect = new Rect(position); + objRect.xMax -= 80; + + toggle.intValue = EditorGUI.IntPopup(toggleRect, toggle.intValue, labels, values); + obj.objectReferenceValue = EditorGUI.ObjectField(objRect, obj.objectReferenceValue, typeof(GameObject), true); + } + + static GUIContent[] labels = { new GUIContent("Disable"), new GUIContent("Enable"), new GUIContent("Toggle") }; + static int[] values = { 0, 1, 2 }; + } +} + + diff --git a/LocalPackages/net.peeweek.gameplay-ingredients/Editor/PropertyDrawers/GameObjectTogglePropertyDrawer.cs.meta b/LocalPackages/net.peeweek.gameplay-ingredients/Editor/PropertyDrawers/GameObjectTogglePropertyDrawer.cs.meta new file mode 100644 index 0000000..96046dd --- /dev/null +++ b/LocalPackages/net.peeweek.gameplay-ingredients/Editor/PropertyDrawers/GameObjectTogglePropertyDrawer.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 2f3b8643af61a6d45ba4b8fdd82dfc50 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/LocalPackages/net.peeweek.gameplay-ingredients/Editor/PropertyDrawers/NonNullCheckPropertyDrawer.cs b/LocalPackages/net.peeweek.gameplay-ingredients/Editor/PropertyDrawers/NonNullCheckPropertyDrawer.cs new file mode 100644 index 0000000..36002c5 --- /dev/null +++ b/LocalPackages/net.peeweek.gameplay-ingredients/Editor/PropertyDrawers/NonNullCheckPropertyDrawer.cs @@ -0,0 +1,38 @@ +using UnityEngine.SceneManagement; +using UnityEngine; +using UnityEditor; + +namespace GameplayIngredients.Editor +{ + [CustomPropertyDrawer(typeof(NonNullCheckAttribute))] + public class NonNullCheckPropertyDrawer : PropertyDrawer + { + public override void OnGUI(Rect position, SerializedProperty property, GUIContent label) + { + if(property.propertyType == SerializedPropertyType.ObjectReference) + { + bool valid = property.objectReferenceValue != null; + var color = GUI.backgroundColor; + GUI.backgroundColor = valid ? color : Color.red; + EditorGUI.ObjectField(position, property); + GUI.backgroundColor = color; + } + else + { + EditorGUI.LabelField(position, "Use [NonNullCheck] attribute only on Object fields"); + } + } + + static class Styles + { + public static GUIStyle errorfield; + + static Styles() + { + errorfield = new GUIStyle(EditorStyles.objectField); + } + } + } +} + + diff --git a/LocalPackages/net.peeweek.gameplay-ingredients/Editor/PropertyDrawers/NonNullCheckPropertyDrawer.cs.meta b/LocalPackages/net.peeweek.gameplay-ingredients/Editor/PropertyDrawers/NonNullCheckPropertyDrawer.cs.meta new file mode 100644 index 0000000..64f3424 --- /dev/null +++ b/LocalPackages/net.peeweek.gameplay-ingredients/Editor/PropertyDrawers/NonNullCheckPropertyDrawer.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: b3811924d58479541aaa75e0d3882b74 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/LocalPackages/net.peeweek.gameplay-ingredients/Editor/PropertyDrawers/ScenePropertyDrawer.cs b/LocalPackages/net.peeweek.gameplay-ingredients/Editor/PropertyDrawers/ScenePropertyDrawer.cs new file mode 100644 index 0000000..1e17d6f --- /dev/null +++ b/LocalPackages/net.peeweek.gameplay-ingredients/Editor/PropertyDrawers/ScenePropertyDrawer.cs @@ -0,0 +1,40 @@ +using UnityEngine.SceneManagement; +using UnityEngine; +using UnityEditor; +using UnityEditor.SceneManagement; +using System.Linq; + +namespace GameplayIngredients.Editor +{ + [CustomPropertyDrawer(typeof(SceneAttribute))] + public class ScenePropertyDrawer : PropertyDrawer + { + public override void OnGUI(Rect position, SerializedProperty property, GUIContent label) + { + int count = EditorSceneManager.sceneCountInBuildSettings; + string[] sceneNames = new string[count]; + GUIContent[] displayedOptions = new GUIContent[count]; + int[] values = new int[count]; + string currentValue = property.stringValue; + int selectedIndex = -1; + + for (int i = 0; i < sceneNames.Length; i++) + { + sceneNames[i] = SceneUtility.GetScenePathByBuildIndex(i).Split(new char[] { '\\', '/' }).Last().Replace(".unity", ""); + displayedOptions[i] = new GUIContent(sceneNames[i]); + values[i] = i; + + if (currentValue == sceneNames[i]) + selectedIndex = i; + } + + int newVal = EditorGUI.IntPopup(position, new GUIContent(property.displayName), selectedIndex, displayedOptions, values); + if (GUI.changed) + { + property.stringValue = sceneNames[newVal]; + } + } + } +} + + diff --git a/LocalPackages/net.peeweek.gameplay-ingredients/Editor/PropertyDrawers/ScenePropertyDrawer.cs.meta b/LocalPackages/net.peeweek.gameplay-ingredients/Editor/PropertyDrawers/ScenePropertyDrawer.cs.meta new file mode 100644 index 0000000..35d9774 --- /dev/null +++ b/LocalPackages/net.peeweek.gameplay-ingredients/Editor/PropertyDrawers/ScenePropertyDrawer.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 5923fcc50a6c23044be2c181ca42162b +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/LocalPackages/net.peeweek.gameplay-ingredients/Editor/PropertyDrawers/StateMachineStatePropertyDrawer.cs b/LocalPackages/net.peeweek.gameplay-ingredients/Editor/PropertyDrawers/StateMachineStatePropertyDrawer.cs new file mode 100644 index 0000000..6e2620d --- /dev/null +++ b/LocalPackages/net.peeweek.gameplay-ingredients/Editor/PropertyDrawers/StateMachineStatePropertyDrawer.cs @@ -0,0 +1,74 @@ +using UnityEngine.SceneManagement; +using UnityEngine; +using UnityEditor; +using GameplayIngredients.StateMachines; + +namespace GameplayIngredients.Editor +{ + [CustomPropertyDrawer(typeof(StateMachineStateAttribute))] + public class StateMachineStatePropertyDrawer : PropertyDrawer + { + public override void OnGUI(Rect position, SerializedProperty property, GUIContent label) + { + string propertyName = (attribute as StateMachineStateAttribute).PropertyName; + StateMachine stateMachine; + + if (propertyName == "") + stateMachine = (StateMachine)property.serializedObject.targetObject; + else + stateMachine = (StateMachine)property.serializedObject.FindProperty(propertyName).objectReferenceValue; + + if (stateMachine == null) + { + EditorGUI.HelpBox(position, "StateMachineStateAttribute property parameter references a null or not a GameplayIngredients.StateMachines.StateMachine type", MessageType.Error); + } + else + { + if(stateMachine != null && stateMachine.States != null) + { + string currentValue = property.stringValue; + int count = stateMachine.States.Length; + int[] indices = new int[count]; + GUIContent[] labels = new GUIContent[count]; + int selected = -1; + for (int i = 0; i < count; i++) + { + indices[i] = i; + if (stateMachine.States[i] != null) + { + string stateName = stateMachine.States[i].StateName; + + if (stateName == currentValue) + selected = i; + + labels[i] = new GUIContent(stateName); + } + else + labels[i] = new GUIContent("(Null State, please fix)"); + } + + int newIdx = EditorGUI.IntPopup(position, new GUIContent(property.displayName), selected, labels, indices); + if (GUI.changed && newIdx >= 0 && stateMachine.States[newIdx] != null) + { + property.stringValue = stateMachine.States[newIdx].StateName; + } + } + else + { + EditorGUI.HelpBox(position, "State machine is null or has no states", MessageType.Error); + } + + } + } + + static class Styles + { + public static GUIStyle errorfield; + + static Styles() + { + errorfield = new GUIStyle(EditorStyles.objectField); + } + } + } +} diff --git a/LocalPackages/net.peeweek.gameplay-ingredients/Editor/PropertyDrawers/StateMachineStatePropertyDrawer.cs.meta b/LocalPackages/net.peeweek.gameplay-ingredients/Editor/PropertyDrawers/StateMachineStatePropertyDrawer.cs.meta new file mode 100644 index 0000000..8c86643 --- /dev/null +++ b/LocalPackages/net.peeweek.gameplay-ingredients/Editor/PropertyDrawers/StateMachineStatePropertyDrawer.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: b9ead8a31655f214b8768b02688a41cf +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/LocalPackages/net.peeweek.gameplay-ingredients/Editor/PropertyDrawers/TypeDropDownPropertyDrawer.cs b/LocalPackages/net.peeweek.gameplay-ingredients/Editor/PropertyDrawers/TypeDropDownPropertyDrawer.cs new file mode 100644 index 0000000..9f1af6a --- /dev/null +++ b/LocalPackages/net.peeweek.gameplay-ingredients/Editor/PropertyDrawers/TypeDropDownPropertyDrawer.cs @@ -0,0 +1,60 @@ +using System; +using System.Collections.Generic; +using UnityEngine; +using UnityEditor; + +namespace GameplayIngredients.Editor +{ + [CustomPropertyDrawer(typeof(TypeDropDownAttribute))] + public class TypeDropDownPropertyDrawer : PropertyDrawer + { + Dictionary> m_AssignableTypeNames; + + Type type; + + + + public override void OnGUI(Rect position, SerializedProperty property, GUIContent label) + { + if(type == null) + type = ((TypeDropDownAttribute)attribute).m_BaseType; + + CacheType(type); + string TypeName = type.FullName; + + int index = m_AssignableTypeNames[TypeName].IndexOf(property.stringValue); + + EditorGUI.BeginChangeCheck(); + int newVal = EditorGUI.Popup(position, index, m_AssignableTypeNames[TypeName].ToArray()); + if(EditorGUI.EndChangeCheck() && index != newVal) + { + property.stringValue = m_AssignableTypeNames[TypeName][newVal]; + } + } + + void CacheType(Type baseType) + { + if (m_AssignableTypeNames == null) + { + m_AssignableTypeNames = new Dictionary>(); + + string key = baseType.FullName; + + if (!m_AssignableTypeNames.ContainsKey(key)) + m_AssignableTypeNames.Add(key, new List()); + + foreach(var assembly in AppDomain.CurrentDomain.GetAssemblies()) + { + foreach(var type in assembly.GetTypes()) + { + if(baseType.IsAssignableFrom(type) && !type.IsAbstract) + { + m_AssignableTypeNames[key].Add(type.Name); + } + } + } + } + } + } + +} diff --git a/LocalPackages/net.peeweek.gameplay-ingredients/Editor/PropertyDrawers/TypeDropDownPropertyDrawer.cs.meta b/LocalPackages/net.peeweek.gameplay-ingredients/Editor/PropertyDrawers/TypeDropDownPropertyDrawer.cs.meta new file mode 100644 index 0000000..327f026 --- /dev/null +++ b/LocalPackages/net.peeweek.gameplay-ingredients/Editor/PropertyDrawers/TypeDropDownPropertyDrawer.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: bdd0729fd7cbb0e43a9a33200833d782 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/LocalPackages/net.peeweek.gameplay-ingredients/Editor/PropertyDrawers/UITogglePropertyDrawer.cs b/LocalPackages/net.peeweek.gameplay-ingredients/Editor/PropertyDrawers/UITogglePropertyDrawer.cs new file mode 100644 index 0000000..f3f2c46 --- /dev/null +++ b/LocalPackages/net.peeweek.gameplay-ingredients/Editor/PropertyDrawers/UITogglePropertyDrawer.cs @@ -0,0 +1,30 @@ +using UnityEngine; +using UnityEngine.UI; +using UnityEditor; + +namespace GameplayIngredients.Editor +{ + [CustomPropertyDrawer(typeof(Actions.ToggleUIAction.UIToggle))] + public class UITogglePropertyDrawer : PropertyDrawer + { + public override void OnGUI(Rect position, SerializedProperty property, GUIContent label) + { + var toggle = property.FindPropertyRelative("State"); + var obj = property.FindPropertyRelative("Selectable"); + + var toggleRect = new Rect(position); + toggleRect.xMin = toggleRect.xMax - 80; + + var objRect = new Rect(position); + objRect.xMax -= 80; + + toggle.intValue = EditorGUI.IntPopup(toggleRect, toggle.intValue, labels, values); + obj.objectReferenceValue = EditorGUI.ObjectField(objRect, obj.objectReferenceValue, typeof(Selectable), true); + } + + static GUIContent[] labels = { new GUIContent("Disable"), new GUIContent("Enable"), new GUIContent("Toggle") }; + static int[] values = { 0, 1, 2 }; + } +} + + diff --git a/LocalPackages/net.peeweek.gameplay-ingredients/Editor/PropertyDrawers/UITogglePropertyDrawer.cs.meta b/LocalPackages/net.peeweek.gameplay-ingredients/Editor/PropertyDrawers/UITogglePropertyDrawer.cs.meta new file mode 100644 index 0000000..4cf5376 --- /dev/null +++ b/LocalPackages/net.peeweek.gameplay-ingredients/Editor/PropertyDrawers/UITogglePropertyDrawer.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 205551f5f51d20a4c85e2a619e35df8a +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/LocalPackages/net.peeweek.gameplay-ingredients/Editor/SceneViewPOV.meta b/LocalPackages/net.peeweek.gameplay-ingredients/Editor/SceneViewPOV.meta new file mode 100644 index 0000000..69cb4ec --- /dev/null +++ b/LocalPackages/net.peeweek.gameplay-ingredients/Editor/SceneViewPOV.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 9f5c0a18f21f69344964967090ad53e5 +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/LocalPackages/net.peeweek.gameplay-ingredients/Editor/SceneViewPOV/SceneViewPOV.cs b/LocalPackages/net.peeweek.gameplay-ingredients/Editor/SceneViewPOV/SceneViewPOV.cs new file mode 100644 index 0000000..950ca78 --- /dev/null +++ b/LocalPackages/net.peeweek.gameplay-ingredients/Editor/SceneViewPOV/SceneViewPOV.cs @@ -0,0 +1,169 @@ +using System.Collections; +using System.Collections.Generic; +using System.Linq; +using UnityEngine; +using UnityEngine.SceneManagement; +using UnityEditor; +using UnityEditor.SceneManagement; + +namespace GameplayIngredients.Editor +{ + public class SceneViewPOV : PopupWindowContent + { + static ScenePOVRoot POVRoot; + + const string kPOVObjectName = "__SceneView__POV__"; + + [InitializeOnLoadMethod] + static void Initialize() + { + SceneManager.activeSceneChanged -= EditorSceneManager_activeSceneChanged; + SceneManager.sceneLoaded -= SceneManager_sceneLoaded; + SceneManager.sceneUnloaded -= SceneManager_sceneUnloaded; + + SceneManager.activeSceneChanged += EditorSceneManager_activeSceneChanged; + SceneManager.sceneLoaded += SceneManager_sceneLoaded; + SceneManager.sceneUnloaded += SceneManager_sceneUnloaded; + } + + private static void SceneManager_sceneUnloaded(Scene arg0) + { + CheckPOVGameObjects(); + } + + private static void SceneManager_sceneLoaded(Scene arg0, LoadSceneMode arg1) + { + CheckPOVGameObjects(); + } + + private static void EditorSceneManager_activeSceneChanged(Scene arg0, Scene arg1) + { + CheckPOVGameObjects(); + } + + private static void CheckPOVGameObjects() + { + if (Application.isPlaying) + return; + + var activeScene = SceneManager.GetActiveScene(); + + ScenePOVRoot[] allRoots = GameObject.FindObjectsOfType(); + ScenePOVRoot activePOV = null; + foreach (var povRoot in allRoots) + { + if (povRoot.Scene == activeScene) + activePOV = povRoot; + } + + if (activePOV == null) + { + activePOV = CreatePOVRootObject(); + MarkDirtyPOVScene(activePOV); + }; + + POVRoot = activePOV; + } + + static ScenePOVRoot CreatePOVRootObject() + { + var povRoot = new GameObject(kPOVObjectName); + povRoot.isStatic = true; + povRoot.hideFlags = HideFlags.HideInHierarchy; + return povRoot.AddComponent(); + } + + public static void ShowPopup(Rect buttonRect, SceneView sceneView) + { + PopupWindow.Show(buttonRect, new SceneViewPOV(sceneView)); + } + + private SceneView m_SceneView; + + public SceneViewPOV(SceneView sceneView) + { + m_SceneView = sceneView; + } + + public override Vector2 GetWindowSize() + { + CheckPOVGameObjects(); + return new Vector2(256.0f, 80.0f + POVRoot.AllPOV.Length * 20); + } + + static void MarkDirtyPOVScene(ScenePOVRoot root) + { + EditorSceneManager.MarkSceneDirty(root.gameObject.scene); + } + + string m_NewPOVName = "New POV"; + + public override void OnGUI(Rect rect) + { + if (POVRoot == null) + CheckPOVGameObjects(); + + if (m_SceneView != null) + { + Styles.Header("Add Point Of View"); + using (new GUILayout.HorizontalScope()) + { + GUILayout.Label("Name", GUILayout.Width(64)); + m_NewPOVName = GUILayout.TextField(m_NewPOVName); + + if (GUILayout.Button("+", GUILayout.Width(32))) + { + POVRoot.AddPOV(m_SceneView.camera.transform, m_NewPOVName); + MarkDirtyPOVScene(POVRoot); + m_NewPOVName = "New POV"; + } + } + + GUILayout.Space(8); + + var povs = POVRoot.AllPOV; + + Styles.Header("Go to Point Of View"); + + foreach (var pov in povs.OrderBy(o => o.name)) + { + using (new EditorGUILayout.HorizontalScope()) + { + if (GUILayout.Button(pov.name, EditorStyles.foldout)) + { + m_SceneView.AlignViewToObject(pov.transform); + } + if (GUILayout.Button("X", GUILayout.Width(32))) + { + if (EditorUtility.DisplayDialog("Destroy POV?", "Do you want to destroy this POV: " + pov.gameObject.name + " ?", "Yes", "No")) + { + GameObject.DestroyImmediate(pov.gameObject); + MarkDirtyPOVScene(POVRoot); + } + } + } + } + } + else + { + EditorGUILayout.HelpBox("No POV Root found (Create an Empty Game Object named 'POV_ROOT') or no SceneView currently active", MessageType.Warning) ; + } + + } + + static class Styles + { + public static void Header(string name) + { + var content = new GUIContent(name); + var rect = GUILayoutUtility.GetRect(content, EditorStyles.boldLabel); + rect.xMin = 0; + rect.xMax = EditorGUIUtility.currentViewWidth; + + EditorGUI.DrawRect(rect, new Color(0.5f, 0.5f, 0.5f, 0.1f)); + EditorGUI.LabelField(rect, content, EditorStyles.boldLabel); + } + } + } +} + diff --git a/LocalPackages/net.peeweek.gameplay-ingredients/Editor/SceneViewPOV/SceneViewPOV.cs.meta b/LocalPackages/net.peeweek.gameplay-ingredients/Editor/SceneViewPOV/SceneViewPOV.cs.meta new file mode 100644 index 0000000..3430aca --- /dev/null +++ b/LocalPackages/net.peeweek.gameplay-ingredients/Editor/SceneViewPOV/SceneViewPOV.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 89bd4cc91a81256468e9b3defd14059d +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/LocalPackages/net.peeweek.gameplay-ingredients/Editor/SceneViewToolbar.cs b/LocalPackages/net.peeweek.gameplay-ingredients/Editor/SceneViewToolbar.cs new file mode 100644 index 0000000..3a0fad0 --- /dev/null +++ b/LocalPackages/net.peeweek.gameplay-ingredients/Editor/SceneViewToolbar.cs @@ -0,0 +1,130 @@ +using System.Collections; +using System.Collections.Generic; +using UnityEngine; +using UnityEditor; +using System; + +namespace GameplayIngredients.Editor +{ + static class SceneViewToolbar + { + public delegate void SceneViewToolbarDelegate(SceneView sceneView); + + public static event SceneViewToolbarDelegate OnSceneViewToolbarGUI; + + [InitializeOnLoadMethod] + static void Initialize() + { + SceneView.duringSceneGui += OnSceneGUI; + } + + private static void OnSceneGUI(SceneView sceneView) + { + var r = new Rect(Vector2.zero, new Vector2(sceneView.position.width,24)); + Handles.BeginGUI(); + using (new GUILayout.AreaScope(r)) + { + using (new GUILayout.HorizontalScope(EditorStyles.toolbar)) + { + + if(PlayFromHere.IsReady) + { + bool play = GUILayout.Toggle(EditorApplication.isPlaying, Contents.playFromHere, EditorStyles.toolbarButton); + + if(GUI.changed) + { + if (play) + PlayFromHere.Play(sceneView); + else + EditorApplication.isPlaying = false; + } + + GUILayout.Space(24); + } + + Color backup = GUI.color; + + bool isLinked = LinkGameView.Active; + bool isLocked = LinkGameView.LockedSceneView == sceneView; + + + if(isLinked && isLocked) + { + GUI.color = Color.green *2; + } + + isLinked = GUILayout.Toggle(isLinked, Contents.linkGameView, EditorStyles.toolbarButton, GUILayout.Width(64)); + + if (GUI.changed) + { + LinkGameView.Active = isLinked; + } + + isLocked = GUILayout.Toggle(isLocked, Contents.lockLinkGameView, EditorStyles.toolbarButton); + + if (GUI.changed) + { + if (isLocked) + { + LinkGameView.LockedSceneView = sceneView; + } + else + { + LinkGameView.LockedSceneView = null; + } + } + + GUI.color = backup; + + // SceneViewPOV + GUILayout.Space(16); + if(GUILayout.Button("POV", EditorStyles.toolbarDropDown)) + { + Rect btnrect = GUILayoutUtility.GetLastRect(); + btnrect.yMax += 17; + SceneViewPOV.ShowPopup(btnrect, sceneView); + } + + GUILayout.FlexibleSpace(); + + // Custom Code here + if (OnSceneViewToolbarGUI != null) + OnSceneViewToolbarGUI.Invoke(sceneView); + + // Saving Space not to overlap view controls + GUILayout.Space(96); + + } + } + Handles.EndGUI(); + } + + static class Contents + { + public static GUIContent playFromHere; + public static GUIContent lockLinkGameView; + public static GUIContent linkGameView; + + static Contents() + { + lockLinkGameView = new GUIContent(EditorGUIUtility.IconContent("IN LockButton")); + linkGameView = new GUIContent(EditorGUIUtility.Load("Packages/net.peeweek.gameplay-ingredients/Icons/GUI/Camera16x16.png") as Texture); + linkGameView.text = " Game"; + + playFromHere = new GUIContent(EditorGUIUtility.IconContent("Animation.Play")); + playFromHere.text = "Here"; + } + } + + static class Styles + { + public static GUIStyle toolbar; + + static Styles() + { + toolbar = new GUIStyle(EditorStyles.inspectorFullWidthMargins); + } + } + } +} + diff --git a/LocalPackages/net.peeweek.gameplay-ingredients/Editor/SceneViewToolbar.cs.meta b/LocalPackages/net.peeweek.gameplay-ingredients/Editor/SceneViewToolbar.cs.meta new file mode 100644 index 0000000..9238814 --- /dev/null +++ b/LocalPackages/net.peeweek.gameplay-ingredients/Editor/SceneViewToolbar.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: ae60b154e719ca941ba3d0bd03137322 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/LocalPackages/net.peeweek.gameplay-ingredients/Editor/SelectionHistory.meta b/LocalPackages/net.peeweek.gameplay-ingredients/Editor/SelectionHistory.meta new file mode 100644 index 0000000..24d05fa --- /dev/null +++ b/LocalPackages/net.peeweek.gameplay-ingredients/Editor/SelectionHistory.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 74683706205d7294c8af1bd860925e81 +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/LocalPackages/net.peeweek.gameplay-ingredients/Editor/SelectionHistory/SelectionHistoryWindow.cs b/LocalPackages/net.peeweek.gameplay-ingredients/Editor/SelectionHistory/SelectionHistoryWindow.cs new file mode 100644 index 0000000..3d9562f --- /dev/null +++ b/LocalPackages/net.peeweek.gameplay-ingredients/Editor/SelectionHistory/SelectionHistoryWindow.cs @@ -0,0 +1,250 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Reflection; +using UnityEngine; +using UnityEditor; + +namespace GameplayIngredients.Editor +{ + public class SelectionHistoryWindow : EditorWindow + { + [MenuItem("Window/General/Selection History")] + public static void OpenSelectionHistoryWindow() + { + EditorWindow.GetWindow(); + } + + Vector2 scrollPos = Vector2.zero; + + void OnGUI() + { + titleContent = Contents.title; + + scrollPos = EditorGUILayout.BeginScrollView(scrollPos); + { + Selection_OnGUI(); + } + EditorGUILayout.EndScrollView(); + } + + void OnEnable() + { + lockedObjects = null; + selectionHistory = null; + } + + void OnDisable() + { + lockedObjects = null; + selectionHistory = null; + } + + List selectionHistory; + List lockedObjects; + + int maxHistoryCount = 32; + bool ignoreNextSelection = false; + + void OnSelectionChange() + { + if (ignoreNextSelection) + { + ignoreNextSelection = false; + return; + } + + if (selectionHistory == null) selectionHistory = new List(); + if (lockedObjects == null) lockedObjects = new List(); + + if (Selection.activeGameObject != null || Selection.gameObjects.Length > 0) + { + + foreach(var go in Selection.gameObjects) + { + if (!selectionHistory.Contains(go)) + selectionHistory.Add(go); + } + + if (selectionHistory.Count > maxHistoryCount) + selectionHistory.Take(maxHistoryCount); + + Repaint(); + } + + } + + public bool CompareArray(GameObject[] a, GameObject[] b) + { + return a.SequenceEqual(b); + } + + void Selection_OnGUI() + { + if (selectionHistory == null) selectionHistory = new List(); + if (lockedObjects == null) lockedObjects = new List(); + int i = 0; + int toRemove = -1; + + if (lockedObjects.Count > 0) + { + GUILayout.Label("Favorites", EditorStyles.boldLabel); + i = 0; + toRemove = -1; + foreach (var obj in lockedObjects) + { + if (obj == null) + { + using (new EditorGUILayout.HorizontalScope()) + { + GUILayout.Label("(object is either null or has been deleted)"); + if (GUILayout.Button("X", GUILayout.Width(24))) + { + toRemove = i; + } + } + } + else + { + bool highlight = Selection.gameObjects.Contains(obj); + Color backup = GUI.color; + + if (highlight) + GUI.color = Styles.highlightColor; + + using (new EditorGUILayout.HorizontalScope()) + { + var b = GUI.color; + GUI.color = Color.yellow * 3; + if (GUILayout.Button(Contents.star, Styles.icon, GUILayout.Width(24))) + { + toRemove = i; + } + + GUI.color = b; + + string label = obj.name; + + if (GUILayout.Button(label, EditorStyles.foldout)) + { + ignoreNextSelection = true; + Selection.activeObject = obj; + } + if (GUILayout.Button("Focus", EditorStyles.miniButton, GUILayout.Width(40))) + { + ignoreNextSelection = true; + Selection.activeObject = obj; + SceneView.lastActiveSceneView.FrameSelected(); + } + } + + GUI.color = backup; + } + i++; + } + if (toRemove != -1) lockedObjects.RemoveAt(toRemove); + } + + int toAdd = -1; + toRemove = -1; + i = 0; + using (new EditorGUILayout.HorizontalScope()) + { + GUILayout.Label("History", EditorStyles.boldLabel); + GUILayout.FlexibleSpace(); + if (GUILayout.Button("Clear", EditorStyles.miniButton)) + { + selectionHistory.Clear(); + Repaint(); + } + } + + GUILayout.Space(8); + + var reversedHistory = selectionHistory.Reverse().ToArray(); + foreach (var obj in reversedHistory) + { + if (obj != null) + { + bool highlight = Selection.gameObjects.Contains(obj); + Color backup = GUI.color; + + if (highlight) + GUI.color = Styles.highlightColor; + + using (new EditorGUILayout.HorizontalScope()) + { + + if (GUILayout.Button(Contents.starDisabled, Styles.icon, GUILayout.Width(24))) + { + toAdd = i; + } + + string label = obj.name; + if (GUILayout.Button(label, EditorStyles.foldout)) + { + ignoreNextSelection = true; + Selection.activeObject = obj; + } + if (GUILayout.Button("Focus", Styles.historyButton, GUILayout.Width(40))) + { + ignoreNextSelection = true; + Selection.activeObject = obj; + SceneView.lastActiveSceneView.FrameSelected(); + } + } + var rect = GUILayoutUtility.GetLastRect(); + EditorGUI.DrawRect(rect, new Color(0.2f,0.2f,0.2f,0.5f)); + + GUI.color = backup; + } + + i++; + } + if (toAdd != -1) + { + lockedObjects.Add(reversedHistory[toAdd]); + Repaint(); + } + if (toRemove != -1) + { + selectionHistory.RemoveAt(toRemove); + Repaint(); + } + + } + + static class Styles + { + public static GUIStyle historyButton; + public static GUIStyle highlight; + public static Color highlightColor = new Color(2.0f, 2.0f, 2.0f); + + public static GUIStyle icon; + + static Styles() + { + historyButton = new GUIStyle(EditorStyles.miniButton); + historyButton.alignment = TextAnchor.MiddleLeft; + highlight = new GUIStyle(EditorStyles.miniLabel); + highlight.onNormal.background = Texture2D.whiteTexture; + highlight.onHover.background = Texture2D.whiteTexture; + highlight.onActive.background = Texture2D.whiteTexture; + highlight.onFocused.background = Texture2D.whiteTexture; + + icon = new GUIStyle(EditorStyles.label); + icon.fixedHeight = 16; + icon.padding = new RectOffset(8,2,2,0); + icon.margin = new RectOffset(); + + } + } + + static class Contents + { + public static GUIContent title = new GUIContent("Selection History"); + public static GUIContent star = new GUIContent(EditorGUIUtility.IconContent("Favorite Icon").image); + public static GUIContent starDisabled = new GUIContent(EditorGUIUtility.IconContent("Favorite").image); + } + } +} diff --git a/LocalPackages/net.peeweek.gameplay-ingredients/Editor/SelectionHistory/SelectionHistoryWindow.cs.meta b/LocalPackages/net.peeweek.gameplay-ingredients/Editor/SelectionHistory/SelectionHistoryWindow.cs.meta new file mode 100644 index 0000000..6251830 --- /dev/null +++ b/LocalPackages/net.peeweek.gameplay-ingredients/Editor/SelectionHistory/SelectionHistoryWindow.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 469c58d91c79ca34ea60c289f3cd53af +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/LocalPackages/net.peeweek.gameplay-ingredients/Editor/WelcomeScreen.meta b/LocalPackages/net.peeweek.gameplay-ingredients/Editor/WelcomeScreen.meta new file mode 100644 index 0000000..5ac15e4 --- /dev/null +++ b/LocalPackages/net.peeweek.gameplay-ingredients/Editor/WelcomeScreen.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 867a18b779dd1b6418b5d8eb608876b7 +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/LocalPackages/net.peeweek.gameplay-ingredients/Editor/WelcomeScreen/WelcomeScreen.Setup.cs b/LocalPackages/net.peeweek.gameplay-ingredients/Editor/WelcomeScreen/WelcomeScreen.Setup.cs new file mode 100644 index 0000000..a9fee80 --- /dev/null +++ b/LocalPackages/net.peeweek.gameplay-ingredients/Editor/WelcomeScreen/WelcomeScreen.Setup.cs @@ -0,0 +1,115 @@ +using System; +using System.Collections.Generic; +using UnityEngine; +using UnityEditor; + +namespace GameplayIngredients.Editor +{ + partial class WelcomeScreen : EditorWindow + { + void OnSetupGUI() + { + GUILayout.Label("First Time Setup", EditorStyles.boldLabel); + + using (new GUILayout.VerticalScope(Styles.helpBox)) + { + pages[currentPage].Invoke(); + + GUILayout.FlexibleSpace(); + using (new GUILayout.HorizontalScope()) + { + GUILayout.FlexibleSpace(); + EditorGUI.BeginDisabledGroup(currentPage == 0); + if (GUILayout.Button("Back")) + { + currentPage--; + } + EditorGUI.EndDisabledGroup(); + EditorGUI.BeginDisabledGroup(currentPage == pages.Length - 1); + if (GUILayout.Button("Next")) + { + currentPage++; + } + EditorGUI.EndDisabledGroup(); + } + } + } + + public int currentPage = 0; + + public Action[] pages = new Action[] + { + WelcomePage, SettingAssetPage, UnpackPackagePage + }; + + static void WelcomePage() + { + GUILayout.Label("Welcome to Gameplay Ingredients !", Styles.title); + GUILayout.Space(12); + GUILayout.Label(@"This wizard will help you set up your project so you can use and customize scripts.", Styles.body); + + } + + public const string kSettingsAssetPath = "Assets/Resources/GameplayIngredientsSettings.asset"; + + static void SettingAssetPage() + { + GUILayout.Label("Creating a Settings Asset", Styles.title); + GUILayout.Space(12); + GUILayout.Label(@"GameplayIngredients is a framework that comes with a variety of features : these can be configured in a GameplayIngredientsSettings asset. + +This asset needs to be stored in a Resources folder. +While this is not mandatory we advise you to create it in order to be able to modify it for your project's needs. +", Styles.body); + GUILayout.Space(16); + using (new GUILayout.HorizontalScope()) + { + GUILayout.FlexibleSpace(); + if (GUILayout.Button("Create GameplayIngredientsSettings Asset")) + { + bool create = true; + if(System.IO.File.Exists(Application.dataPath +"/../"+ kSettingsAssetPath)) + { + if (!EditorUtility.DisplayDialog("GameplayIngredientsSettings Asset Overwrite", "A GameplayIngredientsSettings Asset already exists, do you want to overwrite it?", "Yes", "No")) + create = false; + } + + if(create) + { + if(!System.IO.Directory.Exists(Application.dataPath+"/Resources")) + AssetDatabase.CreateFolder("Assets", "Resources"); + + GameplayIngredientsSettings asset = Instantiate(GameplayIngredientsSettings.defaultSettings); + AssetDatabase.CreateAsset(asset, kSettingsAssetPath); + Selection.activeObject = asset; + } + } + } + } + + static void UnpackPackagePage() + { + GUILayout.Label("Unpacking Starter Content", Styles.title); + GUILayout.Space(12); + GUILayout.Label(@"In order to customize your project, you can create default assets that you will be able to customize. + +Please select a package depending on your project's render loop. If you do not know about render loops, you will probably need the Legacy Package.", Styles.body); + GUILayout.Space(16); + using (new GUILayout.HorizontalScope()) + { + GUILayout.FlexibleSpace(); + using (new GUILayout.VerticalScope()) + { + if (GUILayout.Button("Legacy Renderer")) + AssetDatabase.ImportPackage("Packages/net.peeweek.gameplay-ingredients/StarterAssets/GameplayIngredients-Starter-LegacyRenderer.unitypackage", false); + if (GUILayout.Button("HD Render Pipeline")) + AssetDatabase.ImportPackage("Packages/net.peeweek.gameplay-ingredients/StarterAssets/GameplayIngredients-Starter-HDRP.unitypackage", false); + if (GUILayout.Button("Lightweight Render Pipeline")) + AssetDatabase.ImportPackage("Packages/net.peeweek.gameplay-ingredients/StarterAssets/GameplayIngredients-Starter-LWRP.unitypackage", false); + } + } + } + + } +} + diff --git a/LocalPackages/net.peeweek.gameplay-ingredients/Editor/WelcomeScreen/WelcomeScreen.Setup.cs.meta b/LocalPackages/net.peeweek.gameplay-ingredients/Editor/WelcomeScreen/WelcomeScreen.Setup.cs.meta new file mode 100644 index 0000000..789d394 --- /dev/null +++ b/LocalPackages/net.peeweek.gameplay-ingredients/Editor/WelcomeScreen/WelcomeScreen.Setup.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 355e546690fd9c045816544642d9faa8 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/LocalPackages/net.peeweek.gameplay-ingredients/Editor/WelcomeScreen/WelcomeScreen.Tips.cs b/LocalPackages/net.peeweek.gameplay-ingredients/Editor/WelcomeScreen/WelcomeScreen.Tips.cs new file mode 100644 index 0000000..2de9752 --- /dev/null +++ b/LocalPackages/net.peeweek.gameplay-ingredients/Editor/WelcomeScreen/WelcomeScreen.Tips.cs @@ -0,0 +1,72 @@ +using System.Collections; +using System.Collections.Generic; +using UnityEngine; +using UnityEditor; + +namespace GameplayIngredients.Editor +{ + partial class WelcomeScreen : EditorWindow + { + int tipIndex = 0; + + void InitTips() + { + tipIndex = Random.Range(0, tips.Count); + } + + void OnTipsGUI() + { + GUILayout.Label("Tip of the Day", EditorStyles.boldLabel); + + using (new GUILayout.VerticalScope(Styles.helpBox)) + { + var tip = tips[tipIndex]; + GUILayout.Label(tip.Title, Styles.title); + GUILayout.Space(12); + GUILayout.Label(tip.Body, Styles.body); + GUILayout.FlexibleSpace(); + using (new GUILayout.HorizontalScope()) + { + GUILayout.FlexibleSpace(); + if (GUILayout.Button("<<")) + { + tipIndex--; + if (tipIndex < 0) + tipIndex = tips.Count - 1; + } + if (GUILayout.Button(">>")) + { + tipIndex++; + if (tipIndex == tips.Count) + tipIndex = 0; + } + } + } + } + + struct Tip + { + public string Title; + public string Body; + } + + static List tips = new List() + { +#if UNITY_2018_3 + new Tip(){ Title = "Show Gizmos", Body = "You can toggle Gizmos on and off by using the Ctrl + , key shortcut."}, +#endif + new Tip(){ Title = "Gameplay Ingredients Setttings", Body = "This special file contains all configuration for Gameplay Ingredients in your project. While this asset is not mandatory, it is advised to create it to be able to configure the project.\n\nIn order to create it, use the Setup Wizard window by clicking the 'Window/Gameplay Ingredients' menu."}, + new Tip(){ Title = "Editor Scene Setups", Body = "You can save your current multi-scene setup to an asset by using the File/Save Current Scene Setup As... or create an Editor Scene Setup asset from the Project View. These assets can be double-clicked to restore all scenes at once."}, + new Tip(){ Title = "Find And Replace", Body = "You can use the Find and Replace window to select, add, and/or refine list of objects in your scene based on different criteria (name, components, etc.). You can then turn this search result into a selection, or replace every object from this list by a prefab or a copy of another game object.\n\n Use the 'Edit/Find And Replace' menu to open the window or use the Ctrl+Alt+Shift+F key combo."}, + new Tip(){ Title = "Gameplay Ingredients Window", Body = "This is the window you are currently looking at : if you close it, you can access it later by clicking the 'Window/Gameplay Ingredients' menu, or by restarting the editor (if the 'Show At Startup' Flag is checked.\n\nThis window displays tooltips and enables to perform basic configuration for your project."}, + new Tip(){ Title = "Game View Link", Body = "Game View link enables you to link your scene view and your game view so the scene point of view replicates in the game view. You can define a prefab (named LinkGameViewCamera) containing a camera to setup this camera (for instance if you use HD Render Pipeline and Postprocessing).\n\nYou can Toggle the Game View Linking by cicking the '(Camera) Game' Button on the additional toolbar or use the Ctrl+, key combo. \n\nThe lock icon next to the button enables locking to a particular SceneView window (useful when using multiple Scene Views)."}, + new Tip(){ Title = "Advanced Hierarchy View", Body = "You can toggle Advanced Hierarchy View by selecting them in the Edit menu. This will display hints as icons for most common components on your game objects.\n\nYou can toggle these hints by using the Edit/Advanced Hierarchy View "}, + new Tip(){ Title = "Scene View POVs", Body = "Scene View POVs enable storing custom point of views in your scenes. To use it, select the POV dropdown in the additional Scene View toolbar."}, + new Tip(){ Title = "Selection History", Body = "Selection History keeps track of your previously selected objects. You can also star/unstar objects in order to go back at them more easily.\n\nTo open this window, use the 'Window/Selection History' menu item."}, + new Tip(){ Title = "Play From Here", Body = "Play From Here enables a custom callback when starting your Editor Play Session. Implement the callback and use the scene view camera position and forward vector to generate your custom start function."}, + new Tip(){ Title = "Events, Logic and Actions", Body = "Gameplay Ingredients ships with many Actions, Logic and Events in order to set-up your scenes. Actions perform various actions on your scene objects, Logic trigger actions based on conditions, Events trigger Actions and Logic based on scene interaction (eg: On Trigger Enter)"}, + new Tip(){ Title = "Managers", Body = "Managers are Monobehaviors that instantiate themselves automatically upon startup. You can define a [ManagerDefaultPrefab] attribute to load a prefab containing the manager if it needs to handle other objects and components.\n\nYou can disable certain managers from being created by editing the 'Excluded Managers' list in your GameplayIngredientsSettings asset."}, + }; + + } +} diff --git a/LocalPackages/net.peeweek.gameplay-ingredients/Editor/WelcomeScreen/WelcomeScreen.Tips.cs.meta b/LocalPackages/net.peeweek.gameplay-ingredients/Editor/WelcomeScreen/WelcomeScreen.Tips.cs.meta new file mode 100644 index 0000000..6c25be6 --- /dev/null +++ b/LocalPackages/net.peeweek.gameplay-ingredients/Editor/WelcomeScreen/WelcomeScreen.Tips.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 53a69596a59d33047b38f348b727a44d +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/LocalPackages/net.peeweek.gameplay-ingredients/Editor/WelcomeScreen/WelcomeScreen.cs b/LocalPackages/net.peeweek.gameplay-ingredients/Editor/WelcomeScreen/WelcomeScreen.cs new file mode 100644 index 0000000..2152d57 --- /dev/null +++ b/LocalPackages/net.peeweek.gameplay-ingredients/Editor/WelcomeScreen/WelcomeScreen.cs @@ -0,0 +1,227 @@ +using System.Collections; +using System.Collections.Generic; +using UnityEngine; +using UnityEditor; + +namespace GameplayIngredients.Editor +{ + partial class WelcomeScreen : EditorWindow + { + const string kShowOnStartupPreference = "GameplayIngredients.Welcome.ShowAtStartup"; + const int WindowWidth = 640; + const int WindowHeight = 520; + + static bool showOnStartup + { + get { return EditorPrefs.GetBool(kShowOnStartupPreference, true); } + set { if (value != showOnStartup) EditorPrefs.SetBool(kShowOnStartupPreference, value); } + } + + static Texture2D header + { + get + { + if (s_Header == null) + s_Header = (Texture2D)EditorGUIUtility.Load("Packages/net.peeweek.gameplay-ingredients/Editor/WelcomeScreen/welcome-title.png"); + + return s_Header; + } + } + + static Texture2D s_Header; + + public static void Reload() + { + EditorApplication.update -= ShowAtStartup; + InitShowAtStartup(); + } + + [InitializeOnLoadMethod] + static void InitShowAtStartup() + { + if (showOnStartup && !GameplayIngredientsSettings.currentSettings.disableWelcomeScreenAutoStart) + EditorApplication.update += ShowAtStartup; + } + + static void ShowAtStartup() + { + if (!Application.isPlaying) + { + ShowFromMenu(); + } + EditorApplication.update -= ShowAtStartup; + } + + [MenuItem("Window/Gameplay Ingredients/Welcome Screen", priority = MenuItems.kWindowMenuPriority)] + static void ShowFromMenu() + { + GetWindow(true, "Gameplay Ingredients"); + } + + private void OnEnable() + { + this.position = new Rect((Screen.width / 2.0f) - WindowWidth / 2, (Screen.height / 2.0f) - WindowHeight / 2, WindowWidth, WindowHeight); + this.minSize = new Vector2(WindowWidth, WindowHeight); + this.maxSize = new Vector2(WindowWidth, WindowHeight); + + if (!GameplayIngredientsSettings.hasSettingAsset) + wizardMode = WizardMode.FirstTimeSetup; + + InitTips(); + } + + private void OnDestroy() + { + EditorApplication.update -= ShowAtStartup; + } + + private enum WizardMode + { + TipOfTheDay = 0, + FirstTimeSetup = 1, + About = 2, + } + + [SerializeField] + private WizardMode wizardMode = WizardMode.TipOfTheDay; + + private void OnGUI() + { + Rect headerRect = GUILayoutUtility.GetRect(640, 215); + GUI.DrawTexture(headerRect, header); + using (new GUILayout.AreaScope(new Rect(160, 180, 320, 32))) + { + using (new GUILayout.HorizontalScope()) + { + GUILayout.FlexibleSpace(); + + using (new GUILayout.HorizontalScope(EditorStyles.miniButton)) + { + bool value = false; + + value = wizardMode == WizardMode.TipOfTheDay; + value = GUILayout.Toggle(value, " Tips ", Styles.buttonLeft); + if(value) + wizardMode = WizardMode.TipOfTheDay; + + value = wizardMode == WizardMode.FirstTimeSetup; + value = GUILayout.Toggle(value, " Setup ", Styles.buttonMid); + if (value) + wizardMode = WizardMode.FirstTimeSetup; + + value = wizardMode == WizardMode.About; + value = GUILayout.Toggle(value, " About ", Styles.buttonRight); + if(value) + wizardMode = WizardMode.About; + } + + GUILayout.FlexibleSpace(); + } + } + GUILayout.Space(8); + + switch (wizardMode) + { + case WizardMode.TipOfTheDay: + OnTipsGUI(); + break; + case WizardMode.FirstTimeSetup: + OnSetupGUI(); + break; + case WizardMode.About: + OnAboutGUI(); + break; + } + + Rect line = GUILayoutUtility.GetRect(640, 1); + EditorGUI.DrawRect(line, Color.black); + using (new GUILayout.HorizontalScope()) + { + if(!GameplayIngredientsSettings.currentSettings.disableWelcomeScreenAutoStart) + { + showOnStartup = GUILayout.Toggle(showOnStartup, " Show this window on startup"); + } + GUILayout.FlexibleSpace(); + if (GUILayout.Button("Close")) + { + this.Close(); + } + } + } + + void OnAboutGUI() + { + GUILayout.Label("About", EditorStyles.boldLabel); + + using (new GUILayout.VerticalScope(Styles.helpBox)) + { + + GUILayout.Label("Gameplay Ingredients", Styles.centeredTitle); + GUILayout.Label(@"(and cooking ustensils) + +A set of Open Source Runtime and Editor Tools for your Unity prototypes and games. These scripts are maintained by Thomas Iche and released under MIT License as a unity package. + +This package also makes use of the following third party components: +- Naughty Attributes by Denis Rizov (https://github.com/dbrizov) +- Fugue Icons by Yusuke Kamiyamane (https://p.yusukekamiyamane.com/). +- Header art background 'Chef's Station' by Todd Quackenbush (https://unsplash.com/photos/x5SRhkFajrA). +", Styles.centeredBody); + + using (new GUILayout.HorizontalScope()) + { + GUILayout.FlexibleSpace(); + if (GUILayout.Button(" Github Page ", Styles.buttonLeft)) + Application.OpenURL("https://github.com/peeweek/net.peeweek.gameplay-ingredients"); + if (GUILayout.Button(" Report a Bug ", Styles.buttonMid)) + Application.OpenURL("https://github.com/peeweek/net.peeweek.gameplay-ingredients/issues"); + if (GUILayout.Button(" LICENSE ", Styles.buttonRight)) + Application.OpenURL("https://github.com/peeweek/net.peeweek.gameplay-ingredients/blob/master/LICENSE"); + + GUILayout.FlexibleSpace(); + } + + GUILayout.FlexibleSpace(); + } + } + + static class Styles + { + public static GUIStyle buttonLeft; + public static GUIStyle buttonMid; + public static GUIStyle buttonRight; + public static GUIStyle title; + public static GUIStyle body; + + public static GUIStyle centeredTitle; + public static GUIStyle centeredBody; + public static GUIStyle helpBox; + + static Styles() + { + buttonLeft = new GUIStyle(EditorStyles.miniButtonLeft); + buttonMid = new GUIStyle(EditorStyles.miniButtonMid); + buttonRight = new GUIStyle(EditorStyles.miniButtonRight); + buttonLeft.fontSize = 12; + buttonMid.fontSize = 12; + buttonRight.fontSize = 12; + + title = new GUIStyle(EditorStyles.label); + title.fontSize = 22; + + centeredTitle = new GUIStyle(title); + centeredTitle.alignment = TextAnchor.UpperCenter; + + body = new GUIStyle(EditorStyles.label); + body.fontSize = 12; + body.wordWrap = true; + body.richText = true; + + centeredBody = new GUIStyle(body); + centeredBody.alignment = TextAnchor.UpperCenter; + + helpBox = new GUIStyle(EditorStyles.helpBox); + helpBox.padding = new RectOffset(12, 12, 12, 12); + } + } + } +} diff --git a/LocalPackages/net.peeweek.gameplay-ingredients/Editor/WelcomeScreen/WelcomeScreen.cs.meta b/LocalPackages/net.peeweek.gameplay-ingredients/Editor/WelcomeScreen/WelcomeScreen.cs.meta new file mode 100644 index 0000000..3e07a41 --- /dev/null +++ b/LocalPackages/net.peeweek.gameplay-ingredients/Editor/WelcomeScreen/WelcomeScreen.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 5b486619dc284034c8c4d0dbbc341edd +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/LocalPackages/net.peeweek.gameplay-ingredients/Editor/WelcomeScreen/welcome-title.png b/LocalPackages/net.peeweek.gameplay-ingredients/Editor/WelcomeScreen/welcome-title.png new file mode 100644 index 0000000..fce736d --- /dev/null +++ b/LocalPackages/net.peeweek.gameplay-ingredients/Editor/WelcomeScreen/welcome-title.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:a3e4d25c3f5994b5c5c5ec071ea0e9fad7fca459049a11e75066769023f38b12 +size 176606 diff --git a/LocalPackages/net.peeweek.gameplay-ingredients/Editor/WelcomeScreen/welcome-title.png.meta b/LocalPackages/net.peeweek.gameplay-ingredients/Editor/WelcomeScreen/welcome-title.png.meta new file mode 100644 index 0000000..d132461 --- /dev/null +++ b/LocalPackages/net.peeweek.gameplay-ingredients/Editor/WelcomeScreen/welcome-title.png.meta @@ -0,0 +1,110 @@ +fileFormatVersion: 2 +guid: 30af3ba05ba5d7c468cc7b1e1f1bd088 +TextureImporter: + fileIDToRecycleName: {} + externalObjects: {} + serializedVersion: 9 + mipmaps: + mipMapMode: 0 + enableMipMap: 0 + sRGBTexture: 1 + linearTexture: 0 + fadeOut: 0 + borderMipMap: 0 + mipMapsPreserveCoverage: 0 + alphaTestReferenceValue: 0.5 + mipMapFadeDistanceStart: 1 + mipMapFadeDistanceEnd: 3 + bumpmap: + convertToNormalMap: 0 + externalNormalMap: 0 + heightScale: 0.25 + normalMapFilter: 0 + isReadable: 0 + streamingMipmaps: 0 + streamingMipmapsPriority: 0 + grayScaleToAlpha: 0 + generateCubemap: 6 + cubemapConvolution: 0 + seamlessCubemap: 0 + textureFormat: 1 + maxTextureSize: 2048 + textureSettings: + serializedVersion: 2 + filterMode: 0 + aniso: 1 + mipBias: -100 + wrapU: 1 + wrapV: 1 + wrapW: -1 + nPOTScale: 0 + lightmap: 0 + compressionQuality: 50 + spriteMode: 0 + spriteExtrude: 1 + spriteMeshType: 1 + alignment: 0 + spritePivot: {x: 0.5, y: 0.5} + spritePixelsToUnits: 100 + spriteBorder: {x: 0, y: 0, z: 0, w: 0} + spriteGenerateFallbackPhysicsShape: 1 + alphaUsage: 1 + alphaIsTransparency: 1 + spriteTessellationDetail: -1 + textureType: 2 + textureShape: 1 + singleChannelComponent: 0 + maxTextureSizeSet: 0 + compressionQualitySet: 0 + textureFormatSet: 0 + platformSettings: + - serializedVersion: 2 + buildTarget: DefaultTexturePlatform + maxTextureSize: 2048 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 0 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + androidETC2FallbackOverride: 0 + - serializedVersion: 2 + buildTarget: Standalone + maxTextureSize: 2048 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 0 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + androidETC2FallbackOverride: 0 + - serializedVersion: 2 + buildTarget: WebGL + maxTextureSize: 2048 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 0 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + androidETC2FallbackOverride: 0 + spriteSheet: + serializedVersion: 2 + sprites: [] + outline: [] + physicsShape: [] + bones: [] + spriteID: + vertices: [] + indices: + edges: [] + weights: [] + spritePackingTag: + pSDRemoveMatte: 0 + pSDShowRemoveMatteOption: 0 + userData: + assetBundleName: + assetBundleVariant: diff --git a/LocalPackages/net.peeweek.gameplay-ingredients/Icons.meta b/LocalPackages/net.peeweek.gameplay-ingredients/Icons.meta new file mode 100644 index 0000000..25213ee --- /dev/null +++ b/LocalPackages/net.peeweek.gameplay-ingredients/Icons.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 05dec2b2a3a7d2f4c9d52c57971c281a +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/LocalPackages/net.peeweek.gameplay-ingredients/Icons/Actions.meta b/LocalPackages/net.peeweek.gameplay-ingredients/Icons/Actions.meta new file mode 100644 index 0000000..951932f --- /dev/null +++ b/LocalPackages/net.peeweek.gameplay-ingredients/Icons/Actions.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 40e5c1f1b292984498b1086f17d99046 +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/LocalPackages/net.peeweek.gameplay-ingredients/Icons/Actions/ic-action-attach.png b/LocalPackages/net.peeweek.gameplay-ingredients/Icons/Actions/ic-action-attach.png new file mode 100644 index 0000000..b61a1b9 --- /dev/null +++ b/LocalPackages/net.peeweek.gameplay-ingredients/Icons/Actions/ic-action-attach.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:a7670ea1e03435846622f5adf759a380015e0aded6b0b9680c32824495fa8925 +size 932 diff --git a/LocalPackages/net.peeweek.gameplay-ingredients/Icons/Actions/ic-action-attach.png.meta b/LocalPackages/net.peeweek.gameplay-ingredients/Icons/Actions/ic-action-attach.png.meta new file mode 100644 index 0000000..50317c3 --- /dev/null +++ b/LocalPackages/net.peeweek.gameplay-ingredients/Icons/Actions/ic-action-attach.png.meta @@ -0,0 +1,110 @@ +fileFormatVersion: 2 +guid: e957d738ff2156b45854b449d363494b +TextureImporter: + fileIDToRecycleName: {} + externalObjects: {} + serializedVersion: 9 + mipmaps: + mipMapMode: 0 + enableMipMap: 0 + sRGBTexture: 1 + linearTexture: 0 + fadeOut: 0 + borderMipMap: 0 + mipMapsPreserveCoverage: 0 + alphaTestReferenceValue: 0.5 + mipMapFadeDistanceStart: 1 + mipMapFadeDistanceEnd: 3 + bumpmap: + convertToNormalMap: 0 + externalNormalMap: 0 + heightScale: 0.25 + normalMapFilter: 0 + isReadable: 0 + streamingMipmaps: 0 + streamingMipmapsPriority: 0 + grayScaleToAlpha: 0 + generateCubemap: 6 + cubemapConvolution: 0 + seamlessCubemap: 0 + textureFormat: 1 + maxTextureSize: 2048 + textureSettings: + serializedVersion: 2 + filterMode: 0 + aniso: 1 + mipBias: -100 + wrapU: 1 + wrapV: 1 + wrapW: 1 + nPOTScale: 0 + lightmap: 0 + compressionQuality: 50 + spriteMode: 0 + spriteExtrude: 1 + spriteMeshType: 1 + alignment: 0 + spritePivot: {x: 0.5, y: 0.5} + spritePixelsToUnits: 100 + spriteBorder: {x: 0, y: 0, z: 0, w: 0} + spriteGenerateFallbackPhysicsShape: 1 + alphaUsage: 1 + alphaIsTransparency: 1 + spriteTessellationDetail: -1 + textureType: 2 + textureShape: 1 + singleChannelComponent: 0 + maxTextureSizeSet: 0 + compressionQualitySet: 0 + textureFormatSet: 0 + platformSettings: + - serializedVersion: 2 + buildTarget: DefaultTexturePlatform + maxTextureSize: 2048 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 0 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + androidETC2FallbackOverride: 0 + - serializedVersion: 2 + buildTarget: Standalone + maxTextureSize: 2048 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 0 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + androidETC2FallbackOverride: 0 + - serializedVersion: 2 + buildTarget: WebGL + maxTextureSize: 2048 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 0 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + androidETC2FallbackOverride: 0 + spriteSheet: + serializedVersion: 2 + sprites: [] + outline: [] + physicsShape: [] + bones: [] + spriteID: + vertices: [] + indices: + edges: [] + weights: [] + spritePackingTag: + pSDRemoveMatte: 0 + pSDShowRemoveMatteOption: 0 + userData: + assetBundleName: + assetBundleVariant: diff --git a/LocalPackages/net.peeweek.gameplay-ingredients/Icons/Actions/ic-action-audio.png b/LocalPackages/net.peeweek.gameplay-ingredients/Icons/Actions/ic-action-audio.png new file mode 100644 index 0000000..4beadec --- /dev/null +++ b/LocalPackages/net.peeweek.gameplay-ingredients/Icons/Actions/ic-action-audio.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:4f32e29bb9d7853e3fb6b41a721ad4e779bc6a6515aee052d14bf13d80727120 +size 566 diff --git a/LocalPackages/net.peeweek.gameplay-ingredients/Icons/Actions/ic-action-audio.png.meta b/LocalPackages/net.peeweek.gameplay-ingredients/Icons/Actions/ic-action-audio.png.meta new file mode 100644 index 0000000..bbf8a5d --- /dev/null +++ b/LocalPackages/net.peeweek.gameplay-ingredients/Icons/Actions/ic-action-audio.png.meta @@ -0,0 +1,110 @@ +fileFormatVersion: 2 +guid: bdcc63f36a8ac6643bbfb90bb398716a +TextureImporter: + fileIDToRecycleName: {} + externalObjects: {} + serializedVersion: 9 + mipmaps: + mipMapMode: 0 + enableMipMap: 0 + sRGBTexture: 1 + linearTexture: 0 + fadeOut: 0 + borderMipMap: 0 + mipMapsPreserveCoverage: 0 + alphaTestReferenceValue: 0.5 + mipMapFadeDistanceStart: 1 + mipMapFadeDistanceEnd: 3 + bumpmap: + convertToNormalMap: 0 + externalNormalMap: 0 + heightScale: 0.25 + normalMapFilter: 0 + isReadable: 0 + streamingMipmaps: 0 + streamingMipmapsPriority: 0 + grayScaleToAlpha: 0 + generateCubemap: 6 + cubemapConvolution: 0 + seamlessCubemap: 0 + textureFormat: 1 + maxTextureSize: 2048 + textureSettings: + serializedVersion: 2 + filterMode: 0 + aniso: 1 + mipBias: -100 + wrapU: 1 + wrapV: 1 + wrapW: 1 + nPOTScale: 0 + lightmap: 0 + compressionQuality: 50 + spriteMode: 0 + spriteExtrude: 1 + spriteMeshType: 1 + alignment: 0 + spritePivot: {x: 0.5, y: 0.5} + spritePixelsToUnits: 100 + spriteBorder: {x: 0, y: 0, z: 0, w: 0} + spriteGenerateFallbackPhysicsShape: 1 + alphaUsage: 1 + alphaIsTransparency: 1 + spriteTessellationDetail: -1 + textureType: 2 + textureShape: 1 + singleChannelComponent: 0 + maxTextureSizeSet: 0 + compressionQualitySet: 0 + textureFormatSet: 0 + platformSettings: + - serializedVersion: 2 + buildTarget: DefaultTexturePlatform + maxTextureSize: 2048 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 0 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + androidETC2FallbackOverride: 0 + - serializedVersion: 2 + buildTarget: Standalone + maxTextureSize: 2048 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 0 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + androidETC2FallbackOverride: 0 + - serializedVersion: 2 + buildTarget: WebGL + maxTextureSize: 2048 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 0 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + androidETC2FallbackOverride: 0 + spriteSheet: + serializedVersion: 2 + sprites: [] + outline: [] + physicsShape: [] + bones: [] + spriteID: + vertices: [] + indices: + edges: [] + weights: [] + spritePackingTag: + pSDRemoveMatte: 0 + pSDShowRemoveMatteOption: 0 + userData: + assetBundleName: + assetBundleVariant: diff --git a/LocalPackages/net.peeweek.gameplay-ingredients/Icons/Actions/ic-action-director.png b/LocalPackages/net.peeweek.gameplay-ingredients/Icons/Actions/ic-action-director.png new file mode 100644 index 0000000..2943ae4 --- /dev/null +++ b/LocalPackages/net.peeweek.gameplay-ingredients/Icons/Actions/ic-action-director.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:94c4064376e35f1550ae701d15da7fbe025f75f3f24f9eb0698cfb022e26e14b +size 654 diff --git a/LocalPackages/net.peeweek.gameplay-ingredients/Icons/Actions/ic-action-director.png.meta b/LocalPackages/net.peeweek.gameplay-ingredients/Icons/Actions/ic-action-director.png.meta new file mode 100644 index 0000000..ae451b6 --- /dev/null +++ b/LocalPackages/net.peeweek.gameplay-ingredients/Icons/Actions/ic-action-director.png.meta @@ -0,0 +1,101 @@ +fileFormatVersion: 2 +guid: 159806d978e00114cb2b1e43dff3d48c +TextureImporter: + internalIDToNameTable: [] + externalObjects: {} + serializedVersion: 10 + mipmaps: + mipMapMode: 0 + enableMipMap: 0 + sRGBTexture: 1 + linearTexture: 0 + fadeOut: 0 + borderMipMap: 0 + mipMapsPreserveCoverage: 0 + alphaTestReferenceValue: 0.5 + mipMapFadeDistanceStart: 1 + mipMapFadeDistanceEnd: 3 + bumpmap: + convertToNormalMap: 0 + externalNormalMap: 0 + heightScale: 0.25 + normalMapFilter: 0 + isReadable: 0 + streamingMipmaps: 0 + streamingMipmapsPriority: 0 + grayScaleToAlpha: 0 + generateCubemap: 6 + cubemapConvolution: 0 + seamlessCubemap: 0 + textureFormat: 1 + maxTextureSize: 2048 + textureSettings: + serializedVersion: 2 + filterMode: -1 + aniso: 1 + mipBias: -100 + wrapU: 1 + wrapV: 1 + wrapW: -1 + nPOTScale: 0 + lightmap: 0 + compressionQuality: 50 + spriteMode: 0 + spriteExtrude: 1 + spriteMeshType: 1 + alignment: 0 + spritePivot: {x: 0.5, y: 0.5} + spritePixelsToUnits: 100 + spriteBorder: {x: 0, y: 0, z: 0, w: 0} + spriteGenerateFallbackPhysicsShape: 1 + alphaUsage: 1 + alphaIsTransparency: 1 + spriteTessellationDetail: -1 + textureType: 2 + textureShape: 1 + singleChannelComponent: 0 + maxTextureSizeSet: 0 + compressionQualitySet: 0 + textureFormatSet: 0 + platformSettings: + - serializedVersion: 2 + buildTarget: DefaultTexturePlatform + maxTextureSize: 2048 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 0 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + androidETC2FallbackOverride: 0 + - serializedVersion: 2 + buildTarget: Standalone + maxTextureSize: 2048 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 0 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + androidETC2FallbackOverride: 0 + spriteSheet: + serializedVersion: 2 + sprites: [] + outline: [] + physicsShape: [] + bones: [] + spriteID: + internalID: 0 + vertices: [] + indices: + edges: [] + weights: [] + secondaryTextures: [] + spritePackingTag: + pSDRemoveMatte: 0 + pSDShowRemoveMatteOption: 0 + userData: + assetBundleName: + assetBundleVariant: diff --git a/LocalPackages/net.peeweek.gameplay-ingredients/Icons/Actions/ic-action-event.png b/LocalPackages/net.peeweek.gameplay-ingredients/Icons/Actions/ic-action-event.png new file mode 100644 index 0000000..245d337 --- /dev/null +++ b/LocalPackages/net.peeweek.gameplay-ingredients/Icons/Actions/ic-action-event.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:d75066dba3dc4b7eec9ad5551997059d4d5ac5d4b257dd65e0480fda60d75566 +size 764 diff --git a/LocalPackages/net.peeweek.gameplay-ingredients/Icons/Actions/ic-action-event.png.meta b/LocalPackages/net.peeweek.gameplay-ingredients/Icons/Actions/ic-action-event.png.meta new file mode 100644 index 0000000..b668a74 --- /dev/null +++ b/LocalPackages/net.peeweek.gameplay-ingredients/Icons/Actions/ic-action-event.png.meta @@ -0,0 +1,110 @@ +fileFormatVersion: 2 +guid: 5c4fb08bfbc3da848b42e663f823b47e +TextureImporter: + fileIDToRecycleName: {} + externalObjects: {} + serializedVersion: 9 + mipmaps: + mipMapMode: 0 + enableMipMap: 0 + sRGBTexture: 1 + linearTexture: 0 + fadeOut: 0 + borderMipMap: 0 + mipMapsPreserveCoverage: 0 + alphaTestReferenceValue: 0.5 + mipMapFadeDistanceStart: 1 + mipMapFadeDistanceEnd: 3 + bumpmap: + convertToNormalMap: 0 + externalNormalMap: 0 + heightScale: 0.25 + normalMapFilter: 0 + isReadable: 0 + streamingMipmaps: 0 + streamingMipmapsPriority: 0 + grayScaleToAlpha: 0 + generateCubemap: 6 + cubemapConvolution: 0 + seamlessCubemap: 0 + textureFormat: 1 + maxTextureSize: 2048 + textureSettings: + serializedVersion: 2 + filterMode: 0 + aniso: 1 + mipBias: -100 + wrapU: 1 + wrapV: 1 + wrapW: 1 + nPOTScale: 0 + lightmap: 0 + compressionQuality: 50 + spriteMode: 0 + spriteExtrude: 1 + spriteMeshType: 1 + alignment: 0 + spritePivot: {x: 0.5, y: 0.5} + spritePixelsToUnits: 100 + spriteBorder: {x: 0, y: 0, z: 0, w: 0} + spriteGenerateFallbackPhysicsShape: 1 + alphaUsage: 1 + alphaIsTransparency: 1 + spriteTessellationDetail: -1 + textureType: 2 + textureShape: 1 + singleChannelComponent: 0 + maxTextureSizeSet: 0 + compressionQualitySet: 0 + textureFormatSet: 0 + platformSettings: + - serializedVersion: 2 + buildTarget: DefaultTexturePlatform + maxTextureSize: 2048 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 0 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + androidETC2FallbackOverride: 0 + - serializedVersion: 2 + buildTarget: Standalone + maxTextureSize: 2048 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 0 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + androidETC2FallbackOverride: 0 + - serializedVersion: 2 + buildTarget: WebGL + maxTextureSize: 2048 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 0 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + androidETC2FallbackOverride: 0 + spriteSheet: + serializedVersion: 2 + sprites: [] + outline: [] + physicsShape: [] + bones: [] + spriteID: + vertices: [] + indices: + edges: [] + weights: [] + spritePackingTag: + pSDRemoveMatte: 0 + pSDShowRemoveMatteOption: 0 + userData: + assetBundleName: + assetBundleVariant: diff --git a/LocalPackages/net.peeweek.gameplay-ingredients/Icons/Actions/ic-action-exit.png b/LocalPackages/net.peeweek.gameplay-ingredients/Icons/Actions/ic-action-exit.png new file mode 100644 index 0000000..26f00e5 --- /dev/null +++ b/LocalPackages/net.peeweek.gameplay-ingredients/Icons/Actions/ic-action-exit.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:ecdd7f136c3ca28a7a9e3897b8ccd4fc0f3f0eb25936cff22d1fcd37fb758d42 +size 660 diff --git a/LocalPackages/net.peeweek.gameplay-ingredients/Icons/Actions/ic-action-exit.png.meta b/LocalPackages/net.peeweek.gameplay-ingredients/Icons/Actions/ic-action-exit.png.meta new file mode 100644 index 0000000..cf79f4e --- /dev/null +++ b/LocalPackages/net.peeweek.gameplay-ingredients/Icons/Actions/ic-action-exit.png.meta @@ -0,0 +1,110 @@ +fileFormatVersion: 2 +guid: d8d829f83095c314fa81326a7695d5df +TextureImporter: + fileIDToRecycleName: {} + externalObjects: {} + serializedVersion: 9 + mipmaps: + mipMapMode: 0 + enableMipMap: 0 + sRGBTexture: 1 + linearTexture: 0 + fadeOut: 0 + borderMipMap: 0 + mipMapsPreserveCoverage: 0 + alphaTestReferenceValue: 0.5 + mipMapFadeDistanceStart: 1 + mipMapFadeDistanceEnd: 3 + bumpmap: + convertToNormalMap: 0 + externalNormalMap: 0 + heightScale: 0.25 + normalMapFilter: 0 + isReadable: 0 + streamingMipmaps: 0 + streamingMipmapsPriority: 0 + grayScaleToAlpha: 0 + generateCubemap: 6 + cubemapConvolution: 0 + seamlessCubemap: 0 + textureFormat: 1 + maxTextureSize: 2048 + textureSettings: + serializedVersion: 2 + filterMode: 0 + aniso: 1 + mipBias: -100 + wrapU: 1 + wrapV: 1 + wrapW: 1 + nPOTScale: 0 + lightmap: 0 + compressionQuality: 50 + spriteMode: 0 + spriteExtrude: 1 + spriteMeshType: 1 + alignment: 0 + spritePivot: {x: 0.5, y: 0.5} + spritePixelsToUnits: 100 + spriteBorder: {x: 0, y: 0, z: 0, w: 0} + spriteGenerateFallbackPhysicsShape: 1 + alphaUsage: 1 + alphaIsTransparency: 1 + spriteTessellationDetail: -1 + textureType: 2 + textureShape: 1 + singleChannelComponent: 0 + maxTextureSizeSet: 0 + compressionQualitySet: 0 + textureFormatSet: 0 + platformSettings: + - serializedVersion: 2 + buildTarget: DefaultTexturePlatform + maxTextureSize: 2048 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 0 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + androidETC2FallbackOverride: 0 + - serializedVersion: 2 + buildTarget: Standalone + maxTextureSize: 2048 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 0 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + androidETC2FallbackOverride: 0 + - serializedVersion: 2 + buildTarget: WebGL + maxTextureSize: 2048 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 0 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + androidETC2FallbackOverride: 0 + spriteSheet: + serializedVersion: 2 + sprites: [] + outline: [] + physicsShape: [] + bones: [] + spriteID: + vertices: [] + indices: + edges: [] + weights: [] + spritePackingTag: + pSDRemoveMatte: 0 + pSDShowRemoveMatteOption: 0 + userData: + assetBundleName: + assetBundleVariant: diff --git a/LocalPackages/net.peeweek.gameplay-ingredients/Icons/Actions/ic-action-generic.png b/LocalPackages/net.peeweek.gameplay-ingredients/Icons/Actions/ic-action-generic.png new file mode 100644 index 0000000..23b1e0f --- /dev/null +++ b/LocalPackages/net.peeweek.gameplay-ingredients/Icons/Actions/ic-action-generic.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:de69f2c619068afe52d818cd19e93c2b1e594f5dbff4125ae0d45bbd7b91f231 +size 669 diff --git a/LocalPackages/net.peeweek.gameplay-ingredients/Icons/Actions/ic-action-generic.png.meta b/LocalPackages/net.peeweek.gameplay-ingredients/Icons/Actions/ic-action-generic.png.meta new file mode 100644 index 0000000..c216dca --- /dev/null +++ b/LocalPackages/net.peeweek.gameplay-ingredients/Icons/Actions/ic-action-generic.png.meta @@ -0,0 +1,110 @@ +fileFormatVersion: 2 +guid: 68fdae855e346504b8884bfb6d7756cd +TextureImporter: + fileIDToRecycleName: {} + externalObjects: {} + serializedVersion: 9 + mipmaps: + mipMapMode: 0 + enableMipMap: 0 + sRGBTexture: 1 + linearTexture: 0 + fadeOut: 0 + borderMipMap: 0 + mipMapsPreserveCoverage: 0 + alphaTestReferenceValue: 0.5 + mipMapFadeDistanceStart: 1 + mipMapFadeDistanceEnd: 3 + bumpmap: + convertToNormalMap: 0 + externalNormalMap: 0 + heightScale: 0.25 + normalMapFilter: 0 + isReadable: 0 + streamingMipmaps: 0 + streamingMipmapsPriority: 0 + grayScaleToAlpha: 0 + generateCubemap: 6 + cubemapConvolution: 0 + seamlessCubemap: 0 + textureFormat: 1 + maxTextureSize: 2048 + textureSettings: + serializedVersion: 2 + filterMode: 0 + aniso: 1 + mipBias: -100 + wrapU: 1 + wrapV: 1 + wrapW: 1 + nPOTScale: 0 + lightmap: 0 + compressionQuality: 50 + spriteMode: 0 + spriteExtrude: 1 + spriteMeshType: 1 + alignment: 0 + spritePivot: {x: 0.5, y: 0.5} + spritePixelsToUnits: 100 + spriteBorder: {x: 0, y: 0, z: 0, w: 0} + spriteGenerateFallbackPhysicsShape: 1 + alphaUsage: 1 + alphaIsTransparency: 1 + spriteTessellationDetail: -1 + textureType: 2 + textureShape: 1 + singleChannelComponent: 0 + maxTextureSizeSet: 0 + compressionQualitySet: 0 + textureFormatSet: 0 + platformSettings: + - serializedVersion: 2 + buildTarget: DefaultTexturePlatform + maxTextureSize: 2048 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 0 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + androidETC2FallbackOverride: 0 + - serializedVersion: 2 + buildTarget: Standalone + maxTextureSize: 2048 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 0 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + androidETC2FallbackOverride: 0 + - serializedVersion: 2 + buildTarget: WebGL + maxTextureSize: 2048 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 0 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + androidETC2FallbackOverride: 0 + spriteSheet: + serializedVersion: 2 + sprites: [] + outline: [] + physicsShape: [] + bones: [] + spriteID: + vertices: [] + indices: + edges: [] + weights: [] + spritePackingTag: + pSDRemoveMatte: 0 + pSDShowRemoveMatteOption: 0 + userData: + assetBundleName: + assetBundleVariant: diff --git a/LocalPackages/net.peeweek.gameplay-ingredients/Icons/Actions/ic-action-list.png b/LocalPackages/net.peeweek.gameplay-ingredients/Icons/Actions/ic-action-list.png new file mode 100644 index 0000000..b5be593 --- /dev/null +++ b/LocalPackages/net.peeweek.gameplay-ingredients/Icons/Actions/ic-action-list.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:4f2367d88c5b4b04e6baafa5cbed8e38181752dc63b802970431f90445221475 +size 685 diff --git a/LocalPackages/net.peeweek.gameplay-ingredients/Icons/Actions/ic-action-list.png.meta b/LocalPackages/net.peeweek.gameplay-ingredients/Icons/Actions/ic-action-list.png.meta new file mode 100644 index 0000000..5622bb9 --- /dev/null +++ b/LocalPackages/net.peeweek.gameplay-ingredients/Icons/Actions/ic-action-list.png.meta @@ -0,0 +1,110 @@ +fileFormatVersion: 2 +guid: 225c53326635b1748868c470ea1bccce +TextureImporter: + fileIDToRecycleName: {} + externalObjects: {} + serializedVersion: 9 + mipmaps: + mipMapMode: 0 + enableMipMap: 0 + sRGBTexture: 1 + linearTexture: 0 + fadeOut: 0 + borderMipMap: 0 + mipMapsPreserveCoverage: 0 + alphaTestReferenceValue: 0.5 + mipMapFadeDistanceStart: 1 + mipMapFadeDistanceEnd: 3 + bumpmap: + convertToNormalMap: 0 + externalNormalMap: 0 + heightScale: 0.25 + normalMapFilter: 0 + isReadable: 0 + streamingMipmaps: 0 + streamingMipmapsPriority: 0 + grayScaleToAlpha: 0 + generateCubemap: 6 + cubemapConvolution: 0 + seamlessCubemap: 0 + textureFormat: 1 + maxTextureSize: 2048 + textureSettings: + serializedVersion: 2 + filterMode: 0 + aniso: 1 + mipBias: -100 + wrapU: 1 + wrapV: 1 + wrapW: 1 + nPOTScale: 0 + lightmap: 0 + compressionQuality: 50 + spriteMode: 0 + spriteExtrude: 1 + spriteMeshType: 1 + alignment: 0 + spritePivot: {x: 0.5, y: 0.5} + spritePixelsToUnits: 100 + spriteBorder: {x: 0, y: 0, z: 0, w: 0} + spriteGenerateFallbackPhysicsShape: 1 + alphaUsage: 1 + alphaIsTransparency: 1 + spriteTessellationDetail: -1 + textureType: 2 + textureShape: 1 + singleChannelComponent: 0 + maxTextureSizeSet: 0 + compressionQualitySet: 0 + textureFormatSet: 0 + platformSettings: + - serializedVersion: 2 + buildTarget: DefaultTexturePlatform + maxTextureSize: 2048 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 0 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + androidETC2FallbackOverride: 0 + - serializedVersion: 2 + buildTarget: Standalone + maxTextureSize: 2048 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 0 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + androidETC2FallbackOverride: 0 + - serializedVersion: 2 + buildTarget: WebGL + maxTextureSize: 2048 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 0 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + androidETC2FallbackOverride: 0 + spriteSheet: + serializedVersion: 2 + sprites: [] + outline: [] + physicsShape: [] + bones: [] + spriteID: + vertices: [] + indices: + edges: [] + weights: [] + spritePackingTag: + pSDRemoveMatte: 0 + pSDShowRemoveMatteOption: 0 + userData: + assetBundleName: + assetBundleVariant: diff --git a/LocalPackages/net.peeweek.gameplay-ingredients/Icons/Actions/ic-action-log.png b/LocalPackages/net.peeweek.gameplay-ingredients/Icons/Actions/ic-action-log.png new file mode 100644 index 0000000..e4eff35 --- /dev/null +++ b/LocalPackages/net.peeweek.gameplay-ingredients/Icons/Actions/ic-action-log.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:56fe73eea8592f09a1fb200dc4e51b7da52890bd019dfaef556d8f863bb35ad8 +size 492 diff --git a/LocalPackages/net.peeweek.gameplay-ingredients/Icons/Actions/ic-action-log.png.meta b/LocalPackages/net.peeweek.gameplay-ingredients/Icons/Actions/ic-action-log.png.meta new file mode 100644 index 0000000..e5a25bb --- /dev/null +++ b/LocalPackages/net.peeweek.gameplay-ingredients/Icons/Actions/ic-action-log.png.meta @@ -0,0 +1,101 @@ +fileFormatVersion: 2 +guid: 995bed5518fc03b4189519d1762eed5b +TextureImporter: + internalIDToNameTable: [] + externalObjects: {} + serializedVersion: 10 + mipmaps: + mipMapMode: 0 + enableMipMap: 0 + sRGBTexture: 1 + linearTexture: 0 + fadeOut: 0 + borderMipMap: 0 + mipMapsPreserveCoverage: 0 + alphaTestReferenceValue: 0.5 + mipMapFadeDistanceStart: 1 + mipMapFadeDistanceEnd: 3 + bumpmap: + convertToNormalMap: 0 + externalNormalMap: 0 + heightScale: 0.25 + normalMapFilter: 0 + isReadable: 0 + streamingMipmaps: 0 + streamingMipmapsPriority: 0 + grayScaleToAlpha: 0 + generateCubemap: 6 + cubemapConvolution: 0 + seamlessCubemap: 0 + textureFormat: 1 + maxTextureSize: 2048 + textureSettings: + serializedVersion: 2 + filterMode: -1 + aniso: 1 + mipBias: -100 + wrapU: 1 + wrapV: 1 + wrapW: -1 + nPOTScale: 0 + lightmap: 0 + compressionQuality: 50 + spriteMode: 0 + spriteExtrude: 1 + spriteMeshType: 1 + alignment: 0 + spritePivot: {x: 0.5, y: 0.5} + spritePixelsToUnits: 100 + spriteBorder: {x: 0, y: 0, z: 0, w: 0} + spriteGenerateFallbackPhysicsShape: 1 + alphaUsage: 1 + alphaIsTransparency: 1 + spriteTessellationDetail: -1 + textureType: 2 + textureShape: 1 + singleChannelComponent: 0 + maxTextureSizeSet: 0 + compressionQualitySet: 0 + textureFormatSet: 0 + platformSettings: + - serializedVersion: 2 + buildTarget: DefaultTexturePlatform + maxTextureSize: 2048 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 0 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + androidETC2FallbackOverride: 0 + - serializedVersion: 2 + buildTarget: Standalone + maxTextureSize: 2048 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 0 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + androidETC2FallbackOverride: 0 + spriteSheet: + serializedVersion: 2 + sprites: [] + outline: [] + physicsShape: [] + bones: [] + spriteID: + internalID: 0 + vertices: [] + indices: + edges: [] + weights: [] + secondaryTextures: [] + spritePackingTag: + pSDRemoveMatte: 0 + pSDShowRemoveMatteOption: 0 + userData: + assetBundleName: + assetBundleVariant: diff --git a/LocalPackages/net.peeweek.gameplay-ingredients/Icons/Actions/ic-action-message.png b/LocalPackages/net.peeweek.gameplay-ingredients/Icons/Actions/ic-action-message.png new file mode 100644 index 0000000..1c2ca76 --- /dev/null +++ b/LocalPackages/net.peeweek.gameplay-ingredients/Icons/Actions/ic-action-message.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:95532c2cffc01eb21d5f4329925ae21b2125ff8c57100c660232f0a81dfc7e65 +size 692 diff --git a/LocalPackages/net.peeweek.gameplay-ingredients/Icons/Actions/ic-action-message.png.meta b/LocalPackages/net.peeweek.gameplay-ingredients/Icons/Actions/ic-action-message.png.meta new file mode 100644 index 0000000..4d8a6fd --- /dev/null +++ b/LocalPackages/net.peeweek.gameplay-ingredients/Icons/Actions/ic-action-message.png.meta @@ -0,0 +1,110 @@ +fileFormatVersion: 2 +guid: 60943dcd3a3663942942cf1f0dce3c11 +TextureImporter: + fileIDToRecycleName: {} + externalObjects: {} + serializedVersion: 9 + mipmaps: + mipMapMode: 0 + enableMipMap: 0 + sRGBTexture: 1 + linearTexture: 0 + fadeOut: 0 + borderMipMap: 0 + mipMapsPreserveCoverage: 0 + alphaTestReferenceValue: 0.5 + mipMapFadeDistanceStart: 1 + mipMapFadeDistanceEnd: 3 + bumpmap: + convertToNormalMap: 0 + externalNormalMap: 0 + heightScale: 0.25 + normalMapFilter: 0 + isReadable: 0 + streamingMipmaps: 0 + streamingMipmapsPriority: 0 + grayScaleToAlpha: 0 + generateCubemap: 6 + cubemapConvolution: 0 + seamlessCubemap: 0 + textureFormat: 1 + maxTextureSize: 2048 + textureSettings: + serializedVersion: 2 + filterMode: 0 + aniso: 1 + mipBias: -100 + wrapU: 1 + wrapV: 1 + wrapW: 1 + nPOTScale: 0 + lightmap: 0 + compressionQuality: 50 + spriteMode: 0 + spriteExtrude: 1 + spriteMeshType: 1 + alignment: 0 + spritePivot: {x: 0.5, y: 0.5} + spritePixelsToUnits: 100 + spriteBorder: {x: 0, y: 0, z: 0, w: 0} + spriteGenerateFallbackPhysicsShape: 1 + alphaUsage: 1 + alphaIsTransparency: 1 + spriteTessellationDetail: -1 + textureType: 2 + textureShape: 1 + singleChannelComponent: 0 + maxTextureSizeSet: 0 + compressionQualitySet: 0 + textureFormatSet: 0 + platformSettings: + - serializedVersion: 2 + buildTarget: DefaultTexturePlatform + maxTextureSize: 2048 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 0 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + androidETC2FallbackOverride: 0 + - serializedVersion: 2 + buildTarget: Standalone + maxTextureSize: 2048 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 0 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + androidETC2FallbackOverride: 0 + - serializedVersion: 2 + buildTarget: WebGL + maxTextureSize: 2048 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 0 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + androidETC2FallbackOverride: 0 + spriteSheet: + serializedVersion: 2 + sprites: [] + outline: [] + physicsShape: [] + bones: [] + spriteID: + vertices: [] + indices: + edges: [] + weights: [] + spritePackingTag: + pSDRemoveMatte: 0 + pSDShowRemoveMatteOption: 0 + userData: + assetBundleName: + assetBundleVariant: diff --git a/LocalPackages/net.peeweek.gameplay-ingredients/Icons/Actions/ic-action-mouse.png b/LocalPackages/net.peeweek.gameplay-ingredients/Icons/Actions/ic-action-mouse.png new file mode 100644 index 0000000..5ec92cd --- /dev/null +++ b/LocalPackages/net.peeweek.gameplay-ingredients/Icons/Actions/ic-action-mouse.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:b12553bee593e845e113bd6cffb6b85df4249fd907e417b73a9dbfd55185bf1d +size 661 diff --git a/LocalPackages/net.peeweek.gameplay-ingredients/Icons/Actions/ic-action-mouse.png.meta b/LocalPackages/net.peeweek.gameplay-ingredients/Icons/Actions/ic-action-mouse.png.meta new file mode 100644 index 0000000..ac6e768 --- /dev/null +++ b/LocalPackages/net.peeweek.gameplay-ingredients/Icons/Actions/ic-action-mouse.png.meta @@ -0,0 +1,110 @@ +fileFormatVersion: 2 +guid: ba45de1ff09adbf459f4db4bf50a8c14 +TextureImporter: + fileIDToRecycleName: {} + externalObjects: {} + serializedVersion: 9 + mipmaps: + mipMapMode: 0 + enableMipMap: 0 + sRGBTexture: 1 + linearTexture: 0 + fadeOut: 0 + borderMipMap: 0 + mipMapsPreserveCoverage: 0 + alphaTestReferenceValue: 0.5 + mipMapFadeDistanceStart: 1 + mipMapFadeDistanceEnd: 3 + bumpmap: + convertToNormalMap: 0 + externalNormalMap: 0 + heightScale: 0.25 + normalMapFilter: 0 + isReadable: 0 + streamingMipmaps: 0 + streamingMipmapsPriority: 0 + grayScaleToAlpha: 0 + generateCubemap: 6 + cubemapConvolution: 0 + seamlessCubemap: 0 + textureFormat: 1 + maxTextureSize: 2048 + textureSettings: + serializedVersion: 2 + filterMode: 0 + aniso: 1 + mipBias: -100 + wrapU: 1 + wrapV: 1 + wrapW: 1 + nPOTScale: 0 + lightmap: 0 + compressionQuality: 50 + spriteMode: 0 + spriteExtrude: 1 + spriteMeshType: 1 + alignment: 0 + spritePivot: {x: 0.5, y: 0.5} + spritePixelsToUnits: 100 + spriteBorder: {x: 0, y: 0, z: 0, w: 0} + spriteGenerateFallbackPhysicsShape: 1 + alphaUsage: 1 + alphaIsTransparency: 1 + spriteTessellationDetail: -1 + textureType: 2 + textureShape: 1 + singleChannelComponent: 0 + maxTextureSizeSet: 0 + compressionQualitySet: 0 + textureFormatSet: 0 + platformSettings: + - serializedVersion: 2 + buildTarget: DefaultTexturePlatform + maxTextureSize: 2048 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 0 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + androidETC2FallbackOverride: 0 + - serializedVersion: 2 + buildTarget: Standalone + maxTextureSize: 2048 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 0 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + androidETC2FallbackOverride: 0 + - serializedVersion: 2 + buildTarget: WebGL + maxTextureSize: 2048 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 0 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + androidETC2FallbackOverride: 0 + spriteSheet: + serializedVersion: 2 + sprites: [] + outline: [] + physicsShape: [] + bones: [] + spriteID: + vertices: [] + indices: + edges: [] + weights: [] + spritePackingTag: + pSDRemoveMatte: 0 + pSDShowRemoveMatteOption: 0 + userData: + assetBundleName: + assetBundleVariant: diff --git a/LocalPackages/net.peeweek.gameplay-ingredients/Icons/Actions/ic-action-rigidbody.png b/LocalPackages/net.peeweek.gameplay-ingredients/Icons/Actions/ic-action-rigidbody.png new file mode 100644 index 0000000..6728e4c --- /dev/null +++ b/LocalPackages/net.peeweek.gameplay-ingredients/Icons/Actions/ic-action-rigidbody.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:312ba53e6e6293481af7531fe6ef4dfb1e8587de4701e48791f3802b7c73a259 +size 814 diff --git a/LocalPackages/net.peeweek.gameplay-ingredients/Icons/Actions/ic-action-rigidbody.png.meta b/LocalPackages/net.peeweek.gameplay-ingredients/Icons/Actions/ic-action-rigidbody.png.meta new file mode 100644 index 0000000..85523e1 --- /dev/null +++ b/LocalPackages/net.peeweek.gameplay-ingredients/Icons/Actions/ic-action-rigidbody.png.meta @@ -0,0 +1,103 @@ +fileFormatVersion: 2 +guid: 156c6b396de456546beacc0bd53b6e07 +TextureImporter: + internalIDToNameTable: [] + externalObjects: {} + serializedVersion: 10 + mipmaps: + mipMapMode: 0 + enableMipMap: 0 + sRGBTexture: 1 + linearTexture: 0 + fadeOut: 0 + borderMipMap: 0 + mipMapsPreserveCoverage: 0 + alphaTestReferenceValue: 0.5 + mipMapFadeDistanceStart: 1 + mipMapFadeDistanceEnd: 3 + bumpmap: + convertToNormalMap: 0 + externalNormalMap: 0 + heightScale: 0.25 + normalMapFilter: 0 + isReadable: 0 + streamingMipmaps: 0 + streamingMipmapsPriority: 0 + grayScaleToAlpha: 0 + generateCubemap: 6 + cubemapConvolution: 0 + seamlessCubemap: 0 + textureFormat: 1 + maxTextureSize: 2048 + textureSettings: + serializedVersion: 2 + filterMode: -1 + aniso: 1 + mipBias: -100 + wrapU: 1 + wrapV: 1 + wrapW: -1 + nPOTScale: 0 + lightmap: 0 + compressionQuality: 50 + spriteMode: 0 + spriteExtrude: 1 + spriteMeshType: 1 + alignment: 0 + spritePivot: {x: 0.5, y: 0.5} + spritePixelsToUnits: 100 + spriteBorder: {x: 0, y: 0, z: 0, w: 0} + spriteGenerateFallbackPhysicsShape: 1 + alphaUsage: 1 + alphaIsTransparency: 1 + spriteTessellationDetail: -1 + textureType: 2 + textureShape: 1 + singleChannelComponent: 0 + maxTextureSizeSet: 0 + compressionQualitySet: 0 + textureFormatSet: 0 + platformSettings: + - serializedVersion: 3 + buildTarget: DefaultTexturePlatform + maxTextureSize: 2048 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 0 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + androidETC2FallbackOverride: 0 + forceMaximumCompressionQuality_BC6H_BC7: 0 + - serializedVersion: 3 + buildTarget: Standalone + maxTextureSize: 2048 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 0 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + androidETC2FallbackOverride: 0 + forceMaximumCompressionQuality_BC6H_BC7: 0 + spriteSheet: + serializedVersion: 2 + sprites: [] + outline: [] + physicsShape: [] + bones: [] + spriteID: + internalID: 0 + vertices: [] + indices: + edges: [] + weights: [] + secondaryTextures: [] + spritePackingTag: + pSDRemoveMatte: 0 + pSDShowRemoveMatteOption: 0 + userData: + assetBundleName: + assetBundleVariant: diff --git a/LocalPackages/net.peeweek.gameplay-ingredients/Icons/Actions/ic-action-save.png b/LocalPackages/net.peeweek.gameplay-ingredients/Icons/Actions/ic-action-save.png new file mode 100644 index 0000000..287f8d6 --- /dev/null +++ b/LocalPackages/net.peeweek.gameplay-ingredients/Icons/Actions/ic-action-save.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:0dd85f9ad91acada6a0f832b1b2fd8220822b6a5b2a27565baf2eee76fb73b54 +size 507 diff --git a/LocalPackages/net.peeweek.gameplay-ingredients/Icons/Actions/ic-action-save.png.meta b/LocalPackages/net.peeweek.gameplay-ingredients/Icons/Actions/ic-action-save.png.meta new file mode 100644 index 0000000..d27ecea --- /dev/null +++ b/LocalPackages/net.peeweek.gameplay-ingredients/Icons/Actions/ic-action-save.png.meta @@ -0,0 +1,110 @@ +fileFormatVersion: 2 +guid: 02a5b6174ed64e24ea35c86a99568fcf +TextureImporter: + fileIDToRecycleName: {} + externalObjects: {} + serializedVersion: 9 + mipmaps: + mipMapMode: 0 + enableMipMap: 0 + sRGBTexture: 1 + linearTexture: 0 + fadeOut: 0 + borderMipMap: 0 + mipMapsPreserveCoverage: 0 + alphaTestReferenceValue: 0.5 + mipMapFadeDistanceStart: 1 + mipMapFadeDistanceEnd: 3 + bumpmap: + convertToNormalMap: 0 + externalNormalMap: 0 + heightScale: 0.25 + normalMapFilter: 0 + isReadable: 0 + streamingMipmaps: 0 + streamingMipmapsPriority: 0 + grayScaleToAlpha: 0 + generateCubemap: 6 + cubemapConvolution: 0 + seamlessCubemap: 0 + textureFormat: 1 + maxTextureSize: 2048 + textureSettings: + serializedVersion: 2 + filterMode: 0 + aniso: 1 + mipBias: -100 + wrapU: 1 + wrapV: 1 + wrapW: 1 + nPOTScale: 0 + lightmap: 0 + compressionQuality: 50 + spriteMode: 0 + spriteExtrude: 1 + spriteMeshType: 1 + alignment: 0 + spritePivot: {x: 0.5, y: 0.5} + spritePixelsToUnits: 100 + spriteBorder: {x: 0, y: 0, z: 0, w: 0} + spriteGenerateFallbackPhysicsShape: 1 + alphaUsage: 1 + alphaIsTransparency: 1 + spriteTessellationDetail: -1 + textureType: 2 + textureShape: 1 + singleChannelComponent: 0 + maxTextureSizeSet: 0 + compressionQualitySet: 0 + textureFormatSet: 0 + platformSettings: + - serializedVersion: 2 + buildTarget: DefaultTexturePlatform + maxTextureSize: 2048 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 0 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + androidETC2FallbackOverride: 0 + - serializedVersion: 2 + buildTarget: Standalone + maxTextureSize: 2048 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 0 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + androidETC2FallbackOverride: 0 + - serializedVersion: 2 + buildTarget: WebGL + maxTextureSize: 2048 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 0 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + androidETC2FallbackOverride: 0 + spriteSheet: + serializedVersion: 2 + sprites: [] + outline: [] + physicsShape: [] + bones: [] + spriteID: + vertices: [] + indices: + edges: [] + weights: [] + spritePackingTag: + pSDRemoveMatte: 0 + pSDShowRemoveMatteOption: 0 + userData: + assetBundleName: + assetBundleVariant: diff --git a/LocalPackages/net.peeweek.gameplay-ingredients/Icons/Actions/ic-action-screen.png b/LocalPackages/net.peeweek.gameplay-ingredients/Icons/Actions/ic-action-screen.png new file mode 100644 index 0000000..b4ad238 --- /dev/null +++ b/LocalPackages/net.peeweek.gameplay-ingredients/Icons/Actions/ic-action-screen.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:cbea7d178aa596df0979767b20f8f5e10fbbc6a6d06091b4cc986a0e7f95328b +size 545 diff --git a/LocalPackages/net.peeweek.gameplay-ingredients/Icons/Actions/ic-action-screen.png.meta b/LocalPackages/net.peeweek.gameplay-ingredients/Icons/Actions/ic-action-screen.png.meta new file mode 100644 index 0000000..cffc776 --- /dev/null +++ b/LocalPackages/net.peeweek.gameplay-ingredients/Icons/Actions/ic-action-screen.png.meta @@ -0,0 +1,110 @@ +fileFormatVersion: 2 +guid: 4112ad68bb67a9646acd12615491fc97 +TextureImporter: + fileIDToRecycleName: {} + externalObjects: {} + serializedVersion: 9 + mipmaps: + mipMapMode: 0 + enableMipMap: 0 + sRGBTexture: 1 + linearTexture: 0 + fadeOut: 0 + borderMipMap: 0 + mipMapsPreserveCoverage: 0 + alphaTestReferenceValue: 0.5 + mipMapFadeDistanceStart: 1 + mipMapFadeDistanceEnd: 3 + bumpmap: + convertToNormalMap: 0 + externalNormalMap: 0 + heightScale: 0.25 + normalMapFilter: 0 + isReadable: 0 + streamingMipmaps: 0 + streamingMipmapsPriority: 0 + grayScaleToAlpha: 0 + generateCubemap: 6 + cubemapConvolution: 0 + seamlessCubemap: 0 + textureFormat: 1 + maxTextureSize: 2048 + textureSettings: + serializedVersion: 2 + filterMode: 0 + aniso: 1 + mipBias: -100 + wrapU: 1 + wrapV: 1 + wrapW: 1 + nPOTScale: 0 + lightmap: 0 + compressionQuality: 50 + spriteMode: 0 + spriteExtrude: 1 + spriteMeshType: 1 + alignment: 0 + spritePivot: {x: 0.5, y: 0.5} + spritePixelsToUnits: 100 + spriteBorder: {x: 0, y: 0, z: 0, w: 0} + spriteGenerateFallbackPhysicsShape: 1 + alphaUsage: 1 + alphaIsTransparency: 1 + spriteTessellationDetail: -1 + textureType: 2 + textureShape: 1 + singleChannelComponent: 0 + maxTextureSizeSet: 0 + compressionQualitySet: 0 + textureFormatSet: 0 + platformSettings: + - serializedVersion: 2 + buildTarget: DefaultTexturePlatform + maxTextureSize: 2048 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 0 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + androidETC2FallbackOverride: 0 + - serializedVersion: 2 + buildTarget: Standalone + maxTextureSize: 2048 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 0 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + androidETC2FallbackOverride: 0 + - serializedVersion: 2 + buildTarget: WebGL + maxTextureSize: 2048 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 0 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + androidETC2FallbackOverride: 0 + spriteSheet: + serializedVersion: 2 + sprites: [] + outline: [] + physicsShape: [] + bones: [] + spriteID: + vertices: [] + indices: + edges: [] + weights: [] + spritePackingTag: + pSDRemoveMatte: 0 + pSDShowRemoveMatteOption: 0 + userData: + assetBundleName: + assetBundleVariant: diff --git a/LocalPackages/net.peeweek.gameplay-ingredients/Icons/Actions/ic-action-spawn.png b/LocalPackages/net.peeweek.gameplay-ingredients/Icons/Actions/ic-action-spawn.png new file mode 100644 index 0000000..5b612e0 --- /dev/null +++ b/LocalPackages/net.peeweek.gameplay-ingredients/Icons/Actions/ic-action-spawn.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:9d6893fe8dc3e047f0d12ab551609e176db7d6bbaf89439ea231abc30ee23aff +size 725 diff --git a/LocalPackages/net.peeweek.gameplay-ingredients/Icons/Actions/ic-action-spawn.png.meta b/LocalPackages/net.peeweek.gameplay-ingredients/Icons/Actions/ic-action-spawn.png.meta new file mode 100644 index 0000000..be68076 --- /dev/null +++ b/LocalPackages/net.peeweek.gameplay-ingredients/Icons/Actions/ic-action-spawn.png.meta @@ -0,0 +1,110 @@ +fileFormatVersion: 2 +guid: 1570e273fe0366a4aa86c010b052a9b9 +TextureImporter: + fileIDToRecycleName: {} + externalObjects: {} + serializedVersion: 9 + mipmaps: + mipMapMode: 0 + enableMipMap: 0 + sRGBTexture: 1 + linearTexture: 0 + fadeOut: 0 + borderMipMap: 0 + mipMapsPreserveCoverage: 0 + alphaTestReferenceValue: 0.5 + mipMapFadeDistanceStart: 1 + mipMapFadeDistanceEnd: 3 + bumpmap: + convertToNormalMap: 0 + externalNormalMap: 0 + heightScale: 0.25 + normalMapFilter: 0 + isReadable: 0 + streamingMipmaps: 0 + streamingMipmapsPriority: 0 + grayScaleToAlpha: 0 + generateCubemap: 6 + cubemapConvolution: 0 + seamlessCubemap: 0 + textureFormat: 1 + maxTextureSize: 2048 + textureSettings: + serializedVersion: 2 + filterMode: 0 + aniso: 1 + mipBias: -100 + wrapU: 1 + wrapV: 1 + wrapW: 1 + nPOTScale: 0 + lightmap: 0 + compressionQuality: 50 + spriteMode: 0 + spriteExtrude: 1 + spriteMeshType: 1 + alignment: 0 + spritePivot: {x: 0.5, y: 0.5} + spritePixelsToUnits: 100 + spriteBorder: {x: 0, y: 0, z: 0, w: 0} + spriteGenerateFallbackPhysicsShape: 1 + alphaUsage: 1 + alphaIsTransparency: 1 + spriteTessellationDetail: -1 + textureType: 2 + textureShape: 1 + singleChannelComponent: 0 + maxTextureSizeSet: 0 + compressionQualitySet: 0 + textureFormatSet: 0 + platformSettings: + - serializedVersion: 2 + buildTarget: DefaultTexturePlatform + maxTextureSize: 2048 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 0 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + androidETC2FallbackOverride: 0 + - serializedVersion: 2 + buildTarget: Standalone + maxTextureSize: 2048 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 0 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + androidETC2FallbackOverride: 0 + - serializedVersion: 2 + buildTarget: WebGL + maxTextureSize: 2048 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 0 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + androidETC2FallbackOverride: 0 + spriteSheet: + serializedVersion: 2 + sprites: [] + outline: [] + physicsShape: [] + bones: [] + spriteID: + vertices: [] + indices: + edges: [] + weights: [] + spritePackingTag: + pSDRemoveMatte: 0 + pSDShowRemoveMatteOption: 0 + userData: + assetBundleName: + assetBundleVariant: diff --git a/LocalPackages/net.peeweek.gameplay-ingredients/Icons/Actions/ic-action-teleport.png b/LocalPackages/net.peeweek.gameplay-ingredients/Icons/Actions/ic-action-teleport.png new file mode 100644 index 0000000..23b1e0f --- /dev/null +++ b/LocalPackages/net.peeweek.gameplay-ingredients/Icons/Actions/ic-action-teleport.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:de69f2c619068afe52d818cd19e93c2b1e594f5dbff4125ae0d45bbd7b91f231 +size 669 diff --git a/LocalPackages/net.peeweek.gameplay-ingredients/Icons/Actions/ic-action-teleport.png.meta b/LocalPackages/net.peeweek.gameplay-ingredients/Icons/Actions/ic-action-teleport.png.meta new file mode 100644 index 0000000..8c2e956 --- /dev/null +++ b/LocalPackages/net.peeweek.gameplay-ingredients/Icons/Actions/ic-action-teleport.png.meta @@ -0,0 +1,110 @@ +fileFormatVersion: 2 +guid: 8bd1987424b3c64449f50dbdca21db20 +TextureImporter: + fileIDToRecycleName: {} + externalObjects: {} + serializedVersion: 9 + mipmaps: + mipMapMode: 0 + enableMipMap: 0 + sRGBTexture: 1 + linearTexture: 0 + fadeOut: 0 + borderMipMap: 0 + mipMapsPreserveCoverage: 0 + alphaTestReferenceValue: 0.5 + mipMapFadeDistanceStart: 1 + mipMapFadeDistanceEnd: 3 + bumpmap: + convertToNormalMap: 0 + externalNormalMap: 0 + heightScale: 0.25 + normalMapFilter: 0 + isReadable: 0 + streamingMipmaps: 0 + streamingMipmapsPriority: 0 + grayScaleToAlpha: 0 + generateCubemap: 6 + cubemapConvolution: 0 + seamlessCubemap: 0 + textureFormat: 1 + maxTextureSize: 2048 + textureSettings: + serializedVersion: 2 + filterMode: 0 + aniso: 1 + mipBias: -100 + wrapU: 1 + wrapV: 1 + wrapW: 1 + nPOTScale: 0 + lightmap: 0 + compressionQuality: 50 + spriteMode: 0 + spriteExtrude: 1 + spriteMeshType: 1 + alignment: 0 + spritePivot: {x: 0.5, y: 0.5} + spritePixelsToUnits: 100 + spriteBorder: {x: 0, y: 0, z: 0, w: 0} + spriteGenerateFallbackPhysicsShape: 1 + alphaUsage: 1 + alphaIsTransparency: 1 + spriteTessellationDetail: -1 + textureType: 2 + textureShape: 1 + singleChannelComponent: 0 + maxTextureSizeSet: 0 + compressionQualitySet: 0 + textureFormatSet: 0 + platformSettings: + - serializedVersion: 2 + buildTarget: DefaultTexturePlatform + maxTextureSize: 2048 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 0 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + androidETC2FallbackOverride: 0 + - serializedVersion: 2 + buildTarget: Standalone + maxTextureSize: 2048 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 0 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + androidETC2FallbackOverride: 0 + - serializedVersion: 2 + buildTarget: WebGL + maxTextureSize: 2048 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 0 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + androidETC2FallbackOverride: 0 + spriteSheet: + serializedVersion: 2 + sprites: [] + outline: [] + physicsShape: [] + bones: [] + spriteID: + vertices: [] + indices: + edges: [] + weights: [] + spritePackingTag: + pSDRemoveMatte: 0 + pSDShowRemoveMatteOption: 0 + userData: + assetBundleName: + assetBundleVariant: diff --git a/LocalPackages/net.peeweek.gameplay-ingredients/Icons/Actions/ic-action-time.png b/LocalPackages/net.peeweek.gameplay-ingredients/Icons/Actions/ic-action-time.png new file mode 100644 index 0000000..2666939 --- /dev/null +++ b/LocalPackages/net.peeweek.gameplay-ingredients/Icons/Actions/ic-action-time.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:12206b009a5c56c55d28f159806adc98a2f8da1c2452531f600a9d15d2cb8626 +size 706 diff --git a/LocalPackages/net.peeweek.gameplay-ingredients/Icons/Actions/ic-action-time.png.meta b/LocalPackages/net.peeweek.gameplay-ingredients/Icons/Actions/ic-action-time.png.meta new file mode 100644 index 0000000..15414ca --- /dev/null +++ b/LocalPackages/net.peeweek.gameplay-ingredients/Icons/Actions/ic-action-time.png.meta @@ -0,0 +1,110 @@ +fileFormatVersion: 2 +guid: 119b1440af22d6247a08df45aa367754 +TextureImporter: + fileIDToRecycleName: {} + externalObjects: {} + serializedVersion: 9 + mipmaps: + mipMapMode: 0 + enableMipMap: 0 + sRGBTexture: 1 + linearTexture: 0 + fadeOut: 0 + borderMipMap: 0 + mipMapsPreserveCoverage: 0 + alphaTestReferenceValue: 0.5 + mipMapFadeDistanceStart: 1 + mipMapFadeDistanceEnd: 3 + bumpmap: + convertToNormalMap: 0 + externalNormalMap: 0 + heightScale: 0.25 + normalMapFilter: 0 + isReadable: 0 + streamingMipmaps: 0 + streamingMipmapsPriority: 0 + grayScaleToAlpha: 0 + generateCubemap: 6 + cubemapConvolution: 0 + seamlessCubemap: 0 + textureFormat: 1 + maxTextureSize: 2048 + textureSettings: + serializedVersion: 2 + filterMode: 0 + aniso: 1 + mipBias: -100 + wrapU: 1 + wrapV: 1 + wrapW: 1 + nPOTScale: 0 + lightmap: 0 + compressionQuality: 50 + spriteMode: 0 + spriteExtrude: 1 + spriteMeshType: 1 + alignment: 0 + spritePivot: {x: 0.5, y: 0.5} + spritePixelsToUnits: 100 + spriteBorder: {x: 0, y: 0, z: 0, w: 0} + spriteGenerateFallbackPhysicsShape: 1 + alphaUsage: 1 + alphaIsTransparency: 1 + spriteTessellationDetail: -1 + textureType: 2 + textureShape: 1 + singleChannelComponent: 0 + maxTextureSizeSet: 0 + compressionQualitySet: 0 + textureFormatSet: 0 + platformSettings: + - serializedVersion: 2 + buildTarget: DefaultTexturePlatform + maxTextureSize: 2048 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 0 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + androidETC2FallbackOverride: 0 + - serializedVersion: 2 + buildTarget: Standalone + maxTextureSize: 2048 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 0 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + androidETC2FallbackOverride: 0 + - serializedVersion: 2 + buildTarget: WebGL + maxTextureSize: 2048 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 0 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + androidETC2FallbackOverride: 0 + spriteSheet: + serializedVersion: 2 + sprites: [] + outline: [] + physicsShape: [] + bones: [] + spriteID: + vertices: [] + indices: + edges: [] + weights: [] + spritePackingTag: + pSDRemoveMatte: 0 + pSDShowRemoveMatteOption: 0 + userData: + assetBundleName: + assetBundleVariant: diff --git a/LocalPackages/net.peeweek.gameplay-ingredients/Icons/Actions/ic-action-timeline.png b/LocalPackages/net.peeweek.gameplay-ingredients/Icons/Actions/ic-action-timeline.png new file mode 100644 index 0000000..ccd516b --- /dev/null +++ b/LocalPackages/net.peeweek.gameplay-ingredients/Icons/Actions/ic-action-timeline.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:67f54811533f19e9c4121fb4ff811f5ff5e40d2a32eed65b39c95f9e160a7040 +size 1452 diff --git a/LocalPackages/net.peeweek.gameplay-ingredients/Icons/Actions/ic-action-timeline.png.meta b/LocalPackages/net.peeweek.gameplay-ingredients/Icons/Actions/ic-action-timeline.png.meta new file mode 100644 index 0000000..56759a0 --- /dev/null +++ b/LocalPackages/net.peeweek.gameplay-ingredients/Icons/Actions/ic-action-timeline.png.meta @@ -0,0 +1,110 @@ +fileFormatVersion: 2 +guid: 31fbcdeb88015d34e93da597e32c8f07 +TextureImporter: + fileIDToRecycleName: {} + externalObjects: {} + serializedVersion: 9 + mipmaps: + mipMapMode: 0 + enableMipMap: 0 + sRGBTexture: 1 + linearTexture: 0 + fadeOut: 0 + borderMipMap: 0 + mipMapsPreserveCoverage: 0 + alphaTestReferenceValue: 0.5 + mipMapFadeDistanceStart: 1 + mipMapFadeDistanceEnd: 3 + bumpmap: + convertToNormalMap: 0 + externalNormalMap: 0 + heightScale: 0.25 + normalMapFilter: 0 + isReadable: 0 + streamingMipmaps: 0 + streamingMipmapsPriority: 0 + grayScaleToAlpha: 0 + generateCubemap: 6 + cubemapConvolution: 0 + seamlessCubemap: 0 + textureFormat: 1 + maxTextureSize: 2048 + textureSettings: + serializedVersion: 2 + filterMode: 0 + aniso: 1 + mipBias: -100 + wrapU: 1 + wrapV: 1 + wrapW: 1 + nPOTScale: 0 + lightmap: 0 + compressionQuality: 50 + spriteMode: 0 + spriteExtrude: 1 + spriteMeshType: 1 + alignment: 0 + spritePivot: {x: 0.5, y: 0.5} + spritePixelsToUnits: 100 + spriteBorder: {x: 0, y: 0, z: 0, w: 0} + spriteGenerateFallbackPhysicsShape: 1 + alphaUsage: 1 + alphaIsTransparency: 1 + spriteTessellationDetail: -1 + textureType: 2 + textureShape: 1 + singleChannelComponent: 0 + maxTextureSizeSet: 0 + compressionQualitySet: 0 + textureFormatSet: 0 + platformSettings: + - serializedVersion: 2 + buildTarget: DefaultTexturePlatform + maxTextureSize: 2048 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 0 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + androidETC2FallbackOverride: 0 + - serializedVersion: 2 + buildTarget: Standalone + maxTextureSize: 2048 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 0 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + androidETC2FallbackOverride: 0 + - serializedVersion: 2 + buildTarget: WebGL + maxTextureSize: 2048 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 0 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + androidETC2FallbackOverride: 0 + spriteSheet: + serializedVersion: 2 + sprites: [] + outline: [] + physicsShape: [] + bones: [] + spriteID: + vertices: [] + indices: + edges: [] + weights: [] + spritePackingTag: + pSDRemoveMatte: 0 + pSDShowRemoveMatteOption: 0 + userData: + assetBundleName: + assetBundleVariant: diff --git a/LocalPackages/net.peeweek.gameplay-ingredients/Icons/Actions/ic-action-trash.png b/LocalPackages/net.peeweek.gameplay-ingredients/Icons/Actions/ic-action-trash.png new file mode 100644 index 0000000..0826313 --- /dev/null +++ b/LocalPackages/net.peeweek.gameplay-ingredients/Icons/Actions/ic-action-trash.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:5ec10a2c7ec7c9018009e91f529ccb5c9aa921ce01e7a9d7f510f3590b10879e +size 699 diff --git a/LocalPackages/net.peeweek.gameplay-ingredients/Icons/Actions/ic-action-trash.png.meta b/LocalPackages/net.peeweek.gameplay-ingredients/Icons/Actions/ic-action-trash.png.meta new file mode 100644 index 0000000..c59e7fa --- /dev/null +++ b/LocalPackages/net.peeweek.gameplay-ingredients/Icons/Actions/ic-action-trash.png.meta @@ -0,0 +1,110 @@ +fileFormatVersion: 2 +guid: 4bf1ec536deee044a8648d196855a79a +TextureImporter: + fileIDToRecycleName: {} + externalObjects: {} + serializedVersion: 9 + mipmaps: + mipMapMode: 0 + enableMipMap: 0 + sRGBTexture: 1 + linearTexture: 0 + fadeOut: 0 + borderMipMap: 0 + mipMapsPreserveCoverage: 0 + alphaTestReferenceValue: 0.5 + mipMapFadeDistanceStart: 1 + mipMapFadeDistanceEnd: 3 + bumpmap: + convertToNormalMap: 0 + externalNormalMap: 0 + heightScale: 0.25 + normalMapFilter: 0 + isReadable: 0 + streamingMipmaps: 0 + streamingMipmapsPriority: 0 + grayScaleToAlpha: 0 + generateCubemap: 6 + cubemapConvolution: 0 + seamlessCubemap: 0 + textureFormat: 1 + maxTextureSize: 2048 + textureSettings: + serializedVersion: 2 + filterMode: 0 + aniso: 1 + mipBias: -100 + wrapU: 1 + wrapV: 1 + wrapW: 1 + nPOTScale: 0 + lightmap: 0 + compressionQuality: 50 + spriteMode: 0 + spriteExtrude: 1 + spriteMeshType: 1 + alignment: 0 + spritePivot: {x: 0.5, y: 0.5} + spritePixelsToUnits: 100 + spriteBorder: {x: 0, y: 0, z: 0, w: 0} + spriteGenerateFallbackPhysicsShape: 1 + alphaUsage: 1 + alphaIsTransparency: 1 + spriteTessellationDetail: -1 + textureType: 2 + textureShape: 1 + singleChannelComponent: 0 + maxTextureSizeSet: 0 + compressionQualitySet: 0 + textureFormatSet: 0 + platformSettings: + - serializedVersion: 2 + buildTarget: DefaultTexturePlatform + maxTextureSize: 2048 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 0 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + androidETC2FallbackOverride: 0 + - serializedVersion: 2 + buildTarget: Standalone + maxTextureSize: 2048 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 0 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + androidETC2FallbackOverride: 0 + - serializedVersion: 2 + buildTarget: WebGL + maxTextureSize: 2048 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 0 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + androidETC2FallbackOverride: 0 + spriteSheet: + serializedVersion: 2 + sprites: [] + outline: [] + physicsShape: [] + bones: [] + spriteID: + vertices: [] + indices: + edges: [] + weights: [] + spritePackingTag: + pSDRemoveMatte: 0 + pSDShowRemoveMatteOption: 0 + userData: + assetBundleName: + assetBundleVariant: diff --git a/LocalPackages/net.peeweek.gameplay-ingredients/Icons/Actions/ic-action-ui.png b/LocalPackages/net.peeweek.gameplay-ingredients/Icons/Actions/ic-action-ui.png new file mode 100644 index 0000000..56bbd5e --- /dev/null +++ b/LocalPackages/net.peeweek.gameplay-ingredients/Icons/Actions/ic-action-ui.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:139cc0065ecfa30902e7517aeb8c9d303d27962a1e485747b446398231d66295 +size 591 diff --git a/LocalPackages/net.peeweek.gameplay-ingredients/Icons/Actions/ic-action-ui.png.meta b/LocalPackages/net.peeweek.gameplay-ingredients/Icons/Actions/ic-action-ui.png.meta new file mode 100644 index 0000000..c1f1a4c --- /dev/null +++ b/LocalPackages/net.peeweek.gameplay-ingredients/Icons/Actions/ic-action-ui.png.meta @@ -0,0 +1,101 @@ +fileFormatVersion: 2 +guid: eccd73d046a00214f8eee58ce0e2b16e +TextureImporter: + internalIDToNameTable: [] + externalObjects: {} + serializedVersion: 10 + mipmaps: + mipMapMode: 0 + enableMipMap: 0 + sRGBTexture: 1 + linearTexture: 0 + fadeOut: 0 + borderMipMap: 0 + mipMapsPreserveCoverage: 0 + alphaTestReferenceValue: 0.5 + mipMapFadeDistanceStart: 1 + mipMapFadeDistanceEnd: 3 + bumpmap: + convertToNormalMap: 0 + externalNormalMap: 0 + heightScale: 0.25 + normalMapFilter: 0 + isReadable: 0 + streamingMipmaps: 0 + streamingMipmapsPriority: 0 + grayScaleToAlpha: 0 + generateCubemap: 6 + cubemapConvolution: 0 + seamlessCubemap: 0 + textureFormat: 1 + maxTextureSize: 2048 + textureSettings: + serializedVersion: 2 + filterMode: -1 + aniso: 1 + mipBias: -100 + wrapU: 1 + wrapV: 1 + wrapW: -1 + nPOTScale: 0 + lightmap: 0 + compressionQuality: 50 + spriteMode: 0 + spriteExtrude: 1 + spriteMeshType: 1 + alignment: 0 + spritePivot: {x: 0.5, y: 0.5} + spritePixelsToUnits: 100 + spriteBorder: {x: 0, y: 0, z: 0, w: 0} + spriteGenerateFallbackPhysicsShape: 1 + alphaUsage: 1 + alphaIsTransparency: 1 + spriteTessellationDetail: -1 + textureType: 2 + textureShape: 1 + singleChannelComponent: 0 + maxTextureSizeSet: 0 + compressionQualitySet: 0 + textureFormatSet: 0 + platformSettings: + - serializedVersion: 2 + buildTarget: DefaultTexturePlatform + maxTextureSize: 2048 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 0 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + androidETC2FallbackOverride: 0 + - serializedVersion: 2 + buildTarget: Standalone + maxTextureSize: 2048 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 0 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + androidETC2FallbackOverride: 0 + spriteSheet: + serializedVersion: 2 + sprites: [] + outline: [] + physicsShape: [] + bones: [] + spriteID: + internalID: 0 + vertices: [] + indices: + edges: [] + weights: [] + secondaryTextures: [] + spritePackingTag: + pSDRemoveMatte: 0 + pSDShowRemoveMatteOption: 0 + userData: + assetBundleName: + assetBundleVariant: diff --git a/LocalPackages/net.peeweek.gameplay-ingredients/Icons/Actions/ic-generic-action.png b/LocalPackages/net.peeweek.gameplay-ingredients/Icons/Actions/ic-generic-action.png new file mode 100644 index 0000000..58d2ed4 --- /dev/null +++ b/LocalPackages/net.peeweek.gameplay-ingredients/Icons/Actions/ic-generic-action.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:5fd0a87e37f8c3628652a2cc56df61bf0b50370623291e27b228329f0dac78f2 +size 736 diff --git a/LocalPackages/net.peeweek.gameplay-ingredients/Icons/Actions/ic-generic-action.png.meta b/LocalPackages/net.peeweek.gameplay-ingredients/Icons/Actions/ic-generic-action.png.meta new file mode 100644 index 0000000..96c315b --- /dev/null +++ b/LocalPackages/net.peeweek.gameplay-ingredients/Icons/Actions/ic-generic-action.png.meta @@ -0,0 +1,110 @@ +fileFormatVersion: 2 +guid: 87355f4718c07b542b49dd0fe0abe447 +TextureImporter: + fileIDToRecycleName: {} + externalObjects: {} + serializedVersion: 9 + mipmaps: + mipMapMode: 0 + enableMipMap: 0 + sRGBTexture: 1 + linearTexture: 0 + fadeOut: 0 + borderMipMap: 0 + mipMapsPreserveCoverage: 0 + alphaTestReferenceValue: 0.5 + mipMapFadeDistanceStart: 1 + mipMapFadeDistanceEnd: 3 + bumpmap: + convertToNormalMap: 0 + externalNormalMap: 0 + heightScale: 0.25 + normalMapFilter: 0 + isReadable: 0 + streamingMipmaps: 0 + streamingMipmapsPriority: 0 + grayScaleToAlpha: 0 + generateCubemap: 6 + cubemapConvolution: 0 + seamlessCubemap: 0 + textureFormat: 1 + maxTextureSize: 2048 + textureSettings: + serializedVersion: 2 + filterMode: 0 + aniso: 1 + mipBias: -100 + wrapU: 1 + wrapV: 1 + wrapW: -1 + nPOTScale: 0 + lightmap: 0 + compressionQuality: 50 + spriteMode: 1 + spriteExtrude: 1 + spriteMeshType: 1 + alignment: 0 + spritePivot: {x: 0.5, y: 0.5} + spritePixelsToUnits: 100 + spriteBorder: {x: 0, y: 0, z: 0, w: 0} + spriteGenerateFallbackPhysicsShape: 1 + alphaUsage: 1 + alphaIsTransparency: 1 + spriteTessellationDetail: -1 + textureType: 2 + textureShape: 1 + singleChannelComponent: 0 + maxTextureSizeSet: 0 + compressionQualitySet: 0 + textureFormatSet: 0 + platformSettings: + - serializedVersion: 2 + buildTarget: DefaultTexturePlatform + maxTextureSize: 2048 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 0 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + androidETC2FallbackOverride: 0 + - serializedVersion: 2 + buildTarget: Standalone + maxTextureSize: 2048 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 0 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + androidETC2FallbackOverride: 0 + - serializedVersion: 2 + buildTarget: WebGL + maxTextureSize: 2048 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 0 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + androidETC2FallbackOverride: 0 + spriteSheet: + serializedVersion: 2 + sprites: [] + outline: [] + physicsShape: [] + bones: [] + spriteID: + vertices: [] + indices: + edges: [] + weights: [] + spritePackingTag: + pSDRemoveMatte: 0 + pSDShowRemoveMatteOption: 0 + userData: + assetBundleName: + assetBundleVariant: diff --git a/LocalPackages/net.peeweek.gameplay-ingredients/Icons/Discover.meta b/LocalPackages/net.peeweek.gameplay-ingredients/Icons/Discover.meta new file mode 100644 index 0000000..991b163 --- /dev/null +++ b/LocalPackages/net.peeweek.gameplay-ingredients/Icons/Discover.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 89ab41c779f435b49808c7980a59cbb2 +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/LocalPackages/net.peeweek.gameplay-ingredients/Icons/Discover/Discover Icon.png b/LocalPackages/net.peeweek.gameplay-ingredients/Icons/Discover/Discover Icon.png new file mode 100644 index 0000000..479c80a --- /dev/null +++ b/LocalPackages/net.peeweek.gameplay-ingredients/Icons/Discover/Discover Icon.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:9cfc1a36ae5d8aa0f0feb0b4ba3c6713543cb832ce8bfa45dfc6bd6763006650 +size 1634 diff --git a/LocalPackages/net.peeweek.gameplay-ingredients/Icons/Discover/Discover Icon.png.meta b/LocalPackages/net.peeweek.gameplay-ingredients/Icons/Discover/Discover Icon.png.meta new file mode 100644 index 0000000..a937c22 --- /dev/null +++ b/LocalPackages/net.peeweek.gameplay-ingredients/Icons/Discover/Discover Icon.png.meta @@ -0,0 +1,90 @@ +fileFormatVersion: 2 +guid: d3aa34dcc051ec64aac5ea3204d61966 +TextureImporter: + internalIDToNameTable: [] + externalObjects: {} + serializedVersion: 10 + mipmaps: + mipMapMode: 0 + enableMipMap: 1 + sRGBTexture: 1 + linearTexture: 0 + fadeOut: 0 + borderMipMap: 0 + mipMapsPreserveCoverage: 0 + alphaTestReferenceValue: 0.5 + mipMapFadeDistanceStart: 1 + mipMapFadeDistanceEnd: 3 + bumpmap: + convertToNormalMap: 0 + externalNormalMap: 0 + heightScale: 0.25 + normalMapFilter: 0 + isReadable: 0 + streamingMipmaps: 0 + streamingMipmapsPriority: 0 + grayScaleToAlpha: 0 + generateCubemap: 6 + cubemapConvolution: 0 + seamlessCubemap: 0 + textureFormat: 1 + maxTextureSize: 2048 + textureSettings: + serializedVersion: 2 + filterMode: -1 + aniso: -1 + mipBias: -100 + wrapU: -1 + wrapV: -1 + wrapW: -1 + nPOTScale: 1 + lightmap: 0 + compressionQuality: 50 + spriteMode: 0 + spriteExtrude: 1 + spriteMeshType: 1 + alignment: 0 + spritePivot: {x: 0.5, y: 0.5} + spritePixelsToUnits: 100 + spriteBorder: {x: 0, y: 0, z: 0, w: 0} + spriteGenerateFallbackPhysicsShape: 1 + alphaUsage: 1 + alphaIsTransparency: 0 + spriteTessellationDetail: -1 + textureType: 0 + textureShape: 1 + singleChannelComponent: 0 + maxTextureSizeSet: 0 + compressionQualitySet: 0 + textureFormatSet: 0 + platformSettings: + - serializedVersion: 2 + buildTarget: DefaultTexturePlatform + maxTextureSize: 2048 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 1 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + androidETC2FallbackOverride: 0 + spriteSheet: + serializedVersion: 2 + sprites: [] + outline: [] + physicsShape: [] + bones: [] + spriteID: + internalID: 0 + vertices: [] + indices: + edges: [] + weights: [] + secondaryTextures: [] + spritePackingTag: + pSDRemoveMatte: 0 + pSDShowRemoveMatteOption: 0 + userData: + assetBundleName: + assetBundleVariant: diff --git a/LocalPackages/net.peeweek.gameplay-ingredients/Icons/Discover/DiscoverAsset Icon.png b/LocalPackages/net.peeweek.gameplay-ingredients/Icons/Discover/DiscoverAsset Icon.png new file mode 100644 index 0000000..3d66b74 --- /dev/null +++ b/LocalPackages/net.peeweek.gameplay-ingredients/Icons/Discover/DiscoverAsset Icon.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:fc8bb17cea69672e3bcb8c03a166a78fd17879adc927194cb31450d468a09950 +size 7898 diff --git a/LocalPackages/net.peeweek.gameplay-ingredients/Icons/Discover/DiscoverAsset Icon.png.meta b/LocalPackages/net.peeweek.gameplay-ingredients/Icons/Discover/DiscoverAsset Icon.png.meta new file mode 100644 index 0000000..8dea433 --- /dev/null +++ b/LocalPackages/net.peeweek.gameplay-ingredients/Icons/Discover/DiscoverAsset Icon.png.meta @@ -0,0 +1,90 @@ +fileFormatVersion: 2 +guid: e61da4d7fe9ddd647bd4fd18999ff0f0 +TextureImporter: + internalIDToNameTable: [] + externalObjects: {} + serializedVersion: 10 + mipmaps: + mipMapMode: 0 + enableMipMap: 1 + sRGBTexture: 1 + linearTexture: 0 + fadeOut: 0 + borderMipMap: 0 + mipMapsPreserveCoverage: 0 + alphaTestReferenceValue: 0.5 + mipMapFadeDistanceStart: 1 + mipMapFadeDistanceEnd: 3 + bumpmap: + convertToNormalMap: 0 + externalNormalMap: 0 + heightScale: 0.25 + normalMapFilter: 0 + isReadable: 0 + streamingMipmaps: 0 + streamingMipmapsPriority: 0 + grayScaleToAlpha: 0 + generateCubemap: 6 + cubemapConvolution: 0 + seamlessCubemap: 0 + textureFormat: 1 + maxTextureSize: 2048 + textureSettings: + serializedVersion: 2 + filterMode: -1 + aniso: -1 + mipBias: -100 + wrapU: -1 + wrapV: -1 + wrapW: -1 + nPOTScale: 1 + lightmap: 0 + compressionQuality: 50 + spriteMode: 0 + spriteExtrude: 1 + spriteMeshType: 1 + alignment: 0 + spritePivot: {x: 0.5, y: 0.5} + spritePixelsToUnits: 100 + spriteBorder: {x: 0, y: 0, z: 0, w: 0} + spriteGenerateFallbackPhysicsShape: 1 + alphaUsage: 1 + alphaIsTransparency: 0 + spriteTessellationDetail: -1 + textureType: 0 + textureShape: 1 + singleChannelComponent: 0 + maxTextureSizeSet: 0 + compressionQualitySet: 0 + textureFormatSet: 0 + platformSettings: + - serializedVersion: 2 + buildTarget: DefaultTexturePlatform + maxTextureSize: 2048 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 1 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + androidETC2FallbackOverride: 0 + spriteSheet: + serializedVersion: 2 + sprites: [] + outline: [] + physicsShape: [] + bones: [] + spriteID: + internalID: 0 + vertices: [] + indices: + edges: [] + weights: [] + secondaryTextures: [] + spritePackingTag: + pSDRemoveMatte: 0 + pSDShowRemoveMatteOption: 0 + userData: + assetBundleName: + assetBundleVariant: diff --git a/LocalPackages/net.peeweek.gameplay-ingredients/Icons/Events.meta b/LocalPackages/net.peeweek.gameplay-ingredients/Icons/Events.meta new file mode 100644 index 0000000..dc9727c --- /dev/null +++ b/LocalPackages/net.peeweek.gameplay-ingredients/Icons/Events.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 70235ec096cc1b644a74b36d8d80d6af +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/LocalPackages/net.peeweek.gameplay-ingredients/Icons/Events/ic-event-awake.png b/LocalPackages/net.peeweek.gameplay-ingredients/Icons/Events/ic-event-awake.png new file mode 100644 index 0000000..030c6b1 --- /dev/null +++ b/LocalPackages/net.peeweek.gameplay-ingredients/Icons/Events/ic-event-awake.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:63b1846a9e8c65b06c0aee64dec3dc502fcc5245b2c2bd7d046e67a111025300 +size 900 diff --git a/LocalPackages/net.peeweek.gameplay-ingredients/Icons/Events/ic-event-awake.png.meta b/LocalPackages/net.peeweek.gameplay-ingredients/Icons/Events/ic-event-awake.png.meta new file mode 100644 index 0000000..57cf8d9 --- /dev/null +++ b/LocalPackages/net.peeweek.gameplay-ingredients/Icons/Events/ic-event-awake.png.meta @@ -0,0 +1,110 @@ +fileFormatVersion: 2 +guid: ed060522d893168479e97f3ebf7ca0b8 +TextureImporter: + fileIDToRecycleName: {} + externalObjects: {} + serializedVersion: 9 + mipmaps: + mipMapMode: 0 + enableMipMap: 0 + sRGBTexture: 1 + linearTexture: 0 + fadeOut: 0 + borderMipMap: 0 + mipMapsPreserveCoverage: 0 + alphaTestReferenceValue: 0.5 + mipMapFadeDistanceStart: 1 + mipMapFadeDistanceEnd: 3 + bumpmap: + convertToNormalMap: 0 + externalNormalMap: 0 + heightScale: 0.25 + normalMapFilter: 0 + isReadable: 0 + streamingMipmaps: 0 + streamingMipmapsPriority: 0 + grayScaleToAlpha: 0 + generateCubemap: 6 + cubemapConvolution: 0 + seamlessCubemap: 0 + textureFormat: 1 + maxTextureSize: 2048 + textureSettings: + serializedVersion: 2 + filterMode: 0 + aniso: 1 + mipBias: -100 + wrapU: 1 + wrapV: 1 + wrapW: 1 + nPOTScale: 0 + lightmap: 0 + compressionQuality: 50 + spriteMode: 0 + spriteExtrude: 1 + spriteMeshType: 1 + alignment: 0 + spritePivot: {x: 0.5, y: 0.5} + spritePixelsToUnits: 100 + spriteBorder: {x: 0, y: 0, z: 0, w: 0} + spriteGenerateFallbackPhysicsShape: 1 + alphaUsage: 1 + alphaIsTransparency: 1 + spriteTessellationDetail: -1 + textureType: 2 + textureShape: 1 + singleChannelComponent: 0 + maxTextureSizeSet: 0 + compressionQualitySet: 0 + textureFormatSet: 0 + platformSettings: + - serializedVersion: 2 + buildTarget: DefaultTexturePlatform + maxTextureSize: 2048 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 0 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + androidETC2FallbackOverride: 0 + - serializedVersion: 2 + buildTarget: Standalone + maxTextureSize: 2048 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 0 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + androidETC2FallbackOverride: 0 + - serializedVersion: 2 + buildTarget: WebGL + maxTextureSize: 2048 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 0 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + androidETC2FallbackOverride: 0 + spriteSheet: + serializedVersion: 2 + sprites: [] + outline: [] + physicsShape: [] + bones: [] + spriteID: + vertices: [] + indices: + edges: [] + weights: [] + spritePackingTag: + pSDRemoveMatte: 0 + pSDShowRemoveMatteOption: 0 + userData: + assetBundleName: + assetBundleVariant: diff --git a/LocalPackages/net.peeweek.gameplay-ingredients/Icons/Events/ic-event-destroy.png b/LocalPackages/net.peeweek.gameplay-ingredients/Icons/Events/ic-event-destroy.png new file mode 100644 index 0000000..f7a3f72 --- /dev/null +++ b/LocalPackages/net.peeweek.gameplay-ingredients/Icons/Events/ic-event-destroy.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:d7ca94c29400f74d0c28b56d43b2c98fe57890fbadf4ea02f8f826d553f198a0 +size 6568 diff --git a/LocalPackages/net.peeweek.gameplay-ingredients/Icons/Events/ic-event-destroy.png.meta b/LocalPackages/net.peeweek.gameplay-ingredients/Icons/Events/ic-event-destroy.png.meta new file mode 100644 index 0000000..dc0d71f --- /dev/null +++ b/LocalPackages/net.peeweek.gameplay-ingredients/Icons/Events/ic-event-destroy.png.meta @@ -0,0 +1,110 @@ +fileFormatVersion: 2 +guid: 471146a7551176e43bedaba283a78ec5 +TextureImporter: + fileIDToRecycleName: {} + externalObjects: {} + serializedVersion: 9 + mipmaps: + mipMapMode: 0 + enableMipMap: 0 + sRGBTexture: 1 + linearTexture: 0 + fadeOut: 0 + borderMipMap: 0 + mipMapsPreserveCoverage: 0 + alphaTestReferenceValue: 0.5 + mipMapFadeDistanceStart: 1 + mipMapFadeDistanceEnd: 3 + bumpmap: + convertToNormalMap: 0 + externalNormalMap: 0 + heightScale: 0.25 + normalMapFilter: 0 + isReadable: 0 + streamingMipmaps: 0 + streamingMipmapsPriority: 0 + grayScaleToAlpha: 0 + generateCubemap: 6 + cubemapConvolution: 0 + seamlessCubemap: 0 + textureFormat: 1 + maxTextureSize: 2048 + textureSettings: + serializedVersion: 2 + filterMode: 0 + aniso: 1 + mipBias: -100 + wrapU: 1 + wrapV: 1 + wrapW: 1 + nPOTScale: 0 + lightmap: 0 + compressionQuality: 50 + spriteMode: 0 + spriteExtrude: 1 + spriteMeshType: 1 + alignment: 0 + spritePivot: {x: 0.5, y: 0.5} + spritePixelsToUnits: 100 + spriteBorder: {x: 0, y: 0, z: 0, w: 0} + spriteGenerateFallbackPhysicsShape: 1 + alphaUsage: 1 + alphaIsTransparency: 1 + spriteTessellationDetail: -1 + textureType: 2 + textureShape: 1 + singleChannelComponent: 0 + maxTextureSizeSet: 0 + compressionQualitySet: 0 + textureFormatSet: 0 + platformSettings: + - serializedVersion: 2 + buildTarget: DefaultTexturePlatform + maxTextureSize: 2048 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 0 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + androidETC2FallbackOverride: 0 + - serializedVersion: 2 + buildTarget: Standalone + maxTextureSize: 2048 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 0 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + androidETC2FallbackOverride: 0 + - serializedVersion: 2 + buildTarget: WebGL + maxTextureSize: 2048 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 0 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + androidETC2FallbackOverride: 0 + spriteSheet: + serializedVersion: 2 + sprites: [] + outline: [] + physicsShape: [] + bones: [] + spriteID: + vertices: [] + indices: + edges: [] + weights: [] + spritePackingTag: + pSDRemoveMatte: 0 + pSDShowRemoveMatteOption: 0 + userData: + assetBundleName: + assetBundleVariant: diff --git a/LocalPackages/net.peeweek.gameplay-ingredients/Icons/Events/ic-event-enable-disable.png b/LocalPackages/net.peeweek.gameplay-ingredients/Icons/Events/ic-event-enable-disable.png new file mode 100644 index 0000000..5248802 --- /dev/null +++ b/LocalPackages/net.peeweek.gameplay-ingredients/Icons/Events/ic-event-enable-disable.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:853547cb96e0be35df4b41ad19c44e13017609e5709d18558ff6896874b1e09f +size 1370 diff --git a/LocalPackages/net.peeweek.gameplay-ingredients/Icons/Events/ic-event-enable-disable.png.meta b/LocalPackages/net.peeweek.gameplay-ingredients/Icons/Events/ic-event-enable-disable.png.meta new file mode 100644 index 0000000..23976f4 --- /dev/null +++ b/LocalPackages/net.peeweek.gameplay-ingredients/Icons/Events/ic-event-enable-disable.png.meta @@ -0,0 +1,110 @@ +fileFormatVersion: 2 +guid: aaf61d8ba7c39604a90345b0217bae35 +TextureImporter: + fileIDToRecycleName: {} + externalObjects: {} + serializedVersion: 9 + mipmaps: + mipMapMode: 0 + enableMipMap: 0 + sRGBTexture: 1 + linearTexture: 0 + fadeOut: 0 + borderMipMap: 0 + mipMapsPreserveCoverage: 0 + alphaTestReferenceValue: 0.5 + mipMapFadeDistanceStart: 1 + mipMapFadeDistanceEnd: 3 + bumpmap: + convertToNormalMap: 0 + externalNormalMap: 0 + heightScale: 0.25 + normalMapFilter: 0 + isReadable: 0 + streamingMipmaps: 0 + streamingMipmapsPriority: 0 + grayScaleToAlpha: 0 + generateCubemap: 6 + cubemapConvolution: 0 + seamlessCubemap: 0 + textureFormat: 1 + maxTextureSize: 2048 + textureSettings: + serializedVersion: 2 + filterMode: 0 + aniso: 1 + mipBias: -100 + wrapU: 1 + wrapV: 1 + wrapW: 1 + nPOTScale: 0 + lightmap: 0 + compressionQuality: 50 + spriteMode: 0 + spriteExtrude: 1 + spriteMeshType: 1 + alignment: 0 + spritePivot: {x: 0.5, y: 0.5} + spritePixelsToUnits: 100 + spriteBorder: {x: 0, y: 0, z: 0, w: 0} + spriteGenerateFallbackPhysicsShape: 1 + alphaUsage: 1 + alphaIsTransparency: 1 + spriteTessellationDetail: -1 + textureType: 2 + textureShape: 1 + singleChannelComponent: 0 + maxTextureSizeSet: 0 + compressionQualitySet: 0 + textureFormatSet: 0 + platformSettings: + - serializedVersion: 2 + buildTarget: DefaultTexturePlatform + maxTextureSize: 2048 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 0 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + androidETC2FallbackOverride: 0 + - serializedVersion: 2 + buildTarget: Standalone + maxTextureSize: 2048 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 0 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + androidETC2FallbackOverride: 0 + - serializedVersion: 2 + buildTarget: WebGL + maxTextureSize: 2048 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 0 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + androidETC2FallbackOverride: 0 + spriteSheet: + serializedVersion: 2 + sprites: [] + outline: [] + physicsShape: [] + bones: [] + spriteID: + vertices: [] + indices: + edges: [] + weights: [] + spritePackingTag: + pSDRemoveMatte: 0 + pSDShowRemoveMatteOption: 0 + userData: + assetBundleName: + assetBundleVariant: diff --git a/LocalPackages/net.peeweek.gameplay-ingredients/Icons/Events/ic-event-generic.png b/LocalPackages/net.peeweek.gameplay-ingredients/Icons/Events/ic-event-generic.png new file mode 100644 index 0000000..2805720 --- /dev/null +++ b/LocalPackages/net.peeweek.gameplay-ingredients/Icons/Events/ic-event-generic.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:64feb6c6bf8a791b0a053356cfca1f4d7978e2843f69943258bbc820d081d5cc +size 766 diff --git a/LocalPackages/net.peeweek.gameplay-ingredients/Icons/Events/ic-event-generic.png.meta b/LocalPackages/net.peeweek.gameplay-ingredients/Icons/Events/ic-event-generic.png.meta new file mode 100644 index 0000000..e2b4bd1 --- /dev/null +++ b/LocalPackages/net.peeweek.gameplay-ingredients/Icons/Events/ic-event-generic.png.meta @@ -0,0 +1,115 @@ +fileFormatVersion: 2 +guid: 5beb76c73e9d9f34aa9f1092912301db +TextureImporter: + internalIDToNameTable: [] + externalObjects: {} + serializedVersion: 10 + mipmaps: + mipMapMode: 0 + enableMipMap: 0 + sRGBTexture: 1 + linearTexture: 0 + fadeOut: 0 + borderMipMap: 0 + mipMapsPreserveCoverage: 0 + alphaTestReferenceValue: 0.5 + mipMapFadeDistanceStart: 1 + mipMapFadeDistanceEnd: 3 + bumpmap: + convertToNormalMap: 0 + externalNormalMap: 0 + heightScale: 0.25 + normalMapFilter: 0 + isReadable: 0 + streamingMipmaps: 0 + streamingMipmapsPriority: 0 + grayScaleToAlpha: 0 + generateCubemap: 6 + cubemapConvolution: 0 + seamlessCubemap: 0 + textureFormat: 1 + maxTextureSize: 2048 + textureSettings: + serializedVersion: 2 + filterMode: -1 + aniso: 1 + mipBias: -100 + wrapU: 1 + wrapV: 1 + wrapW: -1 + nPOTScale: 0 + lightmap: 0 + compressionQuality: 50 + spriteMode: 0 + spriteExtrude: 1 + spriteMeshType: 1 + alignment: 0 + spritePivot: {x: 0.5, y: 0.5} + spritePixelsToUnits: 100 + spriteBorder: {x: 0, y: 0, z: 0, w: 0} + spriteGenerateFallbackPhysicsShape: 1 + alphaUsage: 1 + alphaIsTransparency: 1 + spriteTessellationDetail: -1 + textureType: 2 + textureShape: 1 + singleChannelComponent: 0 + maxTextureSizeSet: 0 + compressionQualitySet: 0 + textureFormatSet: 0 + platformSettings: + - serializedVersion: 3 + buildTarget: DefaultTexturePlatform + maxTextureSize: 2048 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 0 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + androidETC2FallbackOverride: 0 + forceMaximumCompressionQuality_BC6H_BC7: 0 + - serializedVersion: 3 + buildTarget: Standalone + maxTextureSize: 2048 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 0 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + androidETC2FallbackOverride: 0 + forceMaximumCompressionQuality_BC6H_BC7: 0 + - serializedVersion: 3 + buildTarget: Android + maxTextureSize: 2048 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 0 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + androidETC2FallbackOverride: 0 + forceMaximumCompressionQuality_BC6H_BC7: 0 + spriteSheet: + serializedVersion: 2 + sprites: [] + outline: [] + physicsShape: [] + bones: [] + spriteID: + internalID: 0 + vertices: [] + indices: + edges: [] + weights: [] + secondaryTextures: [] + spritePackingTag: + pSDRemoveMatte: 0 + pSDShowRemoveMatteOption: 0 + userData: + assetBundleName: + assetBundleVariant: diff --git a/LocalPackages/net.peeweek.gameplay-ingredients/Icons/Events/ic-event-keyboard.png b/LocalPackages/net.peeweek.gameplay-ingredients/Icons/Events/ic-event-keyboard.png new file mode 100644 index 0000000..0498f54 --- /dev/null +++ b/LocalPackages/net.peeweek.gameplay-ingredients/Icons/Events/ic-event-keyboard.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:26bfd7029678c849ee45e5630f7778fbc4688291e102e158c04b079659cc0647 +size 484 diff --git a/LocalPackages/net.peeweek.gameplay-ingredients/Icons/Events/ic-event-keyboard.png.meta b/LocalPackages/net.peeweek.gameplay-ingredients/Icons/Events/ic-event-keyboard.png.meta new file mode 100644 index 0000000..0beea42 --- /dev/null +++ b/LocalPackages/net.peeweek.gameplay-ingredients/Icons/Events/ic-event-keyboard.png.meta @@ -0,0 +1,110 @@ +fileFormatVersion: 2 +guid: c912dd6c3d709974b8973f6e19c10e08 +TextureImporter: + fileIDToRecycleName: {} + externalObjects: {} + serializedVersion: 9 + mipmaps: + mipMapMode: 0 + enableMipMap: 0 + sRGBTexture: 1 + linearTexture: 0 + fadeOut: 0 + borderMipMap: 0 + mipMapsPreserveCoverage: 0 + alphaTestReferenceValue: 0.5 + mipMapFadeDistanceStart: 1 + mipMapFadeDistanceEnd: 3 + bumpmap: + convertToNormalMap: 0 + externalNormalMap: 0 + heightScale: 0.25 + normalMapFilter: 0 + isReadable: 0 + streamingMipmaps: 0 + streamingMipmapsPriority: 0 + grayScaleToAlpha: 0 + generateCubemap: 6 + cubemapConvolution: 0 + seamlessCubemap: 0 + textureFormat: 1 + maxTextureSize: 2048 + textureSettings: + serializedVersion: 2 + filterMode: 0 + aniso: 1 + mipBias: -100 + wrapU: 1 + wrapV: 1 + wrapW: 1 + nPOTScale: 0 + lightmap: 0 + compressionQuality: 50 + spriteMode: 0 + spriteExtrude: 1 + spriteMeshType: 1 + alignment: 0 + spritePivot: {x: 0.5, y: 0.5} + spritePixelsToUnits: 100 + spriteBorder: {x: 0, y: 0, z: 0, w: 0} + spriteGenerateFallbackPhysicsShape: 1 + alphaUsage: 1 + alphaIsTransparency: 1 + spriteTessellationDetail: -1 + textureType: 2 + textureShape: 1 + singleChannelComponent: 0 + maxTextureSizeSet: 0 + compressionQualitySet: 0 + textureFormatSet: 0 + platformSettings: + - serializedVersion: 2 + buildTarget: DefaultTexturePlatform + maxTextureSize: 2048 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 0 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + androidETC2FallbackOverride: 0 + - serializedVersion: 2 + buildTarget: Standalone + maxTextureSize: 2048 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 0 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + androidETC2FallbackOverride: 0 + - serializedVersion: 2 + buildTarget: WebGL + maxTextureSize: 2048 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 0 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + androidETC2FallbackOverride: 0 + spriteSheet: + serializedVersion: 2 + sprites: [] + outline: [] + physicsShape: [] + bones: [] + spriteID: + vertices: [] + indices: + edges: [] + weights: [] + spritePackingTag: + pSDRemoveMatte: 0 + pSDShowRemoveMatteOption: 0 + userData: + assetBundleName: + assetBundleVariant: diff --git a/LocalPackages/net.peeweek.gameplay-ingredients/Icons/Events/ic-event-message.png b/LocalPackages/net.peeweek.gameplay-ingredients/Icons/Events/ic-event-message.png new file mode 100644 index 0000000..48e50d8 --- /dev/null +++ b/LocalPackages/net.peeweek.gameplay-ingredients/Icons/Events/ic-event-message.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:86dd1a7f63701303e9f7cc8a5379e4af2603a9cab1c424c22f8da3bccf638aa1 +size 863 diff --git a/LocalPackages/net.peeweek.gameplay-ingredients/Icons/Events/ic-event-message.png.meta b/LocalPackages/net.peeweek.gameplay-ingredients/Icons/Events/ic-event-message.png.meta new file mode 100644 index 0000000..3dd1031 --- /dev/null +++ b/LocalPackages/net.peeweek.gameplay-ingredients/Icons/Events/ic-event-message.png.meta @@ -0,0 +1,110 @@ +fileFormatVersion: 2 +guid: e6ec4d94329af0a41a3604eb20f8c691 +TextureImporter: + fileIDToRecycleName: {} + externalObjects: {} + serializedVersion: 9 + mipmaps: + mipMapMode: 0 + enableMipMap: 0 + sRGBTexture: 1 + linearTexture: 0 + fadeOut: 0 + borderMipMap: 0 + mipMapsPreserveCoverage: 0 + alphaTestReferenceValue: 0.5 + mipMapFadeDistanceStart: 1 + mipMapFadeDistanceEnd: 3 + bumpmap: + convertToNormalMap: 0 + externalNormalMap: 0 + heightScale: 0.25 + normalMapFilter: 0 + isReadable: 0 + streamingMipmaps: 0 + streamingMipmapsPriority: 0 + grayScaleToAlpha: 0 + generateCubemap: 6 + cubemapConvolution: 0 + seamlessCubemap: 0 + textureFormat: 1 + maxTextureSize: 2048 + textureSettings: + serializedVersion: 2 + filterMode: 0 + aniso: 1 + mipBias: -100 + wrapU: 1 + wrapV: 1 + wrapW: 1 + nPOTScale: 0 + lightmap: 0 + compressionQuality: 50 + spriteMode: 0 + spriteExtrude: 1 + spriteMeshType: 1 + alignment: 0 + spritePivot: {x: 0.5, y: 0.5} + spritePixelsToUnits: 100 + spriteBorder: {x: 0, y: 0, z: 0, w: 0} + spriteGenerateFallbackPhysicsShape: 1 + alphaUsage: 1 + alphaIsTransparency: 1 + spriteTessellationDetail: -1 + textureType: 2 + textureShape: 1 + singleChannelComponent: 0 + maxTextureSizeSet: 0 + compressionQualitySet: 0 + textureFormatSet: 0 + platformSettings: + - serializedVersion: 2 + buildTarget: DefaultTexturePlatform + maxTextureSize: 2048 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 0 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + androidETC2FallbackOverride: 0 + - serializedVersion: 2 + buildTarget: Standalone + maxTextureSize: 2048 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 0 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + androidETC2FallbackOverride: 0 + - serializedVersion: 2 + buildTarget: WebGL + maxTextureSize: 2048 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 0 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + androidETC2FallbackOverride: 0 + spriteSheet: + serializedVersion: 2 + sprites: [] + outline: [] + physicsShape: [] + bones: [] + spriteID: + vertices: [] + indices: + edges: [] + weights: [] + spritePackingTag: + pSDRemoveMatte: 0 + pSDShowRemoveMatteOption: 0 + userData: + assetBundleName: + assetBundleVariant: diff --git a/LocalPackages/net.peeweek.gameplay-ingredients/Icons/Events/ic-event-start.png b/LocalPackages/net.peeweek.gameplay-ingredients/Icons/Events/ic-event-start.png new file mode 100644 index 0000000..86fb5b9 --- /dev/null +++ b/LocalPackages/net.peeweek.gameplay-ingredients/Icons/Events/ic-event-start.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:eb312edfc2c23db5d6cc98f7ca1e462a246520ee9d867b761021e461887b2717 +size 1488 diff --git a/LocalPackages/net.peeweek.gameplay-ingredients/Icons/Events/ic-event-start.png.meta b/LocalPackages/net.peeweek.gameplay-ingredients/Icons/Events/ic-event-start.png.meta new file mode 100644 index 0000000..09c7881 --- /dev/null +++ b/LocalPackages/net.peeweek.gameplay-ingredients/Icons/Events/ic-event-start.png.meta @@ -0,0 +1,110 @@ +fileFormatVersion: 2 +guid: bfd8018fed1fdd84ea969e58a0cb01b8 +TextureImporter: + fileIDToRecycleName: {} + externalObjects: {} + serializedVersion: 9 + mipmaps: + mipMapMode: 0 + enableMipMap: 0 + sRGBTexture: 1 + linearTexture: 0 + fadeOut: 0 + borderMipMap: 0 + mipMapsPreserveCoverage: 0 + alphaTestReferenceValue: 0.5 + mipMapFadeDistanceStart: 1 + mipMapFadeDistanceEnd: 3 + bumpmap: + convertToNormalMap: 0 + externalNormalMap: 0 + heightScale: 0.25 + normalMapFilter: 0 + isReadable: 0 + streamingMipmaps: 0 + streamingMipmapsPriority: 0 + grayScaleToAlpha: 0 + generateCubemap: 6 + cubemapConvolution: 0 + seamlessCubemap: 0 + textureFormat: 1 + maxTextureSize: 2048 + textureSettings: + serializedVersion: 2 + filterMode: 0 + aniso: 1 + mipBias: -100 + wrapU: 1 + wrapV: 1 + wrapW: 1 + nPOTScale: 0 + lightmap: 0 + compressionQuality: 50 + spriteMode: 0 + spriteExtrude: 1 + spriteMeshType: 1 + alignment: 0 + spritePivot: {x: 0.5, y: 0.5} + spritePixelsToUnits: 100 + spriteBorder: {x: 0, y: 0, z: 0, w: 0} + spriteGenerateFallbackPhysicsShape: 1 + alphaUsage: 1 + alphaIsTransparency: 1 + spriteTessellationDetail: -1 + textureType: 2 + textureShape: 1 + singleChannelComponent: 0 + maxTextureSizeSet: 0 + compressionQualitySet: 0 + textureFormatSet: 0 + platformSettings: + - serializedVersion: 2 + buildTarget: DefaultTexturePlatform + maxTextureSize: 2048 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 0 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + androidETC2FallbackOverride: 0 + - serializedVersion: 2 + buildTarget: Standalone + maxTextureSize: 2048 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 0 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + androidETC2FallbackOverride: 0 + - serializedVersion: 2 + buildTarget: WebGL + maxTextureSize: 2048 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 0 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + androidETC2FallbackOverride: 0 + spriteSheet: + serializedVersion: 2 + sprites: [] + outline: [] + physicsShape: [] + bones: [] + spriteID: + vertices: [] + indices: + edges: [] + weights: [] + spritePackingTag: + pSDRemoveMatte: 0 + pSDShowRemoveMatteOption: 0 + userData: + assetBundleName: + assetBundleVariant: diff --git a/LocalPackages/net.peeweek.gameplay-ingredients/Icons/Events/ic-event-trigger.png b/LocalPackages/net.peeweek.gameplay-ingredients/Icons/Events/ic-event-trigger.png new file mode 100644 index 0000000..93840ab --- /dev/null +++ b/LocalPackages/net.peeweek.gameplay-ingredients/Icons/Events/ic-event-trigger.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:9a58eedc3a0c2085730ebf1c94acb6e8f780367849113fd8746a871a7727d5b2 +size 1753 diff --git a/LocalPackages/net.peeweek.gameplay-ingredients/Icons/Events/ic-event-trigger.png.meta b/LocalPackages/net.peeweek.gameplay-ingredients/Icons/Events/ic-event-trigger.png.meta new file mode 100644 index 0000000..34e326c --- /dev/null +++ b/LocalPackages/net.peeweek.gameplay-ingredients/Icons/Events/ic-event-trigger.png.meta @@ -0,0 +1,110 @@ +fileFormatVersion: 2 +guid: 6059a3dad39232d428c4045188ba78a7 +TextureImporter: + fileIDToRecycleName: {} + externalObjects: {} + serializedVersion: 9 + mipmaps: + mipMapMode: 0 + enableMipMap: 0 + sRGBTexture: 1 + linearTexture: 0 + fadeOut: 0 + borderMipMap: 0 + mipMapsPreserveCoverage: 0 + alphaTestReferenceValue: 0.5 + mipMapFadeDistanceStart: 1 + mipMapFadeDistanceEnd: 3 + bumpmap: + convertToNormalMap: 0 + externalNormalMap: 0 + heightScale: 0.25 + normalMapFilter: 0 + isReadable: 0 + streamingMipmaps: 0 + streamingMipmapsPriority: 0 + grayScaleToAlpha: 0 + generateCubemap: 6 + cubemapConvolution: 0 + seamlessCubemap: 0 + textureFormat: 1 + maxTextureSize: 2048 + textureSettings: + serializedVersion: 2 + filterMode: 0 + aniso: 1 + mipBias: -100 + wrapU: 1 + wrapV: 1 + wrapW: 1 + nPOTScale: 0 + lightmap: 0 + compressionQuality: 50 + spriteMode: 0 + spriteExtrude: 1 + spriteMeshType: 1 + alignment: 0 + spritePivot: {x: 0.5, y: 0.5} + spritePixelsToUnits: 100 + spriteBorder: {x: 0, y: 0, z: 0, w: 0} + spriteGenerateFallbackPhysicsShape: 1 + alphaUsage: 1 + alphaIsTransparency: 1 + spriteTessellationDetail: -1 + textureType: 2 + textureShape: 1 + singleChannelComponent: 0 + maxTextureSizeSet: 0 + compressionQualitySet: 0 + textureFormatSet: 0 + platformSettings: + - serializedVersion: 2 + buildTarget: DefaultTexturePlatform + maxTextureSize: 2048 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 0 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + androidETC2FallbackOverride: 0 + - serializedVersion: 2 + buildTarget: Standalone + maxTextureSize: 2048 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 0 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + androidETC2FallbackOverride: 0 + - serializedVersion: 2 + buildTarget: WebGL + maxTextureSize: 2048 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 0 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + androidETC2FallbackOverride: 0 + spriteSheet: + serializedVersion: 2 + sprites: [] + outline: [] + physicsShape: [] + bones: [] + spriteID: + vertices: [] + indices: + edges: [] + weights: [] + spritePackingTag: + pSDRemoveMatte: 0 + pSDShowRemoveMatteOption: 0 + userData: + assetBundleName: + assetBundleVariant: diff --git a/LocalPackages/net.peeweek.gameplay-ingredients/Icons/GUI.meta b/LocalPackages/net.peeweek.gameplay-ingredients/Icons/GUI.meta new file mode 100644 index 0000000..1b78472 --- /dev/null +++ b/LocalPackages/net.peeweek.gameplay-ingredients/Icons/GUI.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: c8cc2d9315d128b4da539334b427e1b3 +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/LocalPackages/net.peeweek.gameplay-ingredients/Icons/GUI/Camera16x16.afdesign b/LocalPackages/net.peeweek.gameplay-ingredients/Icons/GUI/Camera16x16.afdesign new file mode 100644 index 0000000..57254ab Binary files /dev/null and b/LocalPackages/net.peeweek.gameplay-ingredients/Icons/GUI/Camera16x16.afdesign differ diff --git a/LocalPackages/net.peeweek.gameplay-ingredients/Icons/GUI/Camera16x16.afdesign.meta b/LocalPackages/net.peeweek.gameplay-ingredients/Icons/GUI/Camera16x16.afdesign.meta new file mode 100644 index 0000000..c4fea07 --- /dev/null +++ b/LocalPackages/net.peeweek.gameplay-ingredients/Icons/GUI/Camera16x16.afdesign.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: 2ef1c8f31345b514192da2bb177bb7ee +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/LocalPackages/net.peeweek.gameplay-ingredients/Icons/GUI/Camera16x16.png b/LocalPackages/net.peeweek.gameplay-ingredients/Icons/GUI/Camera16x16.png new file mode 100644 index 0000000..bf98095 --- /dev/null +++ b/LocalPackages/net.peeweek.gameplay-ingredients/Icons/GUI/Camera16x16.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:89af4a3657f8119c3bf3c10514356e068a8b81e5fc22185f26354bd1372a2d2e +size 3168 diff --git a/LocalPackages/net.peeweek.gameplay-ingredients/Icons/GUI/Camera16x16.png.meta b/LocalPackages/net.peeweek.gameplay-ingredients/Icons/GUI/Camera16x16.png.meta new file mode 100644 index 0000000..212d4a5 --- /dev/null +++ b/LocalPackages/net.peeweek.gameplay-ingredients/Icons/GUI/Camera16x16.png.meta @@ -0,0 +1,110 @@ +fileFormatVersion: 2 +guid: 7734551df2d0345458df4e98c5483de4 +TextureImporter: + fileIDToRecycleName: {} + externalObjects: {} + serializedVersion: 7 + mipmaps: + mipMapMode: 0 + enableMipMap: 0 + sRGBTexture: 1 + linearTexture: 0 + fadeOut: 0 + borderMipMap: 0 + mipMapsPreserveCoverage: 0 + alphaTestReferenceValue: 0.5 + mipMapFadeDistanceStart: 1 + mipMapFadeDistanceEnd: 3 + bumpmap: + convertToNormalMap: 0 + externalNormalMap: 0 + heightScale: 0.25 + normalMapFilter: 0 + isReadable: 0 + streamingMipmaps: 0 + streamingMipmapsPriority: 0 + grayScaleToAlpha: 0 + generateCubemap: 6 + cubemapConvolution: 0 + seamlessCubemap: 0 + textureFormat: 1 + maxTextureSize: 2048 + textureSettings: + serializedVersion: 2 + filterMode: -1 + aniso: 1 + mipBias: -100 + wrapU: 1 + wrapV: 1 + wrapW: -1 + nPOTScale: 0 + lightmap: 0 + compressionQuality: 50 + spriteMode: 0 + spriteExtrude: 1 + spriteMeshType: 1 + alignment: 0 + spritePivot: {x: 0.5, y: 0.5} + spritePixelsToUnits: 100 + spriteBorder: {x: 0, y: 0, z: 0, w: 0} + spriteGenerateFallbackPhysicsShape: 1 + alphaUsage: 1 + alphaIsTransparency: 1 + spriteTessellationDetail: -1 + textureType: 2 + textureShape: 1 + singleChannelComponent: 0 + maxTextureSizeSet: 0 + compressionQualitySet: 0 + textureFormatSet: 0 + platformSettings: + - serializedVersion: 2 + buildTarget: DefaultTexturePlatform + maxTextureSize: 2048 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 1 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + androidETC2FallbackOverride: 0 + - serializedVersion: 2 + buildTarget: Standalone + maxTextureSize: 2048 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 1 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + androidETC2FallbackOverride: 0 + - serializedVersion: 2 + buildTarget: WebGL + maxTextureSize: 2048 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 1 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + androidETC2FallbackOverride: 0 + spriteSheet: + serializedVersion: 2 + sprites: [] + outline: [] + physicsShape: [] + bones: [] + spriteID: + vertices: [] + indices: + edges: [] + weights: [] + spritePackingTag: + pSDRemoveMatte: 0 + pSDShowRemoveMatteOption: 0 + userData: + assetBundleName: + assetBundleVariant: diff --git a/LocalPackages/net.peeweek.gameplay-ingredients/Icons/GameLevel Icon.png b/LocalPackages/net.peeweek.gameplay-ingredients/Icons/GameLevel Icon.png new file mode 100644 index 0000000..7cb286f --- /dev/null +++ b/LocalPackages/net.peeweek.gameplay-ingredients/Icons/GameLevel Icon.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:32a66e5bfa9cd75e48585a2d0da0ac964ae1c1de54b111610901277756986e6a +size 13395 diff --git a/LocalPackages/net.peeweek.gameplay-ingredients/Icons/GameLevel Icon.png.meta b/LocalPackages/net.peeweek.gameplay-ingredients/Icons/GameLevel Icon.png.meta new file mode 100644 index 0000000..ceb75cc --- /dev/null +++ b/LocalPackages/net.peeweek.gameplay-ingredients/Icons/GameLevel Icon.png.meta @@ -0,0 +1,127 @@ +fileFormatVersion: 2 +guid: 9921921a4e899394dbc39b4b38db93ef +TextureImporter: + internalIDToNameTable: [] + externalObjects: {} + serializedVersion: 10 + mipmaps: + mipMapMode: 0 + enableMipMap: 0 + sRGBTexture: 1 + linearTexture: 0 + fadeOut: 0 + borderMipMap: 0 + mipMapsPreserveCoverage: 0 + alphaTestReferenceValue: 0.5 + mipMapFadeDistanceStart: 1 + mipMapFadeDistanceEnd: 3 + bumpmap: + convertToNormalMap: 0 + externalNormalMap: 0 + heightScale: 0.25 + normalMapFilter: 0 + isReadable: 0 + streamingMipmaps: 0 + streamingMipmapsPriority: 0 + grayScaleToAlpha: 0 + generateCubemap: 6 + cubemapConvolution: 0 + seamlessCubemap: 0 + textureFormat: 1 + maxTextureSize: 2048 + textureSettings: + serializedVersion: 2 + filterMode: -1 + aniso: 1 + mipBias: -100 + wrapU: 1 + wrapV: 1 + wrapW: -1 + nPOTScale: 0 + lightmap: 0 + compressionQuality: 50 + spriteMode: 0 + spriteExtrude: 1 + spriteMeshType: 1 + alignment: 0 + spritePivot: {x: 0.5, y: 0.5} + spritePixelsToUnits: 100 + spriteBorder: {x: 0, y: 0, z: 0, w: 0} + spriteGenerateFallbackPhysicsShape: 1 + alphaUsage: 1 + alphaIsTransparency: 1 + spriteTessellationDetail: -1 + textureType: 2 + textureShape: 1 + singleChannelComponent: 0 + maxTextureSizeSet: 0 + compressionQualitySet: 0 + textureFormatSet: 0 + platformSettings: + - serializedVersion: 3 + buildTarget: DefaultTexturePlatform + maxTextureSize: 2048 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 0 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + androidETC2FallbackOverride: 0 + forceMaximumCompressionQuality_BC6H_BC7: 0 + - serializedVersion: 3 + buildTarget: Standalone + maxTextureSize: 2048 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 0 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + androidETC2FallbackOverride: 0 + forceMaximumCompressionQuality_BC6H_BC7: 0 + - serializedVersion: 3 + buildTarget: PS4 + maxTextureSize: 2048 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 0 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + androidETC2FallbackOverride: 0 + forceMaximumCompressionQuality_BC6H_BC7: 0 + - serializedVersion: 3 + buildTarget: XboxOne + maxTextureSize: 2048 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 0 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + androidETC2FallbackOverride: 0 + forceMaximumCompressionQuality_BC6H_BC7: 0 + spriteSheet: + serializedVersion: 2 + sprites: [] + outline: [] + physicsShape: [] + bones: [] + spriteID: + internalID: 0 + vertices: [] + indices: + edges: [] + weights: [] + secondaryTextures: [] + spritePackingTag: + pSDRemoveMatte: 0 + pSDShowRemoveMatteOption: 0 + userData: + assetBundleName: + assetBundleVariant: diff --git a/LocalPackages/net.peeweek.gameplay-ingredients/Icons/GameManager Icon.png b/LocalPackages/net.peeweek.gameplay-ingredients/Icons/GameManager Icon.png new file mode 100644 index 0000000..c0b726c --- /dev/null +++ b/LocalPackages/net.peeweek.gameplay-ingredients/Icons/GameManager Icon.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:ab50f89e2a9e9958c58bcd8ca02a084de97a6ad850a20dfa4afdb80dcb8226ae +size 1146 diff --git a/LocalPackages/net.peeweek.gameplay-ingredients/Icons/GameManager Icon.png.meta b/LocalPackages/net.peeweek.gameplay-ingredients/Icons/GameManager Icon.png.meta new file mode 100644 index 0000000..011fef8 --- /dev/null +++ b/LocalPackages/net.peeweek.gameplay-ingredients/Icons/GameManager Icon.png.meta @@ -0,0 +1,127 @@ +fileFormatVersion: 2 +guid: af9148c7de0fc6444b7e4e050f116dd0 +TextureImporter: + internalIDToNameTable: [] + externalObjects: {} + serializedVersion: 10 + mipmaps: + mipMapMode: 0 + enableMipMap: 0 + sRGBTexture: 1 + linearTexture: 0 + fadeOut: 0 + borderMipMap: 0 + mipMapsPreserveCoverage: 0 + alphaTestReferenceValue: 0.5 + mipMapFadeDistanceStart: 1 + mipMapFadeDistanceEnd: 3 + bumpmap: + convertToNormalMap: 0 + externalNormalMap: 0 + heightScale: 0.25 + normalMapFilter: 0 + isReadable: 0 + streamingMipmaps: 0 + streamingMipmapsPriority: 0 + grayScaleToAlpha: 0 + generateCubemap: 6 + cubemapConvolution: 0 + seamlessCubemap: 0 + textureFormat: 1 + maxTextureSize: 2048 + textureSettings: + serializedVersion: 2 + filterMode: -1 + aniso: 1 + mipBias: -100 + wrapU: 1 + wrapV: 1 + wrapW: -1 + nPOTScale: 0 + lightmap: 0 + compressionQuality: 50 + spriteMode: 0 + spriteExtrude: 1 + spriteMeshType: 1 + alignment: 0 + spritePivot: {x: 0.5, y: 0.5} + spritePixelsToUnits: 100 + spriteBorder: {x: 0, y: 0, z: 0, w: 0} + spriteGenerateFallbackPhysicsShape: 1 + alphaUsage: 1 + alphaIsTransparency: 1 + spriteTessellationDetail: -1 + textureType: 2 + textureShape: 1 + singleChannelComponent: 0 + maxTextureSizeSet: 0 + compressionQualitySet: 0 + textureFormatSet: 0 + platformSettings: + - serializedVersion: 3 + buildTarget: DefaultTexturePlatform + maxTextureSize: 2048 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 0 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + androidETC2FallbackOverride: 0 + forceMaximumCompressionQuality_BC6H_BC7: 0 + - serializedVersion: 3 + buildTarget: Standalone + maxTextureSize: 2048 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 0 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + androidETC2FallbackOverride: 0 + forceMaximumCompressionQuality_BC6H_BC7: 0 + - serializedVersion: 3 + buildTarget: PS4 + maxTextureSize: 2048 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 0 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + androidETC2FallbackOverride: 0 + forceMaximumCompressionQuality_BC6H_BC7: 0 + - serializedVersion: 3 + buildTarget: XboxOne + maxTextureSize: 2048 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 0 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + androidETC2FallbackOverride: 0 + forceMaximumCompressionQuality_BC6H_BC7: 0 + spriteSheet: + serializedVersion: 2 + sprites: [] + outline: [] + physicsShape: [] + bones: [] + spriteID: + internalID: 0 + vertices: [] + indices: + edges: [] + weights: [] + secondaryTextures: [] + spritePackingTag: + pSDRemoveMatte: 0 + pSDShowRemoveMatteOption: 0 + userData: + assetBundleName: + assetBundleVariant: diff --git a/LocalPackages/net.peeweek.gameplay-ingredients/Icons/Logic.meta b/LocalPackages/net.peeweek.gameplay-ingredients/Icons/Logic.meta new file mode 100644 index 0000000..4368b26 --- /dev/null +++ b/LocalPackages/net.peeweek.gameplay-ingredients/Icons/Logic.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 6f57b05c328da2343b6cd688603a4148 +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/LocalPackages/net.peeweek.gameplay-ingredients/Icons/Logic/ic-generic-logic.png b/LocalPackages/net.peeweek.gameplay-ingredients/Icons/Logic/ic-generic-logic.png new file mode 100644 index 0000000..eb44638 --- /dev/null +++ b/LocalPackages/net.peeweek.gameplay-ingredients/Icons/Logic/ic-generic-logic.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:73e3a497bac230f4f21f86c7cf324958a2313459ec0ddad645e6c8a645598753 +size 630 diff --git a/LocalPackages/net.peeweek.gameplay-ingredients/Icons/Logic/ic-generic-logic.png.meta b/LocalPackages/net.peeweek.gameplay-ingredients/Icons/Logic/ic-generic-logic.png.meta new file mode 100644 index 0000000..f27c905 --- /dev/null +++ b/LocalPackages/net.peeweek.gameplay-ingredients/Icons/Logic/ic-generic-logic.png.meta @@ -0,0 +1,110 @@ +fileFormatVersion: 2 +guid: 6d0a734cdedf48d478f3fcc7612af66f +TextureImporter: + fileIDToRecycleName: {} + externalObjects: {} + serializedVersion: 9 + mipmaps: + mipMapMode: 0 + enableMipMap: 0 + sRGBTexture: 1 + linearTexture: 0 + fadeOut: 0 + borderMipMap: 0 + mipMapsPreserveCoverage: 0 + alphaTestReferenceValue: 0.5 + mipMapFadeDistanceStart: 1 + mipMapFadeDistanceEnd: 3 + bumpmap: + convertToNormalMap: 0 + externalNormalMap: 0 + heightScale: 0.25 + normalMapFilter: 0 + isReadable: 0 + streamingMipmaps: 0 + streamingMipmapsPriority: 0 + grayScaleToAlpha: 0 + generateCubemap: 6 + cubemapConvolution: 0 + seamlessCubemap: 0 + textureFormat: 1 + maxTextureSize: 2048 + textureSettings: + serializedVersion: 2 + filterMode: 0 + aniso: 1 + mipBias: -100 + wrapU: 1 + wrapV: 1 + wrapW: -1 + nPOTScale: 0 + lightmap: 0 + compressionQuality: 50 + spriteMode: 1 + spriteExtrude: 1 + spriteMeshType: 1 + alignment: 0 + spritePivot: {x: 0.5, y: 0.5} + spritePixelsToUnits: 100 + spriteBorder: {x: 0, y: 0, z: 0, w: 0} + spriteGenerateFallbackPhysicsShape: 1 + alphaUsage: 1 + alphaIsTransparency: 1 + spriteTessellationDetail: -1 + textureType: 2 + textureShape: 1 + singleChannelComponent: 0 + maxTextureSizeSet: 0 + compressionQualitySet: 0 + textureFormatSet: 0 + platformSettings: + - serializedVersion: 2 + buildTarget: DefaultTexturePlatform + maxTextureSize: 2048 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 0 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + androidETC2FallbackOverride: 0 + - serializedVersion: 2 + buildTarget: Standalone + maxTextureSize: 2048 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 0 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + androidETC2FallbackOverride: 0 + - serializedVersion: 2 + buildTarget: WebGL + maxTextureSize: 2048 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 0 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + androidETC2FallbackOverride: 0 + spriteSheet: + serializedVersion: 2 + sprites: [] + outline: [] + physicsShape: [] + bones: [] + spriteID: + vertices: [] + indices: + edges: [] + weights: [] + spritePackingTag: + pSDRemoveMatte: 0 + pSDShowRemoveMatteOption: 0 + userData: + assetBundleName: + assetBundleVariant: diff --git a/LocalPackages/net.peeweek.gameplay-ingredients/Icons/Misc.meta b/LocalPackages/net.peeweek.gameplay-ingredients/Icons/Misc.meta new file mode 100644 index 0000000..7879a4d --- /dev/null +++ b/LocalPackages/net.peeweek.gameplay-ingredients/Icons/Misc.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 8078580a0939f9f45bcdea3be1743e36 +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/LocalPackages/net.peeweek.gameplay-ingredients/Icons/Misc/ic-State.png b/LocalPackages/net.peeweek.gameplay-ingredients/Icons/Misc/ic-State.png new file mode 100644 index 0000000..09be947 --- /dev/null +++ b/LocalPackages/net.peeweek.gameplay-ingredients/Icons/Misc/ic-State.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:4c29f0a4c97219686ada31fbdf6d79d5b2052dac1ac10a63852b2fed26ad0ae6 +size 2064 diff --git a/LocalPackages/net.peeweek.gameplay-ingredients/Icons/Misc/ic-State.png.meta b/LocalPackages/net.peeweek.gameplay-ingredients/Icons/Misc/ic-State.png.meta new file mode 100644 index 0000000..a62284c --- /dev/null +++ b/LocalPackages/net.peeweek.gameplay-ingredients/Icons/Misc/ic-State.png.meta @@ -0,0 +1,121 @@ +fileFormatVersion: 2 +guid: 9a6d608cab373164f8112f6cc8ae6255 +TextureImporter: + fileIDToRecycleName: {} + externalObjects: {} + serializedVersion: 9 + mipmaps: + mipMapMode: 0 + enableMipMap: 0 + sRGBTexture: 1 + linearTexture: 0 + fadeOut: 0 + borderMipMap: 0 + mipMapsPreserveCoverage: 0 + alphaTestReferenceValue: 0.5 + mipMapFadeDistanceStart: 1 + mipMapFadeDistanceEnd: 3 + bumpmap: + convertToNormalMap: 0 + externalNormalMap: 0 + heightScale: 0.25 + normalMapFilter: 0 + isReadable: 0 + streamingMipmaps: 0 + streamingMipmapsPriority: 0 + grayScaleToAlpha: 0 + generateCubemap: 6 + cubemapConvolution: 0 + seamlessCubemap: 0 + textureFormat: 1 + maxTextureSize: 2048 + textureSettings: + serializedVersion: 2 + filterMode: 0 + aniso: 1 + mipBias: -100 + wrapU: 1 + wrapV: 1 + wrapW: -1 + nPOTScale: 0 + lightmap: 0 + compressionQuality: 50 + spriteMode: 0 + spriteExtrude: 1 + spriteMeshType: 1 + alignment: 0 + spritePivot: {x: 0.5, y: 0.5} + spritePixelsToUnits: 100 + spriteBorder: {x: 0, y: 0, z: 0, w: 0} + spriteGenerateFallbackPhysicsShape: 1 + alphaUsage: 1 + alphaIsTransparency: 1 + spriteTessellationDetail: -1 + textureType: 2 + textureShape: 1 + singleChannelComponent: 0 + maxTextureSizeSet: 0 + compressionQualitySet: 0 + textureFormatSet: 0 + platformSettings: + - serializedVersion: 2 + buildTarget: DefaultTexturePlatform + maxTextureSize: 2048 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 0 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + androidETC2FallbackOverride: 0 + - serializedVersion: 2 + buildTarget: Standalone + maxTextureSize: 2048 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 0 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + androidETC2FallbackOverride: 0 + - serializedVersion: 2 + buildTarget: Android + maxTextureSize: 2048 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 0 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + androidETC2FallbackOverride: 0 + - serializedVersion: 2 + buildTarget: PS4 + maxTextureSize: 2048 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 0 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + androidETC2FallbackOverride: 0 + spriteSheet: + serializedVersion: 2 + sprites: [] + outline: [] + physicsShape: [] + bones: [] + spriteID: + vertices: [] + indices: + edges: [] + weights: [] + spritePackingTag: + pSDRemoveMatte: 0 + pSDShowRemoveMatteOption: 0 + userData: + assetBundleName: + assetBundleVariant: diff --git a/LocalPackages/net.peeweek.gameplay-ingredients/Icons/Misc/ic-StateMachine-SetState.png b/LocalPackages/net.peeweek.gameplay-ingredients/Icons/Misc/ic-StateMachine-SetState.png new file mode 100644 index 0000000..eb03e21 --- /dev/null +++ b/LocalPackages/net.peeweek.gameplay-ingredients/Icons/Misc/ic-StateMachine-SetState.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:4fef25ec7454ea46190e0de779ed63ccbcd7d9d5c6863bb21e3c78da94abb590 +size 1726 diff --git a/LocalPackages/net.peeweek.gameplay-ingredients/Icons/Misc/ic-StateMachine-SetState.png.meta b/LocalPackages/net.peeweek.gameplay-ingredients/Icons/Misc/ic-StateMachine-SetState.png.meta new file mode 100644 index 0000000..0ad644e --- /dev/null +++ b/LocalPackages/net.peeweek.gameplay-ingredients/Icons/Misc/ic-StateMachine-SetState.png.meta @@ -0,0 +1,121 @@ +fileFormatVersion: 2 +guid: 7bae8630e4a1b2040b3db5d53120c9a8 +TextureImporter: + fileIDToRecycleName: {} + externalObjects: {} + serializedVersion: 9 + mipmaps: + mipMapMode: 0 + enableMipMap: 0 + sRGBTexture: 1 + linearTexture: 0 + fadeOut: 0 + borderMipMap: 0 + mipMapsPreserveCoverage: 0 + alphaTestReferenceValue: 0.5 + mipMapFadeDistanceStart: 1 + mipMapFadeDistanceEnd: 3 + bumpmap: + convertToNormalMap: 0 + externalNormalMap: 0 + heightScale: 0.25 + normalMapFilter: 0 + isReadable: 0 + streamingMipmaps: 0 + streamingMipmapsPriority: 0 + grayScaleToAlpha: 0 + generateCubemap: 6 + cubemapConvolution: 0 + seamlessCubemap: 0 + textureFormat: 1 + maxTextureSize: 2048 + textureSettings: + serializedVersion: 2 + filterMode: 0 + aniso: 1 + mipBias: -100 + wrapU: 1 + wrapV: 1 + wrapW: -1 + nPOTScale: 0 + lightmap: 0 + compressionQuality: 50 + spriteMode: 0 + spriteExtrude: 1 + spriteMeshType: 1 + alignment: 0 + spritePivot: {x: 0.5, y: 0.5} + spritePixelsToUnits: 100 + spriteBorder: {x: 0, y: 0, z: 0, w: 0} + spriteGenerateFallbackPhysicsShape: 1 + alphaUsage: 1 + alphaIsTransparency: 1 + spriteTessellationDetail: -1 + textureType: 2 + textureShape: 1 + singleChannelComponent: 0 + maxTextureSizeSet: 0 + compressionQualitySet: 0 + textureFormatSet: 0 + platformSettings: + - serializedVersion: 2 + buildTarget: DefaultTexturePlatform + maxTextureSize: 2048 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 0 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + androidETC2FallbackOverride: 0 + - serializedVersion: 2 + buildTarget: Standalone + maxTextureSize: 2048 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 0 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + androidETC2FallbackOverride: 0 + - serializedVersion: 2 + buildTarget: Android + maxTextureSize: 2048 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 0 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + androidETC2FallbackOverride: 0 + - serializedVersion: 2 + buildTarget: PS4 + maxTextureSize: 2048 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 0 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + androidETC2FallbackOverride: 0 + spriteSheet: + serializedVersion: 2 + sprites: [] + outline: [] + physicsShape: [] + bones: [] + spriteID: + vertices: [] + indices: + edges: [] + weights: [] + spritePackingTag: + pSDRemoveMatte: 0 + pSDShowRemoveMatteOption: 0 + userData: + assetBundleName: + assetBundleVariant: diff --git a/LocalPackages/net.peeweek.gameplay-ingredients/Icons/Misc/ic-StateMachine.png b/LocalPackages/net.peeweek.gameplay-ingredients/Icons/Misc/ic-StateMachine.png new file mode 100644 index 0000000..b09380f --- /dev/null +++ b/LocalPackages/net.peeweek.gameplay-ingredients/Icons/Misc/ic-StateMachine.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:9497540f4cb2b00bdb11190aa70ce4e1a39bd77162754fd0284da753f0b15898 +size 247 diff --git a/LocalPackages/net.peeweek.gameplay-ingredients/Icons/Misc/ic-StateMachine.png.meta b/LocalPackages/net.peeweek.gameplay-ingredients/Icons/Misc/ic-StateMachine.png.meta new file mode 100644 index 0000000..de68f98 --- /dev/null +++ b/LocalPackages/net.peeweek.gameplay-ingredients/Icons/Misc/ic-StateMachine.png.meta @@ -0,0 +1,110 @@ +fileFormatVersion: 2 +guid: 67330c23d0e574745a580a19a9fa187c +TextureImporter: + fileIDToRecycleName: {} + externalObjects: {} + serializedVersion: 9 + mipmaps: + mipMapMode: 0 + enableMipMap: 0 + sRGBTexture: 1 + linearTexture: 0 + fadeOut: 0 + borderMipMap: 0 + mipMapsPreserveCoverage: 0 + alphaTestReferenceValue: 0.5 + mipMapFadeDistanceStart: 1 + mipMapFadeDistanceEnd: 3 + bumpmap: + convertToNormalMap: 0 + externalNormalMap: 0 + heightScale: 0.25 + normalMapFilter: 0 + isReadable: 0 + streamingMipmaps: 0 + streamingMipmapsPriority: 0 + grayScaleToAlpha: 0 + generateCubemap: 6 + cubemapConvolution: 0 + seamlessCubemap: 0 + textureFormat: 1 + maxTextureSize: 2048 + textureSettings: + serializedVersion: 2 + filterMode: 0 + aniso: 1 + mipBias: -100 + wrapU: 1 + wrapV: 1 + wrapW: -1 + nPOTScale: 0 + lightmap: 0 + compressionQuality: 50 + spriteMode: 0 + spriteExtrude: 1 + spriteMeshType: 1 + alignment: 0 + spritePivot: {x: 0.5, y: 0.5} + spritePixelsToUnits: 100 + spriteBorder: {x: 0, y: 0, z: 0, w: 0} + spriteGenerateFallbackPhysicsShape: 1 + alphaUsage: 1 + alphaIsTransparency: 1 + spriteTessellationDetail: -1 + textureType: 2 + textureShape: 1 + singleChannelComponent: 0 + maxTextureSizeSet: 0 + compressionQualitySet: 0 + textureFormatSet: 0 + platformSettings: + - serializedVersion: 2 + buildTarget: DefaultTexturePlatform + maxTextureSize: 2048 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 0 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + androidETC2FallbackOverride: 0 + - serializedVersion: 2 + buildTarget: Standalone + maxTextureSize: 2048 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 0 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + androidETC2FallbackOverride: 0 + - serializedVersion: 2 + buildTarget: WebGL + maxTextureSize: 2048 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 0 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + androidETC2FallbackOverride: 0 + spriteSheet: + serializedVersion: 2 + sprites: [] + outline: [] + physicsShape: [] + bones: [] + spriteID: + vertices: [] + indices: + edges: [] + weights: [] + spritePackingTag: + pSDRemoveMatte: 0 + pSDShowRemoveMatteOption: 0 + userData: + assetBundleName: + assetBundleVariant: diff --git a/LocalPackages/net.peeweek.gameplay-ingredients/Icons/Misc/ic-callable.png b/LocalPackages/net.peeweek.gameplay-ingredients/Icons/Misc/ic-callable.png new file mode 100644 index 0000000..20162e6 --- /dev/null +++ b/LocalPackages/net.peeweek.gameplay-ingredients/Icons/Misc/ic-callable.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:db5af0208be8e57a28cabdd6fe123def07b5721b2145852083ff7870e0ba2083 +size 2072 diff --git a/LocalPackages/net.peeweek.gameplay-ingredients/Icons/Misc/ic-callable.png.meta b/LocalPackages/net.peeweek.gameplay-ingredients/Icons/Misc/ic-callable.png.meta new file mode 100644 index 0000000..b414291 --- /dev/null +++ b/LocalPackages/net.peeweek.gameplay-ingredients/Icons/Misc/ic-callable.png.meta @@ -0,0 +1,115 @@ +fileFormatVersion: 2 +guid: 322030000d8e32240a902f51e3971ef3 +TextureImporter: + internalIDToNameTable: [] + externalObjects: {} + serializedVersion: 10 + mipmaps: + mipMapMode: 0 + enableMipMap: 0 + sRGBTexture: 1 + linearTexture: 0 + fadeOut: 0 + borderMipMap: 0 + mipMapsPreserveCoverage: 0 + alphaTestReferenceValue: 0.5 + mipMapFadeDistanceStart: 1 + mipMapFadeDistanceEnd: 3 + bumpmap: + convertToNormalMap: 0 + externalNormalMap: 0 + heightScale: 0.25 + normalMapFilter: 0 + isReadable: 0 + streamingMipmaps: 0 + streamingMipmapsPriority: 0 + grayScaleToAlpha: 0 + generateCubemap: 6 + cubemapConvolution: 0 + seamlessCubemap: 0 + textureFormat: 1 + maxTextureSize: 2048 + textureSettings: + serializedVersion: 2 + filterMode: -1 + aniso: 1 + mipBias: -100 + wrapU: 1 + wrapV: 1 + wrapW: -1 + nPOTScale: 0 + lightmap: 0 + compressionQuality: 50 + spriteMode: 0 + spriteExtrude: 1 + spriteMeshType: 1 + alignment: 0 + spritePivot: {x: 0.5, y: 0.5} + spritePixelsToUnits: 100 + spriteBorder: {x: 0, y: 0, z: 0, w: 0} + spriteGenerateFallbackPhysicsShape: 1 + alphaUsage: 1 + alphaIsTransparency: 1 + spriteTessellationDetail: -1 + textureType: 2 + textureShape: 1 + singleChannelComponent: 0 + maxTextureSizeSet: 0 + compressionQualitySet: 0 + textureFormatSet: 0 + platformSettings: + - serializedVersion: 3 + buildTarget: DefaultTexturePlatform + maxTextureSize: 2048 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 0 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + androidETC2FallbackOverride: 0 + forceMaximumCompressionQuality_BC6H_BC7: 0 + - serializedVersion: 3 + buildTarget: Standalone + maxTextureSize: 2048 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 0 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + androidETC2FallbackOverride: 0 + forceMaximumCompressionQuality_BC6H_BC7: 0 + - serializedVersion: 3 + buildTarget: Android + maxTextureSize: 2048 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 0 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + androidETC2FallbackOverride: 0 + forceMaximumCompressionQuality_BC6H_BC7: 0 + spriteSheet: + serializedVersion: 2 + sprites: [] + outline: [] + physicsShape: [] + bones: [] + spriteID: + internalID: 0 + vertices: [] + indices: + edges: [] + weights: [] + secondaryTextures: [] + spritePackingTag: + pSDRemoveMatte: 0 + pSDShowRemoveMatteOption: 0 + userData: + assetBundleName: + assetBundleVariant: diff --git a/LocalPackages/net.peeweek.gameplay-ingredients/Icons/Misc/ic-crate.png b/LocalPackages/net.peeweek.gameplay-ingredients/Icons/Misc/ic-crate.png new file mode 100644 index 0000000..d87678a --- /dev/null +++ b/LocalPackages/net.peeweek.gameplay-ingredients/Icons/Misc/ic-crate.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:c898765b81a60d81cffcdcd40957987fa7562591f0e24978621d9165b831a8ad +size 438 diff --git a/LocalPackages/net.peeweek.gameplay-ingredients/Icons/Misc/ic-crate.png.meta b/LocalPackages/net.peeweek.gameplay-ingredients/Icons/Misc/ic-crate.png.meta new file mode 100644 index 0000000..e6d4406 --- /dev/null +++ b/LocalPackages/net.peeweek.gameplay-ingredients/Icons/Misc/ic-crate.png.meta @@ -0,0 +1,121 @@ +fileFormatVersion: 2 +guid: f115aa500d526c845a48b83c5c18f54a +TextureImporter: + fileIDToRecycleName: {} + externalObjects: {} + serializedVersion: 9 + mipmaps: + mipMapMode: 0 + enableMipMap: 0 + sRGBTexture: 1 + linearTexture: 0 + fadeOut: 0 + borderMipMap: 0 + mipMapsPreserveCoverage: 0 + alphaTestReferenceValue: 0.5 + mipMapFadeDistanceStart: 1 + mipMapFadeDistanceEnd: 3 + bumpmap: + convertToNormalMap: 0 + externalNormalMap: 0 + heightScale: 0.25 + normalMapFilter: 0 + isReadable: 0 + streamingMipmaps: 0 + streamingMipmapsPriority: 0 + grayScaleToAlpha: 0 + generateCubemap: 6 + cubemapConvolution: 0 + seamlessCubemap: 0 + textureFormat: 1 + maxTextureSize: 2048 + textureSettings: + serializedVersion: 2 + filterMode: 0 + aniso: 1 + mipBias: -100 + wrapU: 1 + wrapV: 1 + wrapW: -1 + nPOTScale: 0 + lightmap: 0 + compressionQuality: 50 + spriteMode: 0 + spriteExtrude: 1 + spriteMeshType: 1 + alignment: 0 + spritePivot: {x: 0.5, y: 0.5} + spritePixelsToUnits: 100 + spriteBorder: {x: 0, y: 0, z: 0, w: 0} + spriteGenerateFallbackPhysicsShape: 1 + alphaUsage: 1 + alphaIsTransparency: 1 + spriteTessellationDetail: -1 + textureType: 2 + textureShape: 1 + singleChannelComponent: 0 + maxTextureSizeSet: 0 + compressionQualitySet: 0 + textureFormatSet: 0 + platformSettings: + - serializedVersion: 2 + buildTarget: DefaultTexturePlatform + maxTextureSize: 2048 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 0 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + androidETC2FallbackOverride: 0 + - serializedVersion: 2 + buildTarget: Standalone + maxTextureSize: 2048 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 0 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + androidETC2FallbackOverride: 0 + - serializedVersion: 2 + buildTarget: Android + maxTextureSize: 2048 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 0 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + androidETC2FallbackOverride: 0 + - serializedVersion: 2 + buildTarget: PS4 + maxTextureSize: 2048 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 0 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + androidETC2FallbackOverride: 0 + spriteSheet: + serializedVersion: 2 + sprites: [] + outline: [] + physicsShape: [] + bones: [] + spriteID: + vertices: [] + indices: + edges: [] + weights: [] + spritePackingTag: + pSDRemoveMatte: 0 + pSDShowRemoveMatteOption: 0 + userData: + assetBundleName: + assetBundleVariant: diff --git a/LocalPackages/net.peeweek.gameplay-ingredients/Icons/Misc/ic-factory.png b/LocalPackages/net.peeweek.gameplay-ingredients/Icons/Misc/ic-factory.png new file mode 100644 index 0000000..0c6b484 --- /dev/null +++ b/LocalPackages/net.peeweek.gameplay-ingredients/Icons/Misc/ic-factory.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:3d4b6fc5dc779c8098871d5582df40d479cd709b6369d22c935813cab5e952f4 +size 796 diff --git a/LocalPackages/net.peeweek.gameplay-ingredients/Icons/Misc/ic-factory.png.meta b/LocalPackages/net.peeweek.gameplay-ingredients/Icons/Misc/ic-factory.png.meta new file mode 100644 index 0000000..f95c6df --- /dev/null +++ b/LocalPackages/net.peeweek.gameplay-ingredients/Icons/Misc/ic-factory.png.meta @@ -0,0 +1,121 @@ +fileFormatVersion: 2 +guid: 86f51d6a3e4045449ad420a9150b03a5 +TextureImporter: + fileIDToRecycleName: {} + externalObjects: {} + serializedVersion: 9 + mipmaps: + mipMapMode: 0 + enableMipMap: 0 + sRGBTexture: 1 + linearTexture: 0 + fadeOut: 0 + borderMipMap: 0 + mipMapsPreserveCoverage: 0 + alphaTestReferenceValue: 0.5 + mipMapFadeDistanceStart: 1 + mipMapFadeDistanceEnd: 3 + bumpmap: + convertToNormalMap: 0 + externalNormalMap: 0 + heightScale: 0.25 + normalMapFilter: 0 + isReadable: 0 + streamingMipmaps: 0 + streamingMipmapsPriority: 0 + grayScaleToAlpha: 0 + generateCubemap: 6 + cubemapConvolution: 0 + seamlessCubemap: 0 + textureFormat: 1 + maxTextureSize: 2048 + textureSettings: + serializedVersion: 2 + filterMode: 0 + aniso: 1 + mipBias: -100 + wrapU: 1 + wrapV: 1 + wrapW: -1 + nPOTScale: 0 + lightmap: 0 + compressionQuality: 50 + spriteMode: 0 + spriteExtrude: 1 + spriteMeshType: 1 + alignment: 0 + spritePivot: {x: 0.5, y: 0.5} + spritePixelsToUnits: 100 + spriteBorder: {x: 0, y: 0, z: 0, w: 0} + spriteGenerateFallbackPhysicsShape: 1 + alphaUsage: 1 + alphaIsTransparency: 1 + spriteTessellationDetail: -1 + textureType: 2 + textureShape: 1 + singleChannelComponent: 0 + maxTextureSizeSet: 0 + compressionQualitySet: 0 + textureFormatSet: 0 + platformSettings: + - serializedVersion: 2 + buildTarget: DefaultTexturePlatform + maxTextureSize: 2048 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 0 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + androidETC2FallbackOverride: 0 + - serializedVersion: 2 + buildTarget: Standalone + maxTextureSize: 2048 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 0 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + androidETC2FallbackOverride: 0 + - serializedVersion: 2 + buildTarget: Android + maxTextureSize: 2048 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 0 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + androidETC2FallbackOverride: 0 + - serializedVersion: 2 + buildTarget: PS4 + maxTextureSize: 2048 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 0 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + androidETC2FallbackOverride: 0 + spriteSheet: + serializedVersion: 2 + sprites: [] + outline: [] + physicsShape: [] + bones: [] + spriteID: + vertices: [] + indices: + edges: [] + weights: [] + spritePackingTag: + pSDRemoveMatte: 0 + pSDShowRemoveMatteOption: 0 + userData: + assetBundleName: + assetBundleVariant: diff --git a/LocalPackages/net.peeweek.gameplay-ingredients/Icons/Misc/ic-first-person-controller.png b/LocalPackages/net.peeweek.gameplay-ingredients/Icons/Misc/ic-first-person-controller.png new file mode 100644 index 0000000..135bd3b --- /dev/null +++ b/LocalPackages/net.peeweek.gameplay-ingredients/Icons/Misc/ic-first-person-controller.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:c04ad8eb7b2d45b2c360004e92274f715fe84937f62360b4256cfeee73b4c7c8 +size 744 diff --git a/LocalPackages/net.peeweek.gameplay-ingredients/Icons/Misc/ic-first-person-controller.png.meta b/LocalPackages/net.peeweek.gameplay-ingredients/Icons/Misc/ic-first-person-controller.png.meta new file mode 100644 index 0000000..97ded56 --- /dev/null +++ b/LocalPackages/net.peeweek.gameplay-ingredients/Icons/Misc/ic-first-person-controller.png.meta @@ -0,0 +1,110 @@ +fileFormatVersion: 2 +guid: fe8c9f947e3d1e445a7d3d3c5a1a18ee +TextureImporter: + fileIDToRecycleName: {} + externalObjects: {} + serializedVersion: 9 + mipmaps: + mipMapMode: 0 + enableMipMap: 0 + sRGBTexture: 1 + linearTexture: 0 + fadeOut: 0 + borderMipMap: 0 + mipMapsPreserveCoverage: 0 + alphaTestReferenceValue: 0.5 + mipMapFadeDistanceStart: 1 + mipMapFadeDistanceEnd: 3 + bumpmap: + convertToNormalMap: 0 + externalNormalMap: 0 + heightScale: 0.25 + normalMapFilter: 0 + isReadable: 0 + streamingMipmaps: 0 + streamingMipmapsPriority: 0 + grayScaleToAlpha: 0 + generateCubemap: 6 + cubemapConvolution: 0 + seamlessCubemap: 0 + textureFormat: 1 + maxTextureSize: 2048 + textureSettings: + serializedVersion: 2 + filterMode: 0 + aniso: 1 + mipBias: -100 + wrapU: 1 + wrapV: 1 + wrapW: -1 + nPOTScale: 0 + lightmap: 0 + compressionQuality: 50 + spriteMode: 0 + spriteExtrude: 1 + spriteMeshType: 1 + alignment: 0 + spritePivot: {x: 0.5, y: 0.5} + spritePixelsToUnits: 100 + spriteBorder: {x: 0, y: 0, z: 0, w: 0} + spriteGenerateFallbackPhysicsShape: 1 + alphaUsage: 1 + alphaIsTransparency: 1 + spriteTessellationDetail: -1 + textureType: 2 + textureShape: 1 + singleChannelComponent: 0 + maxTextureSizeSet: 0 + compressionQualitySet: 0 + textureFormatSet: 0 + platformSettings: + - serializedVersion: 2 + buildTarget: DefaultTexturePlatform + maxTextureSize: 2048 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 0 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + androidETC2FallbackOverride: 0 + - serializedVersion: 2 + buildTarget: Standalone + maxTextureSize: 2048 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 0 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + androidETC2FallbackOverride: 0 + - serializedVersion: 2 + buildTarget: WebGL + maxTextureSize: 2048 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 0 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + androidETC2FallbackOverride: 0 + spriteSheet: + serializedVersion: 2 + sprites: [] + outline: [] + physicsShape: [] + bones: [] + spriteID: + vertices: [] + indices: + edges: [] + weights: [] + spritePackingTag: + pSDRemoveMatte: 0 + pSDShowRemoveMatteOption: 0 + userData: + assetBundleName: + assetBundleVariant: diff --git a/LocalPackages/net.peeweek.gameplay-ingredients/Icons/Misc/ic-gamepad-input.png b/LocalPackages/net.peeweek.gameplay-ingredients/Icons/Misc/ic-gamepad-input.png new file mode 100644 index 0000000..dbe2180 --- /dev/null +++ b/LocalPackages/net.peeweek.gameplay-ingredients/Icons/Misc/ic-gamepad-input.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:53602a7665c562acc03b601d317a63e936634e0370e061b5c59e19f176679af8 +size 366 diff --git a/LocalPackages/net.peeweek.gameplay-ingredients/Icons/Misc/ic-gamepad-input.png.meta b/LocalPackages/net.peeweek.gameplay-ingredients/Icons/Misc/ic-gamepad-input.png.meta new file mode 100644 index 0000000..85a5c9d --- /dev/null +++ b/LocalPackages/net.peeweek.gameplay-ingredients/Icons/Misc/ic-gamepad-input.png.meta @@ -0,0 +1,110 @@ +fileFormatVersion: 2 +guid: e691dbed38cbd76419e26c8e74c37c18 +TextureImporter: + fileIDToRecycleName: {} + externalObjects: {} + serializedVersion: 9 + mipmaps: + mipMapMode: 0 + enableMipMap: 0 + sRGBTexture: 1 + linearTexture: 0 + fadeOut: 0 + borderMipMap: 0 + mipMapsPreserveCoverage: 0 + alphaTestReferenceValue: 0.5 + mipMapFadeDistanceStart: 1 + mipMapFadeDistanceEnd: 3 + bumpmap: + convertToNormalMap: 0 + externalNormalMap: 0 + heightScale: 0.25 + normalMapFilter: 0 + isReadable: 0 + streamingMipmaps: 0 + streamingMipmapsPriority: 0 + grayScaleToAlpha: 0 + generateCubemap: 6 + cubemapConvolution: 0 + seamlessCubemap: 0 + textureFormat: 1 + maxTextureSize: 2048 + textureSettings: + serializedVersion: 2 + filterMode: 0 + aniso: 1 + mipBias: -100 + wrapU: 1 + wrapV: 1 + wrapW: -1 + nPOTScale: 0 + lightmap: 0 + compressionQuality: 50 + spriteMode: 0 + spriteExtrude: 1 + spriteMeshType: 1 + alignment: 0 + spritePivot: {x: 0.5, y: 0.5} + spritePixelsToUnits: 100 + spriteBorder: {x: 0, y: 0, z: 0, w: 0} + spriteGenerateFallbackPhysicsShape: 1 + alphaUsage: 1 + alphaIsTransparency: 1 + spriteTessellationDetail: -1 + textureType: 2 + textureShape: 1 + singleChannelComponent: 0 + maxTextureSizeSet: 0 + compressionQualitySet: 0 + textureFormatSet: 0 + platformSettings: + - serializedVersion: 2 + buildTarget: DefaultTexturePlatform + maxTextureSize: 2048 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 0 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + androidETC2FallbackOverride: 0 + - serializedVersion: 2 + buildTarget: Standalone + maxTextureSize: 2048 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 0 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + androidETC2FallbackOverride: 0 + - serializedVersion: 2 + buildTarget: WebGL + maxTextureSize: 2048 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 0 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + androidETC2FallbackOverride: 0 + spriteSheet: + serializedVersion: 2 + sprites: [] + outline: [] + physicsShape: [] + bones: [] + spriteID: + vertices: [] + indices: + edges: [] + weights: [] + spritePackingTag: + pSDRemoveMatte: 0 + pSDShowRemoveMatteOption: 0 + userData: + assetBundleName: + assetBundleVariant: diff --git a/LocalPackages/net.peeweek.gameplay-ingredients/Icons/Misc/ic-interaction-manager.png b/LocalPackages/net.peeweek.gameplay-ingredients/Icons/Misc/ic-interaction-manager.png new file mode 100644 index 0000000..d731dd2 --- /dev/null +++ b/LocalPackages/net.peeweek.gameplay-ingredients/Icons/Misc/ic-interaction-manager.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:7e9d7ea42db709a7b803aa0499dc85579af52886bad60a41ccb2fafe7743b3f6 +size 605 diff --git a/LocalPackages/net.peeweek.gameplay-ingredients/Icons/Misc/ic-interaction-manager.png.meta b/LocalPackages/net.peeweek.gameplay-ingredients/Icons/Misc/ic-interaction-manager.png.meta new file mode 100644 index 0000000..b55f310 --- /dev/null +++ b/LocalPackages/net.peeweek.gameplay-ingredients/Icons/Misc/ic-interaction-manager.png.meta @@ -0,0 +1,121 @@ +fileFormatVersion: 2 +guid: 63315c7c008e56843822736c05a1b375 +TextureImporter: + fileIDToRecycleName: {} + externalObjects: {} + serializedVersion: 9 + mipmaps: + mipMapMode: 0 + enableMipMap: 0 + sRGBTexture: 1 + linearTexture: 0 + fadeOut: 0 + borderMipMap: 0 + mipMapsPreserveCoverage: 0 + alphaTestReferenceValue: 0.5 + mipMapFadeDistanceStart: 1 + mipMapFadeDistanceEnd: 3 + bumpmap: + convertToNormalMap: 0 + externalNormalMap: 0 + heightScale: 0.25 + normalMapFilter: 0 + isReadable: 0 + streamingMipmaps: 0 + streamingMipmapsPriority: 0 + grayScaleToAlpha: 0 + generateCubemap: 6 + cubemapConvolution: 0 + seamlessCubemap: 0 + textureFormat: 1 + maxTextureSize: 2048 + textureSettings: + serializedVersion: 2 + filterMode: 0 + aniso: 1 + mipBias: -100 + wrapU: 1 + wrapV: 1 + wrapW: -1 + nPOTScale: 0 + lightmap: 0 + compressionQuality: 50 + spriteMode: 0 + spriteExtrude: 1 + spriteMeshType: 1 + alignment: 0 + spritePivot: {x: 0.5, y: 0.5} + spritePixelsToUnits: 100 + spriteBorder: {x: 0, y: 0, z: 0, w: 0} + spriteGenerateFallbackPhysicsShape: 1 + alphaUsage: 1 + alphaIsTransparency: 1 + spriteTessellationDetail: -1 + textureType: 2 + textureShape: 1 + singleChannelComponent: 0 + maxTextureSizeSet: 0 + compressionQualitySet: 0 + textureFormatSet: 0 + platformSettings: + - serializedVersion: 2 + buildTarget: DefaultTexturePlatform + maxTextureSize: 2048 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 0 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + androidETC2FallbackOverride: 0 + - serializedVersion: 2 + buildTarget: Standalone + maxTextureSize: 2048 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 0 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + androidETC2FallbackOverride: 0 + - serializedVersion: 2 + buildTarget: Android + maxTextureSize: 2048 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 0 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + androidETC2FallbackOverride: 0 + - serializedVersion: 2 + buildTarget: PS4 + maxTextureSize: 2048 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 0 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + androidETC2FallbackOverride: 0 + spriteSheet: + serializedVersion: 2 + sprites: [] + outline: [] + physicsShape: [] + bones: [] + spriteID: + vertices: [] + indices: + edges: [] + weights: [] + spritePackingTag: + pSDRemoveMatte: 0 + pSDShowRemoveMatteOption: 0 + userData: + assetBundleName: + assetBundleVariant: diff --git a/LocalPackages/net.peeweek.gameplay-ingredients/Icons/Misc/ic-interaction.png b/LocalPackages/net.peeweek.gameplay-ingredients/Icons/Misc/ic-interaction.png new file mode 100644 index 0000000..94e045c --- /dev/null +++ b/LocalPackages/net.peeweek.gameplay-ingredients/Icons/Misc/ic-interaction.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:b8decb93f45634e942512845f6066893208ddf10261014c65d78d372e7cf4832 +size 635 diff --git a/LocalPackages/net.peeweek.gameplay-ingredients/Icons/Misc/ic-interaction.png.meta b/LocalPackages/net.peeweek.gameplay-ingredients/Icons/Misc/ic-interaction.png.meta new file mode 100644 index 0000000..a40a9b9 --- /dev/null +++ b/LocalPackages/net.peeweek.gameplay-ingredients/Icons/Misc/ic-interaction.png.meta @@ -0,0 +1,121 @@ +fileFormatVersion: 2 +guid: 8797d3a3e47f3224b86affe15a6aea69 +TextureImporter: + fileIDToRecycleName: {} + externalObjects: {} + serializedVersion: 9 + mipmaps: + mipMapMode: 0 + enableMipMap: 0 + sRGBTexture: 1 + linearTexture: 0 + fadeOut: 0 + borderMipMap: 0 + mipMapsPreserveCoverage: 0 + alphaTestReferenceValue: 0.5 + mipMapFadeDistanceStart: 1 + mipMapFadeDistanceEnd: 3 + bumpmap: + convertToNormalMap: 0 + externalNormalMap: 0 + heightScale: 0.25 + normalMapFilter: 0 + isReadable: 0 + streamingMipmaps: 0 + streamingMipmapsPriority: 0 + grayScaleToAlpha: 0 + generateCubemap: 6 + cubemapConvolution: 0 + seamlessCubemap: 0 + textureFormat: 1 + maxTextureSize: 2048 + textureSettings: + serializedVersion: 2 + filterMode: 0 + aniso: 1 + mipBias: -100 + wrapU: 1 + wrapV: 1 + wrapW: -1 + nPOTScale: 0 + lightmap: 0 + compressionQuality: 50 + spriteMode: 0 + spriteExtrude: 1 + spriteMeshType: 1 + alignment: 0 + spritePivot: {x: 0.5, y: 0.5} + spritePixelsToUnits: 100 + spriteBorder: {x: 0, y: 0, z: 0, w: 0} + spriteGenerateFallbackPhysicsShape: 1 + alphaUsage: 1 + alphaIsTransparency: 1 + spriteTessellationDetail: -1 + textureType: 2 + textureShape: 1 + singleChannelComponent: 0 + maxTextureSizeSet: 0 + compressionQualitySet: 0 + textureFormatSet: 0 + platformSettings: + - serializedVersion: 2 + buildTarget: DefaultTexturePlatform + maxTextureSize: 2048 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 0 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + androidETC2FallbackOverride: 0 + - serializedVersion: 2 + buildTarget: Standalone + maxTextureSize: 2048 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 0 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + androidETC2FallbackOverride: 0 + - serializedVersion: 2 + buildTarget: Android + maxTextureSize: 2048 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 0 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + androidETC2FallbackOverride: 0 + - serializedVersion: 2 + buildTarget: PS4 + maxTextureSize: 2048 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 0 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + androidETC2FallbackOverride: 0 + spriteSheet: + serializedVersion: 2 + sprites: [] + outline: [] + physicsShape: [] + bones: [] + spriteID: + vertices: [] + indices: + edges: [] + weights: [] + spritePackingTag: + pSDRemoveMatte: 0 + pSDShowRemoveMatteOption: 0 + userData: + assetBundleName: + assetBundleVariant: diff --git a/LocalPackages/net.peeweek.gameplay-ingredients/Icons/Misc/ic-interactive-user.png b/LocalPackages/net.peeweek.gameplay-ingredients/Icons/Misc/ic-interactive-user.png new file mode 100644 index 0000000..f388a1c --- /dev/null +++ b/LocalPackages/net.peeweek.gameplay-ingredients/Icons/Misc/ic-interactive-user.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:94e69667ce48148c9c3ce2b5386dd91b4268296c49e4c411cf22d45a57ea3209 +size 881 diff --git a/LocalPackages/net.peeweek.gameplay-ingredients/Icons/Misc/ic-interactive-user.png.meta b/LocalPackages/net.peeweek.gameplay-ingredients/Icons/Misc/ic-interactive-user.png.meta new file mode 100644 index 0000000..daf32fc --- /dev/null +++ b/LocalPackages/net.peeweek.gameplay-ingredients/Icons/Misc/ic-interactive-user.png.meta @@ -0,0 +1,121 @@ +fileFormatVersion: 2 +guid: dd733e59c5ec489448302b07c319482f +TextureImporter: + fileIDToRecycleName: {} + externalObjects: {} + serializedVersion: 9 + mipmaps: + mipMapMode: 0 + enableMipMap: 0 + sRGBTexture: 1 + linearTexture: 0 + fadeOut: 0 + borderMipMap: 0 + mipMapsPreserveCoverage: 0 + alphaTestReferenceValue: 0.5 + mipMapFadeDistanceStart: 1 + mipMapFadeDistanceEnd: 3 + bumpmap: + convertToNormalMap: 0 + externalNormalMap: 0 + heightScale: 0.25 + normalMapFilter: 0 + isReadable: 0 + streamingMipmaps: 0 + streamingMipmapsPriority: 0 + grayScaleToAlpha: 0 + generateCubemap: 6 + cubemapConvolution: 0 + seamlessCubemap: 0 + textureFormat: 1 + maxTextureSize: 2048 + textureSettings: + serializedVersion: 2 + filterMode: 0 + aniso: 1 + mipBias: -100 + wrapU: 1 + wrapV: 1 + wrapW: -1 + nPOTScale: 0 + lightmap: 0 + compressionQuality: 50 + spriteMode: 0 + spriteExtrude: 1 + spriteMeshType: 1 + alignment: 0 + spritePivot: {x: 0.5, y: 0.5} + spritePixelsToUnits: 100 + spriteBorder: {x: 0, y: 0, z: 0, w: 0} + spriteGenerateFallbackPhysicsShape: 1 + alphaUsage: 1 + alphaIsTransparency: 1 + spriteTessellationDetail: -1 + textureType: 2 + textureShape: 1 + singleChannelComponent: 0 + maxTextureSizeSet: 0 + compressionQualitySet: 0 + textureFormatSet: 0 + platformSettings: + - serializedVersion: 2 + buildTarget: DefaultTexturePlatform + maxTextureSize: 2048 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 0 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + androidETC2FallbackOverride: 0 + - serializedVersion: 2 + buildTarget: Standalone + maxTextureSize: 2048 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 0 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + androidETC2FallbackOverride: 0 + - serializedVersion: 2 + buildTarget: Android + maxTextureSize: 2048 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 0 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + androidETC2FallbackOverride: 0 + - serializedVersion: 2 + buildTarget: PS4 + maxTextureSize: 2048 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 0 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + androidETC2FallbackOverride: 0 + spriteSheet: + serializedVersion: 2 + sprites: [] + outline: [] + physicsShape: [] + bones: [] + spriteID: + vertices: [] + indices: + edges: [] + weights: [] + spritePackingTag: + pSDRemoveMatte: 0 + pSDShowRemoveMatteOption: 0 + userData: + assetBundleName: + assetBundleVariant: diff --git a/LocalPackages/net.peeweek.gameplay-ingredients/Icons/Misc/ic-interactive.png b/LocalPackages/net.peeweek.gameplay-ingredients/Icons/Misc/ic-interactive.png new file mode 100644 index 0000000..7e13a1f --- /dev/null +++ b/LocalPackages/net.peeweek.gameplay-ingredients/Icons/Misc/ic-interactive.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:1b9726b990e91bebcfec30e824029c1f6e39654527089c72a93240f81943507e +size 541 diff --git a/LocalPackages/net.peeweek.gameplay-ingredients/Icons/Misc/ic-interactive.png.meta b/LocalPackages/net.peeweek.gameplay-ingredients/Icons/Misc/ic-interactive.png.meta new file mode 100644 index 0000000..517a7dd --- /dev/null +++ b/LocalPackages/net.peeweek.gameplay-ingredients/Icons/Misc/ic-interactive.png.meta @@ -0,0 +1,121 @@ +fileFormatVersion: 2 +guid: 946cd4a447af28e4ebe7494670f60a83 +TextureImporter: + fileIDToRecycleName: {} + externalObjects: {} + serializedVersion: 9 + mipmaps: + mipMapMode: 0 + enableMipMap: 0 + sRGBTexture: 1 + linearTexture: 0 + fadeOut: 0 + borderMipMap: 0 + mipMapsPreserveCoverage: 0 + alphaTestReferenceValue: 0.5 + mipMapFadeDistanceStart: 1 + mipMapFadeDistanceEnd: 3 + bumpmap: + convertToNormalMap: 0 + externalNormalMap: 0 + heightScale: 0.25 + normalMapFilter: 0 + isReadable: 0 + streamingMipmaps: 0 + streamingMipmapsPriority: 0 + grayScaleToAlpha: 0 + generateCubemap: 6 + cubemapConvolution: 0 + seamlessCubemap: 0 + textureFormat: 1 + maxTextureSize: 2048 + textureSettings: + serializedVersion: 2 + filterMode: 0 + aniso: 1 + mipBias: -100 + wrapU: 1 + wrapV: 1 + wrapW: -1 + nPOTScale: 0 + lightmap: 0 + compressionQuality: 50 + spriteMode: 0 + spriteExtrude: 1 + spriteMeshType: 1 + alignment: 0 + spritePivot: {x: 0.5, y: 0.5} + spritePixelsToUnits: 100 + spriteBorder: {x: 0, y: 0, z: 0, w: 0} + spriteGenerateFallbackPhysicsShape: 1 + alphaUsage: 1 + alphaIsTransparency: 1 + spriteTessellationDetail: -1 + textureType: 2 + textureShape: 1 + singleChannelComponent: 0 + maxTextureSizeSet: 0 + compressionQualitySet: 0 + textureFormatSet: 0 + platformSettings: + - serializedVersion: 2 + buildTarget: DefaultTexturePlatform + maxTextureSize: 2048 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 0 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + androidETC2FallbackOverride: 0 + - serializedVersion: 2 + buildTarget: Standalone + maxTextureSize: 2048 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 0 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + androidETC2FallbackOverride: 0 + - serializedVersion: 2 + buildTarget: Android + maxTextureSize: 2048 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 0 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + androidETC2FallbackOverride: 0 + - serializedVersion: 2 + buildTarget: PS4 + maxTextureSize: 2048 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 0 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + androidETC2FallbackOverride: 0 + spriteSheet: + serializedVersion: 2 + sprites: [] + outline: [] + physicsShape: [] + bones: [] + spriteID: + vertices: [] + indices: + edges: [] + weights: [] + spritePackingTag: + pSDRemoveMatte: 0 + pSDShowRemoveMatteOption: 0 + userData: + assetBundleName: + assetBundleVariant: diff --git a/LocalPackages/net.peeweek.gameplay-ingredients/Icons/Misc/ic-pickup-effect.png b/LocalPackages/net.peeweek.gameplay-ingredients/Icons/Misc/ic-pickup-effect.png new file mode 100644 index 0000000..cd0e40b --- /dev/null +++ b/LocalPackages/net.peeweek.gameplay-ingredients/Icons/Misc/ic-pickup-effect.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:8503bcf8c2f712b8cbd8dec5025c4c3cd14c486223be7696d78e60d665f6a239 +size 1640 diff --git a/LocalPackages/net.peeweek.gameplay-ingredients/Icons/Misc/ic-pickup-effect.png.meta b/LocalPackages/net.peeweek.gameplay-ingredients/Icons/Misc/ic-pickup-effect.png.meta new file mode 100644 index 0000000..f773acb --- /dev/null +++ b/LocalPackages/net.peeweek.gameplay-ingredients/Icons/Misc/ic-pickup-effect.png.meta @@ -0,0 +1,110 @@ +fileFormatVersion: 2 +guid: ed7916945f471254492a92a6613e4f0f +TextureImporter: + fileIDToRecycleName: {} + externalObjects: {} + serializedVersion: 9 + mipmaps: + mipMapMode: 0 + enableMipMap: 0 + sRGBTexture: 1 + linearTexture: 0 + fadeOut: 0 + borderMipMap: 0 + mipMapsPreserveCoverage: 0 + alphaTestReferenceValue: 0.5 + mipMapFadeDistanceStart: 1 + mipMapFadeDistanceEnd: 3 + bumpmap: + convertToNormalMap: 0 + externalNormalMap: 0 + heightScale: 0.25 + normalMapFilter: 0 + isReadable: 0 + streamingMipmaps: 0 + streamingMipmapsPriority: 0 + grayScaleToAlpha: 0 + generateCubemap: 6 + cubemapConvolution: 0 + seamlessCubemap: 0 + textureFormat: 1 + maxTextureSize: 2048 + textureSettings: + serializedVersion: 2 + filterMode: 0 + aniso: 1 + mipBias: -100 + wrapU: 1 + wrapV: 1 + wrapW: -1 + nPOTScale: 0 + lightmap: 0 + compressionQuality: 50 + spriteMode: 0 + spriteExtrude: 1 + spriteMeshType: 1 + alignment: 0 + spritePivot: {x: 0.5, y: 0.5} + spritePixelsToUnits: 100 + spriteBorder: {x: 0, y: 0, z: 0, w: 0} + spriteGenerateFallbackPhysicsShape: 1 + alphaUsage: 1 + alphaIsTransparency: 1 + spriteTessellationDetail: -1 + textureType: 2 + textureShape: 1 + singleChannelComponent: 0 + maxTextureSizeSet: 0 + compressionQualitySet: 0 + textureFormatSet: 0 + platformSettings: + - serializedVersion: 2 + buildTarget: DefaultTexturePlatform + maxTextureSize: 2048 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 0 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + androidETC2FallbackOverride: 0 + - serializedVersion: 2 + buildTarget: Standalone + maxTextureSize: 2048 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 0 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + androidETC2FallbackOverride: 0 + - serializedVersion: 2 + buildTarget: WebGL + maxTextureSize: 2048 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 0 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + androidETC2FallbackOverride: 0 + spriteSheet: + serializedVersion: 2 + sprites: [] + outline: [] + physicsShape: [] + bones: [] + spriteID: + vertices: [] + indices: + edges: [] + weights: [] + spritePackingTag: + pSDRemoveMatte: 0 + pSDShowRemoveMatteOption: 0 + userData: + assetBundleName: + assetBundleVariant: diff --git a/LocalPackages/net.peeweek.gameplay-ingredients/Icons/Misc/ic-pickup.png b/LocalPackages/net.peeweek.gameplay-ingredients/Icons/Misc/ic-pickup.png new file mode 100644 index 0000000..8bda2b0 --- /dev/null +++ b/LocalPackages/net.peeweek.gameplay-ingredients/Icons/Misc/ic-pickup.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:583227ce44a851c80ee8e752da705080aa80607803b70e631b6cac14183a2836 +size 904 diff --git a/LocalPackages/net.peeweek.gameplay-ingredients/Icons/Misc/ic-pickup.png.meta b/LocalPackages/net.peeweek.gameplay-ingredients/Icons/Misc/ic-pickup.png.meta new file mode 100644 index 0000000..574da94 --- /dev/null +++ b/LocalPackages/net.peeweek.gameplay-ingredients/Icons/Misc/ic-pickup.png.meta @@ -0,0 +1,110 @@ +fileFormatVersion: 2 +guid: e3c3d9daa54f982429dbbc8134e953ea +TextureImporter: + fileIDToRecycleName: {} + externalObjects: {} + serializedVersion: 9 + mipmaps: + mipMapMode: 0 + enableMipMap: 0 + sRGBTexture: 1 + linearTexture: 0 + fadeOut: 0 + borderMipMap: 0 + mipMapsPreserveCoverage: 0 + alphaTestReferenceValue: 0.5 + mipMapFadeDistanceStart: 1 + mipMapFadeDistanceEnd: 3 + bumpmap: + convertToNormalMap: 0 + externalNormalMap: 0 + heightScale: 0.25 + normalMapFilter: 0 + isReadable: 0 + streamingMipmaps: 0 + streamingMipmapsPriority: 0 + grayScaleToAlpha: 0 + generateCubemap: 6 + cubemapConvolution: 0 + seamlessCubemap: 0 + textureFormat: 1 + maxTextureSize: 2048 + textureSettings: + serializedVersion: 2 + filterMode: 0 + aniso: 1 + mipBias: -100 + wrapU: 1 + wrapV: 1 + wrapW: -1 + nPOTScale: 0 + lightmap: 0 + compressionQuality: 50 + spriteMode: 0 + spriteExtrude: 1 + spriteMeshType: 1 + alignment: 0 + spritePivot: {x: 0.5, y: 0.5} + spritePixelsToUnits: 100 + spriteBorder: {x: 0, y: 0, z: 0, w: 0} + spriteGenerateFallbackPhysicsShape: 1 + alphaUsage: 1 + alphaIsTransparency: 1 + spriteTessellationDetail: -1 + textureType: 2 + textureShape: 1 + singleChannelComponent: 0 + maxTextureSizeSet: 0 + compressionQualitySet: 0 + textureFormatSet: 0 + platformSettings: + - serializedVersion: 2 + buildTarget: DefaultTexturePlatform + maxTextureSize: 2048 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 0 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + androidETC2FallbackOverride: 0 + - serializedVersion: 2 + buildTarget: Standalone + maxTextureSize: 2048 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 0 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + androidETC2FallbackOverride: 0 + - serializedVersion: 2 + buildTarget: WebGL + maxTextureSize: 2048 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 0 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + androidETC2FallbackOverride: 0 + spriteSheet: + serializedVersion: 2 + sprites: [] + outline: [] + physicsShape: [] + bones: [] + spriteID: + vertices: [] + indices: + edges: [] + weights: [] + spritePackingTag: + pSDRemoveMatte: 0 + pSDShowRemoveMatteOption: 0 + userData: + assetBundleName: + assetBundleVariant: diff --git a/LocalPackages/net.peeweek.gameplay-ingredients/Icons/Misc/ic-timer.png b/LocalPackages/net.peeweek.gameplay-ingredients/Icons/Misc/ic-timer.png new file mode 100644 index 0000000..2bb1ace --- /dev/null +++ b/LocalPackages/net.peeweek.gameplay-ingredients/Icons/Misc/ic-timer.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:e7cb9185b926a9de4026c6555cfeec95215d11a450c4684332196b141efda09e +size 853 diff --git a/LocalPackages/net.peeweek.gameplay-ingredients/Icons/Misc/ic-timer.png.meta b/LocalPackages/net.peeweek.gameplay-ingredients/Icons/Misc/ic-timer.png.meta new file mode 100644 index 0000000..da5abca --- /dev/null +++ b/LocalPackages/net.peeweek.gameplay-ingredients/Icons/Misc/ic-timer.png.meta @@ -0,0 +1,91 @@ +fileFormatVersion: 2 +guid: 4ad9148371bb28f44a21256b05f6ecae +TextureImporter: + internalIDToNameTable: [] + externalObjects: {} + serializedVersion: 10 + mipmaps: + mipMapMode: 0 + enableMipMap: 1 + sRGBTexture: 1 + linearTexture: 0 + fadeOut: 0 + borderMipMap: 0 + mipMapsPreserveCoverage: 0 + alphaTestReferenceValue: 0.5 + mipMapFadeDistanceStart: 1 + mipMapFadeDistanceEnd: 3 + bumpmap: + convertToNormalMap: 0 + externalNormalMap: 0 + heightScale: 0.25 + normalMapFilter: 0 + isReadable: 0 + streamingMipmaps: 0 + streamingMipmapsPriority: 0 + grayScaleToAlpha: 0 + generateCubemap: 6 + cubemapConvolution: 0 + seamlessCubemap: 0 + textureFormat: 1 + maxTextureSize: 2048 + textureSettings: + serializedVersion: 2 + filterMode: -1 + aniso: -1 + mipBias: -100 + wrapU: -1 + wrapV: -1 + wrapW: -1 + nPOTScale: 1 + lightmap: 0 + compressionQuality: 50 + spriteMode: 0 + spriteExtrude: 1 + spriteMeshType: 1 + alignment: 0 + spritePivot: {x: 0.5, y: 0.5} + spritePixelsToUnits: 100 + spriteBorder: {x: 0, y: 0, z: 0, w: 0} + spriteGenerateFallbackPhysicsShape: 1 + alphaUsage: 1 + alphaIsTransparency: 0 + spriteTessellationDetail: -1 + textureType: 0 + textureShape: 1 + singleChannelComponent: 0 + maxTextureSizeSet: 0 + compressionQualitySet: 0 + textureFormatSet: 0 + platformSettings: + - serializedVersion: 3 + buildTarget: DefaultTexturePlatform + maxTextureSize: 2048 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 1 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + androidETC2FallbackOverride: 0 + forceMaximumCompressionQuality_BC6H_BC7: 0 + spriteSheet: + serializedVersion: 2 + sprites: [] + outline: [] + physicsShape: [] + bones: [] + spriteID: + internalID: 0 + vertices: [] + indices: + edges: [] + weights: [] + secondaryTextures: [] + spritePackingTag: + pSDRemoveMatte: 0 + pSDShowRemoveMatteOption: 0 + userData: + assetBundleName: + assetBundleVariant: diff --git a/LocalPackages/net.peeweek.gameplay-ingredients/Icons/Misc/ic-toolbox.png b/LocalPackages/net.peeweek.gameplay-ingredients/Icons/Misc/ic-toolbox.png new file mode 100644 index 0000000..4badb95 --- /dev/null +++ b/LocalPackages/net.peeweek.gameplay-ingredients/Icons/Misc/ic-toolbox.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:dadb39d737bc87d2bf2e25afeb2094a50f830e3478520a7d85caaddb80144762 +size 501 diff --git a/LocalPackages/net.peeweek.gameplay-ingredients/Icons/Misc/ic-toolbox.png.meta b/LocalPackages/net.peeweek.gameplay-ingredients/Icons/Misc/ic-toolbox.png.meta new file mode 100644 index 0000000..10d0eea --- /dev/null +++ b/LocalPackages/net.peeweek.gameplay-ingredients/Icons/Misc/ic-toolbox.png.meta @@ -0,0 +1,121 @@ +fileFormatVersion: 2 +guid: 3a00d3115f5ce7e489817a6379ef0a50 +TextureImporter: + fileIDToRecycleName: {} + externalObjects: {} + serializedVersion: 9 + mipmaps: + mipMapMode: 0 + enableMipMap: 0 + sRGBTexture: 1 + linearTexture: 0 + fadeOut: 0 + borderMipMap: 0 + mipMapsPreserveCoverage: 0 + alphaTestReferenceValue: 0.5 + mipMapFadeDistanceStart: 1 + mipMapFadeDistanceEnd: 3 + bumpmap: + convertToNormalMap: 0 + externalNormalMap: 0 + heightScale: 0.25 + normalMapFilter: 0 + isReadable: 0 + streamingMipmaps: 0 + streamingMipmapsPriority: 0 + grayScaleToAlpha: 0 + generateCubemap: 6 + cubemapConvolution: 0 + seamlessCubemap: 0 + textureFormat: 1 + maxTextureSize: 2048 + textureSettings: + serializedVersion: 2 + filterMode: 0 + aniso: 1 + mipBias: -100 + wrapU: 1 + wrapV: 1 + wrapW: -1 + nPOTScale: 0 + lightmap: 0 + compressionQuality: 50 + spriteMode: 0 + spriteExtrude: 1 + spriteMeshType: 1 + alignment: 0 + spritePivot: {x: 0.5, y: 0.5} + spritePixelsToUnits: 100 + spriteBorder: {x: 0, y: 0, z: 0, w: 0} + spriteGenerateFallbackPhysicsShape: 1 + alphaUsage: 1 + alphaIsTransparency: 1 + spriteTessellationDetail: -1 + textureType: 2 + textureShape: 1 + singleChannelComponent: 0 + maxTextureSizeSet: 0 + compressionQualitySet: 0 + textureFormatSet: 0 + platformSettings: + - serializedVersion: 2 + buildTarget: DefaultTexturePlatform + maxTextureSize: 2048 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 0 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + androidETC2FallbackOverride: 0 + - serializedVersion: 2 + buildTarget: Standalone + maxTextureSize: 2048 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 0 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + androidETC2FallbackOverride: 0 + - serializedVersion: 2 + buildTarget: Android + maxTextureSize: 2048 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 0 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + androidETC2FallbackOverride: 0 + - serializedVersion: 2 + buildTarget: PS4 + maxTextureSize: 2048 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 0 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + androidETC2FallbackOverride: 0 + spriteSheet: + serializedVersion: 2 + sprites: [] + outline: [] + physicsShape: [] + bones: [] + spriteID: + vertices: [] + indices: + edges: [] + weights: [] + spritePackingTag: + pSDRemoveMatte: 0 + pSDShowRemoveMatteOption: 0 + userData: + assetBundleName: + assetBundleVariant: diff --git a/LocalPackages/net.peeweek.gameplay-ingredients/Icons/Misc/ic-traffic-cone-arrow.png b/LocalPackages/net.peeweek.gameplay-ingredients/Icons/Misc/ic-traffic-cone-arrow.png new file mode 100644 index 0000000..e4179e0 --- /dev/null +++ b/LocalPackages/net.peeweek.gameplay-ingredients/Icons/Misc/ic-traffic-cone-arrow.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:32bb2c32562554e6fa578d8696114a1eb1d252e8bb79c16c118fbfb7966f7f5b +size 802 diff --git a/LocalPackages/net.peeweek.gameplay-ingredients/Icons/Misc/ic-traffic-cone-arrow.png.meta b/LocalPackages/net.peeweek.gameplay-ingredients/Icons/Misc/ic-traffic-cone-arrow.png.meta new file mode 100644 index 0000000..174af5b --- /dev/null +++ b/LocalPackages/net.peeweek.gameplay-ingredients/Icons/Misc/ic-traffic-cone-arrow.png.meta @@ -0,0 +1,121 @@ +fileFormatVersion: 2 +guid: e56f3f646a3373b499df404a98dc5d95 +TextureImporter: + fileIDToRecycleName: {} + externalObjects: {} + serializedVersion: 9 + mipmaps: + mipMapMode: 0 + enableMipMap: 0 + sRGBTexture: 1 + linearTexture: 0 + fadeOut: 0 + borderMipMap: 0 + mipMapsPreserveCoverage: 0 + alphaTestReferenceValue: 0.5 + mipMapFadeDistanceStart: 1 + mipMapFadeDistanceEnd: 3 + bumpmap: + convertToNormalMap: 0 + externalNormalMap: 0 + heightScale: 0.25 + normalMapFilter: 0 + isReadable: 0 + streamingMipmaps: 0 + streamingMipmapsPriority: 0 + grayScaleToAlpha: 0 + generateCubemap: 6 + cubemapConvolution: 0 + seamlessCubemap: 0 + textureFormat: 1 + maxTextureSize: 2048 + textureSettings: + serializedVersion: 2 + filterMode: 0 + aniso: 1 + mipBias: -100 + wrapU: 1 + wrapV: 1 + wrapW: -1 + nPOTScale: 0 + lightmap: 0 + compressionQuality: 50 + spriteMode: 0 + spriteExtrude: 1 + spriteMeshType: 1 + alignment: 0 + spritePivot: {x: 0.5, y: 0.5} + spritePixelsToUnits: 100 + spriteBorder: {x: 0, y: 0, z: 0, w: 0} + spriteGenerateFallbackPhysicsShape: 1 + alphaUsage: 1 + alphaIsTransparency: 1 + spriteTessellationDetail: -1 + textureType: 2 + textureShape: 1 + singleChannelComponent: 0 + maxTextureSizeSet: 0 + compressionQualitySet: 0 + textureFormatSet: 0 + platformSettings: + - serializedVersion: 2 + buildTarget: DefaultTexturePlatform + maxTextureSize: 2048 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 0 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + androidETC2FallbackOverride: 0 + - serializedVersion: 2 + buildTarget: Standalone + maxTextureSize: 2048 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 0 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + androidETC2FallbackOverride: 0 + - serializedVersion: 2 + buildTarget: Android + maxTextureSize: 2048 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 0 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + androidETC2FallbackOverride: 0 + - serializedVersion: 2 + buildTarget: PS4 + maxTextureSize: 2048 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 0 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + androidETC2FallbackOverride: 0 + spriteSheet: + serializedVersion: 2 + sprites: [] + outline: [] + physicsShape: [] + bones: [] + spriteID: + vertices: [] + indices: + edges: [] + weights: [] + spritePackingTag: + pSDRemoveMatte: 0 + pSDShowRemoveMatteOption: 0 + userData: + assetBundleName: + assetBundleVariant: diff --git a/LocalPackages/net.peeweek.gameplay-ingredients/Icons/Misc/ic-traffic-cone.png b/LocalPackages/net.peeweek.gameplay-ingredients/Icons/Misc/ic-traffic-cone.png new file mode 100644 index 0000000..82584b2 --- /dev/null +++ b/LocalPackages/net.peeweek.gameplay-ingredients/Icons/Misc/ic-traffic-cone.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:857d169be16b1a423414a7dcc334a9f7539770ddfffff8c2d4981b53fe356d6d +size 688 diff --git a/LocalPackages/net.peeweek.gameplay-ingredients/Icons/Misc/ic-traffic-cone.png.meta b/LocalPackages/net.peeweek.gameplay-ingredients/Icons/Misc/ic-traffic-cone.png.meta new file mode 100644 index 0000000..2f170b7 --- /dev/null +++ b/LocalPackages/net.peeweek.gameplay-ingredients/Icons/Misc/ic-traffic-cone.png.meta @@ -0,0 +1,121 @@ +fileFormatVersion: 2 +guid: 0c33cecd2689cd943bdc51adb0f8492e +TextureImporter: + fileIDToRecycleName: {} + externalObjects: {} + serializedVersion: 9 + mipmaps: + mipMapMode: 0 + enableMipMap: 0 + sRGBTexture: 1 + linearTexture: 0 + fadeOut: 0 + borderMipMap: 0 + mipMapsPreserveCoverage: 0 + alphaTestReferenceValue: 0.5 + mipMapFadeDistanceStart: 1 + mipMapFadeDistanceEnd: 3 + bumpmap: + convertToNormalMap: 0 + externalNormalMap: 0 + heightScale: 0.25 + normalMapFilter: 0 + isReadable: 0 + streamingMipmaps: 0 + streamingMipmapsPriority: 0 + grayScaleToAlpha: 0 + generateCubemap: 6 + cubemapConvolution: 0 + seamlessCubemap: 0 + textureFormat: 1 + maxTextureSize: 2048 + textureSettings: + serializedVersion: 2 + filterMode: 0 + aniso: 1 + mipBias: -100 + wrapU: 1 + wrapV: 1 + wrapW: -1 + nPOTScale: 0 + lightmap: 0 + compressionQuality: 50 + spriteMode: 0 + spriteExtrude: 1 + spriteMeshType: 1 + alignment: 0 + spritePivot: {x: 0.5, y: 0.5} + spritePixelsToUnits: 100 + spriteBorder: {x: 0, y: 0, z: 0, w: 0} + spriteGenerateFallbackPhysicsShape: 1 + alphaUsage: 1 + alphaIsTransparency: 1 + spriteTessellationDetail: -1 + textureType: 2 + textureShape: 1 + singleChannelComponent: 0 + maxTextureSizeSet: 0 + compressionQualitySet: 0 + textureFormatSet: 0 + platformSettings: + - serializedVersion: 2 + buildTarget: DefaultTexturePlatform + maxTextureSize: 2048 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 0 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + androidETC2FallbackOverride: 0 + - serializedVersion: 2 + buildTarget: Standalone + maxTextureSize: 2048 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 0 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + androidETC2FallbackOverride: 0 + - serializedVersion: 2 + buildTarget: Android + maxTextureSize: 2048 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 0 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + androidETC2FallbackOverride: 0 + - serializedVersion: 2 + buildTarget: PS4 + maxTextureSize: 2048 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 0 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + androidETC2FallbackOverride: 0 + spriteSheet: + serializedVersion: 2 + sprites: [] + outline: [] + physicsShape: [] + bones: [] + spriteID: + vertices: [] + indices: + edges: [] + weights: [] + spritePackingTag: + pSDRemoveMatte: 0 + pSDShowRemoveMatteOption: 0 + userData: + assetBundleName: + assetBundleVariant: diff --git a/LocalPackages/net.peeweek.gameplay-ingredients/Icons/Misc/ic-wall.png b/LocalPackages/net.peeweek.gameplay-ingredients/Icons/Misc/ic-wall.png new file mode 100644 index 0000000..b5bb24b --- /dev/null +++ b/LocalPackages/net.peeweek.gameplay-ingredients/Icons/Misc/ic-wall.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:ad056470ab00b289ad7c6a71161d07b59fe7990c0ec97363d8f363463755cba2 +size 544 diff --git a/LocalPackages/net.peeweek.gameplay-ingredients/Icons/Misc/ic-wall.png.meta b/LocalPackages/net.peeweek.gameplay-ingredients/Icons/Misc/ic-wall.png.meta new file mode 100644 index 0000000..eec1329 --- /dev/null +++ b/LocalPackages/net.peeweek.gameplay-ingredients/Icons/Misc/ic-wall.png.meta @@ -0,0 +1,121 @@ +fileFormatVersion: 2 +guid: df9699bf8558cf14681695a7bba71f81 +TextureImporter: + fileIDToRecycleName: {} + externalObjects: {} + serializedVersion: 9 + mipmaps: + mipMapMode: 0 + enableMipMap: 0 + sRGBTexture: 1 + linearTexture: 0 + fadeOut: 0 + borderMipMap: 0 + mipMapsPreserveCoverage: 0 + alphaTestReferenceValue: 0.5 + mipMapFadeDistanceStart: 1 + mipMapFadeDistanceEnd: 3 + bumpmap: + convertToNormalMap: 0 + externalNormalMap: 0 + heightScale: 0.25 + normalMapFilter: 0 + isReadable: 0 + streamingMipmaps: 0 + streamingMipmapsPriority: 0 + grayScaleToAlpha: 0 + generateCubemap: 6 + cubemapConvolution: 0 + seamlessCubemap: 0 + textureFormat: 1 + maxTextureSize: 2048 + textureSettings: + serializedVersion: 2 + filterMode: 0 + aniso: 1 + mipBias: -100 + wrapU: 1 + wrapV: 1 + wrapW: -1 + nPOTScale: 0 + lightmap: 0 + compressionQuality: 50 + spriteMode: 0 + spriteExtrude: 1 + spriteMeshType: 1 + alignment: 0 + spritePivot: {x: 0.5, y: 0.5} + spritePixelsToUnits: 100 + spriteBorder: {x: 0, y: 0, z: 0, w: 0} + spriteGenerateFallbackPhysicsShape: 1 + alphaUsage: 1 + alphaIsTransparency: 1 + spriteTessellationDetail: -1 + textureType: 2 + textureShape: 1 + singleChannelComponent: 0 + maxTextureSizeSet: 0 + compressionQualitySet: 0 + textureFormatSet: 0 + platformSettings: + - serializedVersion: 2 + buildTarget: DefaultTexturePlatform + maxTextureSize: 2048 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 0 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + androidETC2FallbackOverride: 0 + - serializedVersion: 2 + buildTarget: Standalone + maxTextureSize: 2048 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 0 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + androidETC2FallbackOverride: 0 + - serializedVersion: 2 + buildTarget: Android + maxTextureSize: 2048 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 0 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + androidETC2FallbackOverride: 0 + - serializedVersion: 2 + buildTarget: PS4 + maxTextureSize: 2048 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 0 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + androidETC2FallbackOverride: 0 + spriteSheet: + serializedVersion: 2 + sprites: [] + outline: [] + physicsShape: [] + bones: [] + spriteID: + vertices: [] + indices: + edges: [] + weights: [] + spritePackingTag: + pSDRemoveMatte: 0 + pSDShowRemoveMatteOption: 0 + userData: + assetBundleName: + assetBundleVariant: diff --git a/LocalPackages/net.peeweek.gameplay-ingredients/Icons/Rigs.meta b/LocalPackages/net.peeweek.gameplay-ingredients/Icons/Rigs.meta new file mode 100644 index 0000000..8142d27 --- /dev/null +++ b/LocalPackages/net.peeweek.gameplay-ingredients/Icons/Rigs.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: b795e7b3468fed5418ae392638f92c6b +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/LocalPackages/net.peeweek.gameplay-ingredients/Icons/Rigs/ic-rig-director-control.png b/LocalPackages/net.peeweek.gameplay-ingredients/Icons/Rigs/ic-rig-director-control.png new file mode 100644 index 0000000..24250da --- /dev/null +++ b/LocalPackages/net.peeweek.gameplay-ingredients/Icons/Rigs/ic-rig-director-control.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:ae51e04938a82ec363cfd160ab536bf91b5e1586902aa9ee2112127d01b47b42 +size 539 diff --git a/LocalPackages/net.peeweek.gameplay-ingredients/Icons/Rigs/ic-rig-director-control.png.meta b/LocalPackages/net.peeweek.gameplay-ingredients/Icons/Rigs/ic-rig-director-control.png.meta new file mode 100644 index 0000000..6de8c89 --- /dev/null +++ b/LocalPackages/net.peeweek.gameplay-ingredients/Icons/Rigs/ic-rig-director-control.png.meta @@ -0,0 +1,110 @@ +fileFormatVersion: 2 +guid: 0389dfe32851001499f36e2af3341970 +TextureImporter: + fileIDToRecycleName: {} + externalObjects: {} + serializedVersion: 9 + mipmaps: + mipMapMode: 0 + enableMipMap: 0 + sRGBTexture: 1 + linearTexture: 0 + fadeOut: 0 + borderMipMap: 0 + mipMapsPreserveCoverage: 0 + alphaTestReferenceValue: 0.5 + mipMapFadeDistanceStart: 1 + mipMapFadeDistanceEnd: 3 + bumpmap: + convertToNormalMap: 0 + externalNormalMap: 0 + heightScale: 0.25 + normalMapFilter: 0 + isReadable: 0 + streamingMipmaps: 0 + streamingMipmapsPriority: 0 + grayScaleToAlpha: 0 + generateCubemap: 6 + cubemapConvolution: 0 + seamlessCubemap: 0 + textureFormat: 1 + maxTextureSize: 2048 + textureSettings: + serializedVersion: 2 + filterMode: 0 + aniso: 1 + mipBias: -100 + wrapU: 1 + wrapV: 1 + wrapW: -1 + nPOTScale: 0 + lightmap: 0 + compressionQuality: 50 + spriteMode: 0 + spriteExtrude: 1 + spriteMeshType: 1 + alignment: 0 + spritePivot: {x: 0.5, y: 0.5} + spritePixelsToUnits: 100 + spriteBorder: {x: 0, y: 0, z: 0, w: 0} + spriteGenerateFallbackPhysicsShape: 1 + alphaUsage: 1 + alphaIsTransparency: 1 + spriteTessellationDetail: -1 + textureType: 2 + textureShape: 1 + singleChannelComponent: 0 + maxTextureSizeSet: 0 + compressionQualitySet: 0 + textureFormatSet: 0 + platformSettings: + - serializedVersion: 2 + buildTarget: DefaultTexturePlatform + maxTextureSize: 2048 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 0 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + androidETC2FallbackOverride: 0 + - serializedVersion: 2 + buildTarget: Standalone + maxTextureSize: 2048 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 0 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + androidETC2FallbackOverride: 0 + - serializedVersion: 2 + buildTarget: WebGL + maxTextureSize: 2048 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 0 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + androidETC2FallbackOverride: 0 + spriteSheet: + serializedVersion: 2 + sprites: [] + outline: [] + physicsShape: [] + bones: [] + spriteID: + vertices: [] + indices: + edges: [] + weights: [] + spritePackingTag: + pSDRemoveMatte: 0 + pSDShowRemoveMatteOption: 0 + userData: + assetBundleName: + assetBundleVariant: diff --git a/LocalPackages/net.peeweek.gameplay-ingredients/Icons/Rigs/ic-rig-float.png b/LocalPackages/net.peeweek.gameplay-ingredients/Icons/Rigs/ic-rig-float.png new file mode 100644 index 0000000..e981039 --- /dev/null +++ b/LocalPackages/net.peeweek.gameplay-ingredients/Icons/Rigs/ic-rig-float.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:96875ad7195de944bb9b45ac618190b1843ef7198ab959b8368348b5c846017c +size 363 diff --git a/LocalPackages/net.peeweek.gameplay-ingredients/Icons/Rigs/ic-rig-float.png.meta b/LocalPackages/net.peeweek.gameplay-ingredients/Icons/Rigs/ic-rig-float.png.meta new file mode 100644 index 0000000..8f7eed2 --- /dev/null +++ b/LocalPackages/net.peeweek.gameplay-ingredients/Icons/Rigs/ic-rig-float.png.meta @@ -0,0 +1,110 @@ +fileFormatVersion: 2 +guid: 8dadb8f0fa7dd724e9cb4437d466e85a +TextureImporter: + fileIDToRecycleName: {} + externalObjects: {} + serializedVersion: 9 + mipmaps: + mipMapMode: 0 + enableMipMap: 0 + sRGBTexture: 1 + linearTexture: 0 + fadeOut: 0 + borderMipMap: 0 + mipMapsPreserveCoverage: 0 + alphaTestReferenceValue: 0.5 + mipMapFadeDistanceStart: 1 + mipMapFadeDistanceEnd: 3 + bumpmap: + convertToNormalMap: 0 + externalNormalMap: 0 + heightScale: 0.25 + normalMapFilter: 0 + isReadable: 0 + streamingMipmaps: 0 + streamingMipmapsPriority: 0 + grayScaleToAlpha: 0 + generateCubemap: 6 + cubemapConvolution: 0 + seamlessCubemap: 0 + textureFormat: 1 + maxTextureSize: 2048 + textureSettings: + serializedVersion: 2 + filterMode: 0 + aniso: 1 + mipBias: -100 + wrapU: 1 + wrapV: 1 + wrapW: -1 + nPOTScale: 0 + lightmap: 0 + compressionQuality: 50 + spriteMode: 0 + spriteExtrude: 1 + spriteMeshType: 1 + alignment: 0 + spritePivot: {x: 0.5, y: 0.5} + spritePixelsToUnits: 100 + spriteBorder: {x: 0, y: 0, z: 0, w: 0} + spriteGenerateFallbackPhysicsShape: 1 + alphaUsage: 1 + alphaIsTransparency: 1 + spriteTessellationDetail: -1 + textureType: 2 + textureShape: 1 + singleChannelComponent: 0 + maxTextureSizeSet: 0 + compressionQualitySet: 0 + textureFormatSet: 0 + platformSettings: + - serializedVersion: 2 + buildTarget: DefaultTexturePlatform + maxTextureSize: 2048 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 0 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + androidETC2FallbackOverride: 0 + - serializedVersion: 2 + buildTarget: Standalone + maxTextureSize: 2048 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 0 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + androidETC2FallbackOverride: 0 + - serializedVersion: 2 + buildTarget: WebGL + maxTextureSize: 2048 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 0 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + androidETC2FallbackOverride: 0 + spriteSheet: + serializedVersion: 2 + sprites: [] + outline: [] + physicsShape: [] + bones: [] + spriteID: + vertices: [] + indices: + edges: [] + weights: [] + spritePackingTag: + pSDRemoveMatte: 0 + pSDShowRemoveMatteOption: 0 + userData: + assetBundleName: + assetBundleVariant: diff --git a/LocalPackages/net.peeweek.gameplay-ingredients/Icons/Rigs/ic-rig-follow-path.png b/LocalPackages/net.peeweek.gameplay-ingredients/Icons/Rigs/ic-rig-follow-path.png new file mode 100644 index 0000000..8d3a68b --- /dev/null +++ b/LocalPackages/net.peeweek.gameplay-ingredients/Icons/Rigs/ic-rig-follow-path.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:420519db34dc8543c8649dde6b7bd45f4eae947f9dd9e7d3dc1c373291c13726 +size 657 diff --git a/LocalPackages/net.peeweek.gameplay-ingredients/Icons/Rigs/ic-rig-follow-path.png.meta b/LocalPackages/net.peeweek.gameplay-ingredients/Icons/Rigs/ic-rig-follow-path.png.meta new file mode 100644 index 0000000..5859d34 --- /dev/null +++ b/LocalPackages/net.peeweek.gameplay-ingredients/Icons/Rigs/ic-rig-follow-path.png.meta @@ -0,0 +1,110 @@ +fileFormatVersion: 2 +guid: b701ab6baf5c6b0439073a439e032028 +TextureImporter: + fileIDToRecycleName: {} + externalObjects: {} + serializedVersion: 9 + mipmaps: + mipMapMode: 0 + enableMipMap: 0 + sRGBTexture: 1 + linearTexture: 0 + fadeOut: 0 + borderMipMap: 0 + mipMapsPreserveCoverage: 0 + alphaTestReferenceValue: 0.5 + mipMapFadeDistanceStart: 1 + mipMapFadeDistanceEnd: 3 + bumpmap: + convertToNormalMap: 0 + externalNormalMap: 0 + heightScale: 0.25 + normalMapFilter: 0 + isReadable: 0 + streamingMipmaps: 0 + streamingMipmapsPriority: 0 + grayScaleToAlpha: 0 + generateCubemap: 6 + cubemapConvolution: 0 + seamlessCubemap: 0 + textureFormat: 1 + maxTextureSize: 2048 + textureSettings: + serializedVersion: 2 + filterMode: 0 + aniso: 1 + mipBias: -100 + wrapU: 1 + wrapV: 1 + wrapW: -1 + nPOTScale: 0 + lightmap: 0 + compressionQuality: 50 + spriteMode: 0 + spriteExtrude: 1 + spriteMeshType: 1 + alignment: 0 + spritePivot: {x: 0.5, y: 0.5} + spritePixelsToUnits: 100 + spriteBorder: {x: 0, y: 0, z: 0, w: 0} + spriteGenerateFallbackPhysicsShape: 1 + alphaUsage: 1 + alphaIsTransparency: 1 + spriteTessellationDetail: -1 + textureType: 2 + textureShape: 1 + singleChannelComponent: 0 + maxTextureSizeSet: 0 + compressionQualitySet: 0 + textureFormatSet: 0 + platformSettings: + - serializedVersion: 2 + buildTarget: DefaultTexturePlatform + maxTextureSize: 2048 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 0 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + androidETC2FallbackOverride: 0 + - serializedVersion: 2 + buildTarget: Standalone + maxTextureSize: 2048 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 0 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + androidETC2FallbackOverride: 0 + - serializedVersion: 2 + buildTarget: WebGL + maxTextureSize: 2048 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 0 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + androidETC2FallbackOverride: 0 + spriteSheet: + serializedVersion: 2 + sprites: [] + outline: [] + physicsShape: [] + bones: [] + spriteID: + vertices: [] + indices: + edges: [] + weights: [] + spritePackingTag: + pSDRemoveMatte: 0 + pSDShowRemoveMatteOption: 0 + userData: + assetBundleName: + assetBundleVariant: diff --git a/LocalPackages/net.peeweek.gameplay-ingredients/Icons/Rigs/ic-rig-lookat.png b/LocalPackages/net.peeweek.gameplay-ingredients/Icons/Rigs/ic-rig-lookat.png new file mode 100644 index 0000000..973901d --- /dev/null +++ b/LocalPackages/net.peeweek.gameplay-ingredients/Icons/Rigs/ic-rig-lookat.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:7629209e42dc7ecce16d93fbafed8904b14cacad01392b48c6135d14bc72f5b5 +size 679 diff --git a/LocalPackages/net.peeweek.gameplay-ingredients/Icons/Rigs/ic-rig-lookat.png.meta b/LocalPackages/net.peeweek.gameplay-ingredients/Icons/Rigs/ic-rig-lookat.png.meta new file mode 100644 index 0000000..03e8893 --- /dev/null +++ b/LocalPackages/net.peeweek.gameplay-ingredients/Icons/Rigs/ic-rig-lookat.png.meta @@ -0,0 +1,110 @@ +fileFormatVersion: 2 +guid: 12b9370759a3efb4788a612b8ff4b4ed +TextureImporter: + fileIDToRecycleName: {} + externalObjects: {} + serializedVersion: 9 + mipmaps: + mipMapMode: 0 + enableMipMap: 0 + sRGBTexture: 1 + linearTexture: 0 + fadeOut: 0 + borderMipMap: 0 + mipMapsPreserveCoverage: 0 + alphaTestReferenceValue: 0.5 + mipMapFadeDistanceStart: 1 + mipMapFadeDistanceEnd: 3 + bumpmap: + convertToNormalMap: 0 + externalNormalMap: 0 + heightScale: 0.25 + normalMapFilter: 0 + isReadable: 0 + streamingMipmaps: 0 + streamingMipmapsPriority: 0 + grayScaleToAlpha: 0 + generateCubemap: 6 + cubemapConvolution: 0 + seamlessCubemap: 0 + textureFormat: 1 + maxTextureSize: 2048 + textureSettings: + serializedVersion: 2 + filterMode: 0 + aniso: 1 + mipBias: -100 + wrapU: 1 + wrapV: 1 + wrapW: -1 + nPOTScale: 0 + lightmap: 0 + compressionQuality: 50 + spriteMode: 0 + spriteExtrude: 1 + spriteMeshType: 1 + alignment: 0 + spritePivot: {x: 0.5, y: 0.5} + spritePixelsToUnits: 100 + spriteBorder: {x: 0, y: 0, z: 0, w: 0} + spriteGenerateFallbackPhysicsShape: 1 + alphaUsage: 1 + alphaIsTransparency: 1 + spriteTessellationDetail: -1 + textureType: 2 + textureShape: 1 + singleChannelComponent: 0 + maxTextureSizeSet: 0 + compressionQualitySet: 0 + textureFormatSet: 0 + platformSettings: + - serializedVersion: 2 + buildTarget: DefaultTexturePlatform + maxTextureSize: 2048 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 0 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + androidETC2FallbackOverride: 0 + - serializedVersion: 2 + buildTarget: Standalone + maxTextureSize: 2048 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 0 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + androidETC2FallbackOverride: 0 + - serializedVersion: 2 + buildTarget: WebGL + maxTextureSize: 2048 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 0 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + androidETC2FallbackOverride: 0 + spriteSheet: + serializedVersion: 2 + sprites: [] + outline: [] + physicsShape: [] + bones: [] + spriteID: + vertices: [] + indices: + edges: [] + weights: [] + spritePackingTag: + pSDRemoveMatte: 0 + pSDShowRemoveMatteOption: 0 + userData: + assetBundleName: + assetBundleVariant: diff --git a/LocalPackages/net.peeweek.gameplay-ingredients/Icons/Rigs/ic-rig-reachposition.png b/LocalPackages/net.peeweek.gameplay-ingredients/Icons/Rigs/ic-rig-reachposition.png new file mode 100644 index 0000000..100946f --- /dev/null +++ b/LocalPackages/net.peeweek.gameplay-ingredients/Icons/Rigs/ic-rig-reachposition.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:e03b8c9c5066978b61327c7b170322f21e3555ed5bcdf046ab3b95b32cce91b3 +size 800 diff --git a/LocalPackages/net.peeweek.gameplay-ingredients/Icons/Rigs/ic-rig-reachposition.png.meta b/LocalPackages/net.peeweek.gameplay-ingredients/Icons/Rigs/ic-rig-reachposition.png.meta new file mode 100644 index 0000000..0630b46 --- /dev/null +++ b/LocalPackages/net.peeweek.gameplay-ingredients/Icons/Rigs/ic-rig-reachposition.png.meta @@ -0,0 +1,110 @@ +fileFormatVersion: 2 +guid: 8957eefd6c14dd24fae1bd3c7fb3309b +TextureImporter: + fileIDToRecycleName: {} + externalObjects: {} + serializedVersion: 9 + mipmaps: + mipMapMode: 0 + enableMipMap: 0 + sRGBTexture: 1 + linearTexture: 0 + fadeOut: 0 + borderMipMap: 0 + mipMapsPreserveCoverage: 0 + alphaTestReferenceValue: 0.5 + mipMapFadeDistanceStart: 1 + mipMapFadeDistanceEnd: 3 + bumpmap: + convertToNormalMap: 0 + externalNormalMap: 0 + heightScale: 0.25 + normalMapFilter: 0 + isReadable: 0 + streamingMipmaps: 0 + streamingMipmapsPriority: 0 + grayScaleToAlpha: 0 + generateCubemap: 6 + cubemapConvolution: 0 + seamlessCubemap: 0 + textureFormat: 1 + maxTextureSize: 2048 + textureSettings: + serializedVersion: 2 + filterMode: 0 + aniso: 1 + mipBias: -100 + wrapU: 1 + wrapV: 1 + wrapW: -1 + nPOTScale: 0 + lightmap: 0 + compressionQuality: 50 + spriteMode: 0 + spriteExtrude: 1 + spriteMeshType: 1 + alignment: 0 + spritePivot: {x: 0.5, y: 0.5} + spritePixelsToUnits: 100 + spriteBorder: {x: 0, y: 0, z: 0, w: 0} + spriteGenerateFallbackPhysicsShape: 1 + alphaUsage: 1 + alphaIsTransparency: 1 + spriteTessellationDetail: -1 + textureType: 2 + textureShape: 1 + singleChannelComponent: 0 + maxTextureSizeSet: 0 + compressionQualitySet: 0 + textureFormatSet: 0 + platformSettings: + - serializedVersion: 2 + buildTarget: DefaultTexturePlatform + maxTextureSize: 2048 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 0 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + androidETC2FallbackOverride: 0 + - serializedVersion: 2 + buildTarget: Standalone + maxTextureSize: 2048 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 0 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + androidETC2FallbackOverride: 0 + - serializedVersion: 2 + buildTarget: WebGL + maxTextureSize: 2048 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 0 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + androidETC2FallbackOverride: 0 + spriteSheet: + serializedVersion: 2 + sprites: [] + outline: [] + physicsShape: [] + bones: [] + spriteID: + vertices: [] + indices: + edges: [] + weights: [] + spritePackingTag: + pSDRemoveMatte: 0 + pSDShowRemoveMatteOption: 0 + userData: + assetBundleName: + assetBundleVariant: diff --git a/LocalPackages/net.peeweek.gameplay-ingredients/Icons/Rigs/ic-rig-rotate.png b/LocalPackages/net.peeweek.gameplay-ingredients/Icons/Rigs/ic-rig-rotate.png new file mode 100644 index 0000000..495f0fa --- /dev/null +++ b/LocalPackages/net.peeweek.gameplay-ingredients/Icons/Rigs/ic-rig-rotate.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:3bd7b5451c5c5b23be0681080976f5dadd893378331a9969c5f050f11733457c +size 802 diff --git a/LocalPackages/net.peeweek.gameplay-ingredients/Icons/Rigs/ic-rig-rotate.png.meta b/LocalPackages/net.peeweek.gameplay-ingredients/Icons/Rigs/ic-rig-rotate.png.meta new file mode 100644 index 0000000..def1b64 --- /dev/null +++ b/LocalPackages/net.peeweek.gameplay-ingredients/Icons/Rigs/ic-rig-rotate.png.meta @@ -0,0 +1,110 @@ +fileFormatVersion: 2 +guid: e66ad50918d3fec48bbe63e19e4a881f +TextureImporter: + fileIDToRecycleName: {} + externalObjects: {} + serializedVersion: 9 + mipmaps: + mipMapMode: 0 + enableMipMap: 0 + sRGBTexture: 1 + linearTexture: 0 + fadeOut: 0 + borderMipMap: 0 + mipMapsPreserveCoverage: 0 + alphaTestReferenceValue: 0.5 + mipMapFadeDistanceStart: 1 + mipMapFadeDistanceEnd: 3 + bumpmap: + convertToNormalMap: 0 + externalNormalMap: 0 + heightScale: 0.25 + normalMapFilter: 0 + isReadable: 0 + streamingMipmaps: 0 + streamingMipmapsPriority: 0 + grayScaleToAlpha: 0 + generateCubemap: 6 + cubemapConvolution: 0 + seamlessCubemap: 0 + textureFormat: 1 + maxTextureSize: 2048 + textureSettings: + serializedVersion: 2 + filterMode: 0 + aniso: 1 + mipBias: -100 + wrapU: 1 + wrapV: 1 + wrapW: -1 + nPOTScale: 0 + lightmap: 0 + compressionQuality: 50 + spriteMode: 0 + spriteExtrude: 1 + spriteMeshType: 1 + alignment: 0 + spritePivot: {x: 0.5, y: 0.5} + spritePixelsToUnits: 100 + spriteBorder: {x: 0, y: 0, z: 0, w: 0} + spriteGenerateFallbackPhysicsShape: 1 + alphaUsage: 1 + alphaIsTransparency: 1 + spriteTessellationDetail: -1 + textureType: 2 + textureShape: 1 + singleChannelComponent: 0 + maxTextureSizeSet: 0 + compressionQualitySet: 0 + textureFormatSet: 0 + platformSettings: + - serializedVersion: 2 + buildTarget: DefaultTexturePlatform + maxTextureSize: 2048 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 0 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + androidETC2FallbackOverride: 0 + - serializedVersion: 2 + buildTarget: Standalone + maxTextureSize: 2048 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 0 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + androidETC2FallbackOverride: 0 + - serializedVersion: 2 + buildTarget: WebGL + maxTextureSize: 2048 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 0 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + androidETC2FallbackOverride: 0 + spriteSheet: + serializedVersion: 2 + sprites: [] + outline: [] + physicsShape: [] + bones: [] + spriteID: + vertices: [] + indices: + edges: [] + weights: [] + spritePackingTag: + pSDRemoveMatte: 0 + pSDShowRemoveMatteOption: 0 + userData: + assetBundleName: + assetBundleVariant: diff --git a/LocalPackages/net.peeweek.gameplay-ingredients/Icons/fugue-icons-licence.txt b/LocalPackages/net.peeweek.gameplay-ingredients/Icons/fugue-icons-licence.txt new file mode 100644 index 0000000..6bd7425 --- /dev/null +++ b/LocalPackages/net.peeweek.gameplay-ingredients/Icons/fugue-icons-licence.txt @@ -0,0 +1,80 @@ +Fugue Icons + +(C) 2013 Yusuke Kamiyamane. All rights reserved. + +These icons are licensed under a Creative Commons +Attribution 3.0 License. + + +If you can't or don't want to provide attribution, please +purchase a royalty-free license. + + +I'm unavailable for custom icon design work. But your +suggestions are always welcome! + + +------------------------------------------------------------ + +All logos and trademarks in some icons are property of their +respective owners. + +------------------------------------------------------------ + +- geotag + + (C) Geotag Icon Project. All rights reserved. + + + Geotag icon is licensed under a Creative Commons + Attribution-Share Alike 3.0 License or LGPL. + + + +- language + + (C) Language Icon Project. All rights reserved. + + + Language icon is licensed under a Creative Commons + Attribution-Share Alike 3.0 License. + + +- open-share + + (C) Open Share Icon Project. All rights reserved. + + + Open Share icon is licensed under a Creative Commons + Attribution-Share Alike 3.0 License. + + +- opml + + (C) OPML Icon Project. All rights reserved. + + + OPML icon is licensed under a Creative Commons + Attribution-Share Alike 2.5 License. + + +- share + + (C) Share Icon Project. All rights reserved. + + + Share icon is licensed under a GPL or LGPL or BSD or + Creative Commons Attribution 2.5 License. + + + + + +- xfn + + (C) Wolfgang Bartelme. All rights reserved. + + + XFN icon is licensed under a Creative Commons + Attribution-Share Alike 2.5 License. + \ No newline at end of file diff --git a/LocalPackages/net.peeweek.gameplay-ingredients/Icons/fugue-icons-licence.txt.meta b/LocalPackages/net.peeweek.gameplay-ingredients/Icons/fugue-icons-licence.txt.meta new file mode 100644 index 0000000..66c316b --- /dev/null +++ b/LocalPackages/net.peeweek.gameplay-ingredients/Icons/fugue-icons-licence.txt.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: 6b7e68cddb979094f80be7ec7ad76cbc +TextScriptImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/LocalPackages/net.peeweek.gameplay-ingredients/LICENSE b/LocalPackages/net.peeweek.gameplay-ingredients/LICENSE new file mode 100644 index 0000000..4b2ae96 --- /dev/null +++ b/LocalPackages/net.peeweek.gameplay-ingredients/LICENSE @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) 2018 Thomas ICHÉ + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/LocalPackages/net.peeweek.gameplay-ingredients/LICENSE.meta b/LocalPackages/net.peeweek.gameplay-ingredients/LICENSE.meta new file mode 100644 index 0000000..4200988 --- /dev/null +++ b/LocalPackages/net.peeweek.gameplay-ingredients/LICENSE.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: f3d05d1088ace584489c2e0fdfdb75b0 +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/LocalPackages/net.peeweek.gameplay-ingredients/NaughtyAttributes.meta b/LocalPackages/net.peeweek.gameplay-ingredients/NaughtyAttributes.meta new file mode 100644 index 0000000..58f2ca2 --- /dev/null +++ b/LocalPackages/net.peeweek.gameplay-ingredients/NaughtyAttributes.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: bfdc546b0991bd54fb24ad7151d27f7e +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/LocalPackages/net.peeweek.gameplay-ingredients/NaughtyAttributes/Core.meta b/LocalPackages/net.peeweek.gameplay-ingredients/NaughtyAttributes/Core.meta new file mode 100644 index 0000000..a055450 --- /dev/null +++ b/LocalPackages/net.peeweek.gameplay-ingredients/NaughtyAttributes/Core.meta @@ -0,0 +1,10 @@ +fileFormatVersion: 2 +guid: 1f67e408a6d0adf4ab29d095ccd8b116 +folderAsset: yes +timeCreated: 1507998942 +licenseType: Free +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/LocalPackages/net.peeweek.gameplay-ingredients/NaughtyAttributes/Core/ConditionOperator.cs b/LocalPackages/net.peeweek.gameplay-ingredients/NaughtyAttributes/Core/ConditionOperator.cs new file mode 100644 index 0000000..2474f6d --- /dev/null +++ b/LocalPackages/net.peeweek.gameplay-ingredients/NaughtyAttributes/Core/ConditionOperator.cs @@ -0,0 +1,10 @@ +using System; + +namespace NaughtyAttributes +{ + public enum ConditionOperator + { + And, + Or + } +} diff --git a/LocalPackages/net.peeweek.gameplay-ingredients/NaughtyAttributes/Core/ConditionOperator.cs.meta b/LocalPackages/net.peeweek.gameplay-ingredients/NaughtyAttributes/Core/ConditionOperator.cs.meta new file mode 100644 index 0000000..21b1100 --- /dev/null +++ b/LocalPackages/net.peeweek.gameplay-ingredients/NaughtyAttributes/Core/ConditionOperator.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 8da69fd2354ea264bb1c54362ee02938 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/LocalPackages/net.peeweek.gameplay-ingredients/NaughtyAttributes/Core/DrawConditionAttributes.meta b/LocalPackages/net.peeweek.gameplay-ingredients/NaughtyAttributes/Core/DrawConditionAttributes.meta new file mode 100644 index 0000000..1b422d7 --- /dev/null +++ b/LocalPackages/net.peeweek.gameplay-ingredients/NaughtyAttributes/Core/DrawConditionAttributes.meta @@ -0,0 +1,10 @@ +fileFormatVersion: 2 +guid: 0d8ad70d0e1e04248b1f5c5d5fb358f4 +folderAsset: yes +timeCreated: 1508414568 +licenseType: Free +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/LocalPackages/net.peeweek.gameplay-ingredients/NaughtyAttributes/Core/DrawConditionAttributes/DrawConditionAttribute.cs b/LocalPackages/net.peeweek.gameplay-ingredients/NaughtyAttributes/Core/DrawConditionAttributes/DrawConditionAttribute.cs new file mode 100644 index 0000000..30b684f --- /dev/null +++ b/LocalPackages/net.peeweek.gameplay-ingredients/NaughtyAttributes/Core/DrawConditionAttributes/DrawConditionAttribute.cs @@ -0,0 +1,9 @@ +using System; + +namespace NaughtyAttributes +{ + public class DrawConditionAttribute : NaughtyAttribute + { + + } +} diff --git a/LocalPackages/net.peeweek.gameplay-ingredients/NaughtyAttributes/Core/DrawConditionAttributes/DrawConditionAttribute.cs.meta b/LocalPackages/net.peeweek.gameplay-ingredients/NaughtyAttributes/Core/DrawConditionAttributes/DrawConditionAttribute.cs.meta new file mode 100644 index 0000000..6d27b22 --- /dev/null +++ b/LocalPackages/net.peeweek.gameplay-ingredients/NaughtyAttributes/Core/DrawConditionAttributes/DrawConditionAttribute.cs.meta @@ -0,0 +1,13 @@ +fileFormatVersion: 2 +guid: 8fd9817e8bf3e054ab8e73b47bdce8c7 +timeCreated: 1508414568 +licenseType: Free +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/LocalPackages/net.peeweek.gameplay-ingredients/NaughtyAttributes/Core/DrawConditionAttributes/HideIfAttribute.cs b/LocalPackages/net.peeweek.gameplay-ingredients/NaughtyAttributes/Core/DrawConditionAttributes/HideIfAttribute.cs new file mode 100644 index 0000000..b739135 --- /dev/null +++ b/LocalPackages/net.peeweek.gameplay-ingredients/NaughtyAttributes/Core/DrawConditionAttributes/HideIfAttribute.cs @@ -0,0 +1,20 @@ +using System; + +namespace NaughtyAttributes +{ + [AttributeUsage(AttributeTargets.Field, AllowMultiple = false, Inherited = true)] + public class HideIfAttribute : ShowIfAttribute + { + public HideIfAttribute(string condition) + : base(condition) + { + Reversed = true; + } + + public HideIfAttribute(ConditionOperator conditionOperator, params string[] conditions) + : base(conditionOperator, conditions) + { + Reversed = true; + } + } +} diff --git a/LocalPackages/net.peeweek.gameplay-ingredients/NaughtyAttributes/Core/DrawConditionAttributes/HideIfAttribute.cs.meta b/LocalPackages/net.peeweek.gameplay-ingredients/NaughtyAttributes/Core/DrawConditionAttributes/HideIfAttribute.cs.meta new file mode 100644 index 0000000..363b863 --- /dev/null +++ b/LocalPackages/net.peeweek.gameplay-ingredients/NaughtyAttributes/Core/DrawConditionAttributes/HideIfAttribute.cs.meta @@ -0,0 +1,13 @@ +fileFormatVersion: 2 +guid: aafc3a255165311419b7070198e7ffaf +timeCreated: 1508414568 +licenseType: Free +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/LocalPackages/net.peeweek.gameplay-ingredients/NaughtyAttributes/Core/DrawConditionAttributes/ShowIfAttribute.cs b/LocalPackages/net.peeweek.gameplay-ingredients/NaughtyAttributes/Core/DrawConditionAttributes/ShowIfAttribute.cs new file mode 100644 index 0000000..46059f3 --- /dev/null +++ b/LocalPackages/net.peeweek.gameplay-ingredients/NaughtyAttributes/Core/DrawConditionAttributes/ShowIfAttribute.cs @@ -0,0 +1,24 @@ +using System; + +namespace NaughtyAttributes +{ + [AttributeUsage(AttributeTargets.Field, AllowMultiple = false, Inherited = true)] + public class ShowIfAttribute : DrawConditionAttribute + { + public string[] Conditions { get; private set; } + public ConditionOperator ConditionOperator { get; private set; } + public bool Reversed { get; protected set; } + + public ShowIfAttribute(string condition) + { + ConditionOperator = ConditionOperator.And; + Conditions = new string[1] { condition }; + } + + public ShowIfAttribute(ConditionOperator conditionOperator, params string[] conditions) + { + ConditionOperator = conditionOperator; + Conditions = conditions; + } + } +} diff --git a/LocalPackages/net.peeweek.gameplay-ingredients/NaughtyAttributes/Core/DrawConditionAttributes/ShowIfAttribute.cs.meta b/LocalPackages/net.peeweek.gameplay-ingredients/NaughtyAttributes/Core/DrawConditionAttributes/ShowIfAttribute.cs.meta new file mode 100644 index 0000000..cff1299 --- /dev/null +++ b/LocalPackages/net.peeweek.gameplay-ingredients/NaughtyAttributes/Core/DrawConditionAttributes/ShowIfAttribute.cs.meta @@ -0,0 +1,13 @@ +fileFormatVersion: 2 +guid: 6a9e9448e6e70094297d49ec9c82c6e1 +timeCreated: 1508414568 +licenseType: Free +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/LocalPackages/net.peeweek.gameplay-ingredients/NaughtyAttributes/Core/DrawerAttributes.meta b/LocalPackages/net.peeweek.gameplay-ingredients/NaughtyAttributes/Core/DrawerAttributes.meta new file mode 100644 index 0000000..756c714 --- /dev/null +++ b/LocalPackages/net.peeweek.gameplay-ingredients/NaughtyAttributes/Core/DrawerAttributes.meta @@ -0,0 +1,10 @@ +fileFormatVersion: 2 +guid: c76425e719cd4424d868674bcfb233f2 +folderAsset: yes +timeCreated: 1508151410 +licenseType: Free +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/LocalPackages/net.peeweek.gameplay-ingredients/NaughtyAttributes/Core/DrawerAttributes/ButtonAttribute.cs b/LocalPackages/net.peeweek.gameplay-ingredients/NaughtyAttributes/Core/DrawerAttributes/ButtonAttribute.cs new file mode 100644 index 0000000..9e89ef6 --- /dev/null +++ b/LocalPackages/net.peeweek.gameplay-ingredients/NaughtyAttributes/Core/DrawerAttributes/ButtonAttribute.cs @@ -0,0 +1,15 @@ +using System; + +namespace NaughtyAttributes +{ + [AttributeUsage(AttributeTargets.Method, AllowMultiple = false, Inherited = true)] + public class ButtonAttribute : DrawerAttribute + { + public string Text { get; private set; } + + public ButtonAttribute(string text = null) + { + this.Text = text; + } + } +} diff --git a/LocalPackages/net.peeweek.gameplay-ingredients/NaughtyAttributes/Core/DrawerAttributes/ButtonAttribute.cs.meta b/LocalPackages/net.peeweek.gameplay-ingredients/NaughtyAttributes/Core/DrawerAttributes/ButtonAttribute.cs.meta new file mode 100644 index 0000000..3f00112 --- /dev/null +++ b/LocalPackages/net.peeweek.gameplay-ingredients/NaughtyAttributes/Core/DrawerAttributes/ButtonAttribute.cs.meta @@ -0,0 +1,13 @@ +fileFormatVersion: 2 +guid: d61d9be90aa48764096a2bea37c9bd60 +timeCreated: 1508591778 +licenseType: Free +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/LocalPackages/net.peeweek.gameplay-ingredients/NaughtyAttributes/Core/DrawerAttributes/DisableIfAttribute.cs b/LocalPackages/net.peeweek.gameplay-ingredients/NaughtyAttributes/Core/DrawerAttributes/DisableIfAttribute.cs new file mode 100644 index 0000000..d9db224 --- /dev/null +++ b/LocalPackages/net.peeweek.gameplay-ingredients/NaughtyAttributes/Core/DrawerAttributes/DisableIfAttribute.cs @@ -0,0 +1,20 @@ +using System; + +namespace NaughtyAttributes +{ + [AttributeUsage(AttributeTargets.Field, AllowMultiple = false, Inherited = true)] + public class DisableIfAttribute : EnableIfAttribute + { + public DisableIfAttribute(string condition) + : base(condition) + { + Reversed = true; + } + + public DisableIfAttribute(ConditionOperator conditionOperator, params string[] conditions) + : base(conditionOperator, conditions) + { + Reversed = true; + } + } +} diff --git a/LocalPackages/net.peeweek.gameplay-ingredients/NaughtyAttributes/Core/DrawerAttributes/DisableIfAttribute.cs.meta b/LocalPackages/net.peeweek.gameplay-ingredients/NaughtyAttributes/Core/DrawerAttributes/DisableIfAttribute.cs.meta new file mode 100644 index 0000000..7315069 --- /dev/null +++ b/LocalPackages/net.peeweek.gameplay-ingredients/NaughtyAttributes/Core/DrawerAttributes/DisableIfAttribute.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: dac53a514fd03bb48b3fae8d3d23bf78 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/LocalPackages/net.peeweek.gameplay-ingredients/NaughtyAttributes/Core/DrawerAttributes/DrawerAttribute.cs b/LocalPackages/net.peeweek.gameplay-ingredients/NaughtyAttributes/Core/DrawerAttributes/DrawerAttribute.cs new file mode 100644 index 0000000..b3a3a67 --- /dev/null +++ b/LocalPackages/net.peeweek.gameplay-ingredients/NaughtyAttributes/Core/DrawerAttributes/DrawerAttribute.cs @@ -0,0 +1,8 @@ +using System; + +namespace NaughtyAttributes +{ + public abstract class DrawerAttribute : NaughtyAttribute + { + } +} \ No newline at end of file diff --git a/LocalPackages/net.peeweek.gameplay-ingredients/NaughtyAttributes/Core/DrawerAttributes/DrawerAttribute.cs.meta b/LocalPackages/net.peeweek.gameplay-ingredients/NaughtyAttributes/Core/DrawerAttributes/DrawerAttribute.cs.meta new file mode 100644 index 0000000..2043b25 --- /dev/null +++ b/LocalPackages/net.peeweek.gameplay-ingredients/NaughtyAttributes/Core/DrawerAttributes/DrawerAttribute.cs.meta @@ -0,0 +1,13 @@ +fileFormatVersion: 2 +guid: 57360d74732bf2749b2f8d5e0a0ea6f5 +timeCreated: 1508151410 +licenseType: Free +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/LocalPackages/net.peeweek.gameplay-ingredients/NaughtyAttributes/Core/DrawerAttributes/DropdownAttribute.cs b/LocalPackages/net.peeweek.gameplay-ingredients/NaughtyAttributes/Core/DrawerAttributes/DropdownAttribute.cs new file mode 100644 index 0000000..0a433f4 --- /dev/null +++ b/LocalPackages/net.peeweek.gameplay-ingredients/NaughtyAttributes/Core/DrawerAttributes/DropdownAttribute.cs @@ -0,0 +1,57 @@ +using System; +using System.Collections; +using System.Collections.Generic; + +namespace NaughtyAttributes +{ + [AttributeUsage(AttributeTargets.Field, AllowMultiple = false, Inherited = true)] + public class DropdownAttribute : DrawerAttribute + { + public string ValuesFieldName { get; private set; } + + public DropdownAttribute(string valuesFieldName) + { + this.ValuesFieldName = valuesFieldName; + } + } + + public interface IDropdownList : IEnumerable> + { + } + + public class DropdownList : IDropdownList + { + private List> values; + + public DropdownList() + { + this.values = new List>(); + } + + public void Add(string displayName, T value) + { + this.values.Add(new KeyValuePair(displayName, value)); + } + + public IEnumerator> GetEnumerator() + { + return this.values.GetEnumerator(); + } + + IEnumerator IEnumerable.GetEnumerator() + { + return this.GetEnumerator(); + } + + public static explicit operator DropdownList(DropdownList target) + { + DropdownList result = new DropdownList(); + foreach (var kvp in target) + { + result.Add(kvp.Key, kvp.Value); + } + + return result; + } + } +} diff --git a/LocalPackages/net.peeweek.gameplay-ingredients/NaughtyAttributes/Core/DrawerAttributes/DropdownAttribute.cs.meta b/LocalPackages/net.peeweek.gameplay-ingredients/NaughtyAttributes/Core/DrawerAttributes/DropdownAttribute.cs.meta new file mode 100644 index 0000000..a402b5a --- /dev/null +++ b/LocalPackages/net.peeweek.gameplay-ingredients/NaughtyAttributes/Core/DrawerAttributes/DropdownAttribute.cs.meta @@ -0,0 +1,13 @@ +fileFormatVersion: 2 +guid: cd3b8c98b0803554e9152991fe806c62 +timeCreated: 1508752474 +licenseType: Free +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/LocalPackages/net.peeweek.gameplay-ingredients/NaughtyAttributes/Core/DrawerAttributes/EnableIfAttribute.cs b/LocalPackages/net.peeweek.gameplay-ingredients/NaughtyAttributes/Core/DrawerAttributes/EnableIfAttribute.cs new file mode 100644 index 0000000..d5f12d4 --- /dev/null +++ b/LocalPackages/net.peeweek.gameplay-ingredients/NaughtyAttributes/Core/DrawerAttributes/EnableIfAttribute.cs @@ -0,0 +1,24 @@ +using System; + +namespace NaughtyAttributes +{ + [AttributeUsage(AttributeTargets.Field, AllowMultiple = false, Inherited = true)] + public class EnableIfAttribute : DrawerAttribute + { + public string[] Conditions { get; private set; } + public ConditionOperator ConditionOperator { get; private set; } + public bool Reversed { get; protected set; } + + public EnableIfAttribute(string condition) + { + ConditionOperator = ConditionOperator.And; + Conditions = new string[1] { condition }; + } + + public EnableIfAttribute(ConditionOperator conditionOperator, params string[] conditions) + { + ConditionOperator = conditionOperator; + Conditions = conditions; + } + } +} diff --git a/LocalPackages/net.peeweek.gameplay-ingredients/NaughtyAttributes/Core/DrawerAttributes/EnableIfAttribute.cs.meta b/LocalPackages/net.peeweek.gameplay-ingredients/NaughtyAttributes/Core/DrawerAttributes/EnableIfAttribute.cs.meta new file mode 100644 index 0000000..b2e4973 --- /dev/null +++ b/LocalPackages/net.peeweek.gameplay-ingredients/NaughtyAttributes/Core/DrawerAttributes/EnableIfAttribute.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: a3ef98b2c0ffe1b4c91fbec23d77898e +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/LocalPackages/net.peeweek.gameplay-ingredients/NaughtyAttributes/Core/DrawerAttributes/LabelAttribute.cs b/LocalPackages/net.peeweek.gameplay-ingredients/NaughtyAttributes/Core/DrawerAttributes/LabelAttribute.cs new file mode 100644 index 0000000..d8a99d1 --- /dev/null +++ b/LocalPackages/net.peeweek.gameplay-ingredients/NaughtyAttributes/Core/DrawerAttributes/LabelAttribute.cs @@ -0,0 +1,18 @@ +using System; + +namespace NaughtyAttributes +{ + /// + /// Override default label + /// + [AttributeUsage(AttributeTargets.Field, AllowMultiple = false, Inherited = true)] + public class LabelAttribute : DrawerAttribute + { + public string Label { get; private set; } + + public LabelAttribute(string label) + { + this.Label = label; + } + } +} diff --git a/LocalPackages/net.peeweek.gameplay-ingredients/NaughtyAttributes/Core/DrawerAttributes/LabelAttribute.cs.meta b/LocalPackages/net.peeweek.gameplay-ingredients/NaughtyAttributes/Core/DrawerAttributes/LabelAttribute.cs.meta new file mode 100644 index 0000000..152c686 --- /dev/null +++ b/LocalPackages/net.peeweek.gameplay-ingredients/NaughtyAttributes/Core/DrawerAttributes/LabelAttribute.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: e58df0ada05db63488ddd96c571d7bc1 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/LocalPackages/net.peeweek.gameplay-ingredients/NaughtyAttributes/Core/DrawerAttributes/MinMaxSliderAttribute.cs b/LocalPackages/net.peeweek.gameplay-ingredients/NaughtyAttributes/Core/DrawerAttributes/MinMaxSliderAttribute.cs new file mode 100644 index 0000000..aa429de --- /dev/null +++ b/LocalPackages/net.peeweek.gameplay-ingredients/NaughtyAttributes/Core/DrawerAttributes/MinMaxSliderAttribute.cs @@ -0,0 +1,17 @@ +using System; + +namespace NaughtyAttributes +{ + [AttributeUsage(AttributeTargets.Field, AllowMultiple = false, Inherited = true)] + public class MinMaxSliderAttribute : DrawerAttribute + { + public float MinValue { get; private set; } + public float MaxValue { get; private set; } + + public MinMaxSliderAttribute(float minValue, float maxValue) + { + this.MinValue = minValue; + this.MaxValue = maxValue; + } + } +} diff --git a/LocalPackages/net.peeweek.gameplay-ingredients/NaughtyAttributes/Core/DrawerAttributes/MinMaxSliderAttribute.cs.meta b/LocalPackages/net.peeweek.gameplay-ingredients/NaughtyAttributes/Core/DrawerAttributes/MinMaxSliderAttribute.cs.meta new file mode 100644 index 0000000..8dd63f3 --- /dev/null +++ b/LocalPackages/net.peeweek.gameplay-ingredients/NaughtyAttributes/Core/DrawerAttributes/MinMaxSliderAttribute.cs.meta @@ -0,0 +1,13 @@ +fileFormatVersion: 2 +guid: 61d133a2d203a77419f35652a7f3fae0 +timeCreated: 1508427131 +licenseType: Free +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/LocalPackages/net.peeweek.gameplay-ingredients/NaughtyAttributes/Core/DrawerAttributes/ProgressBarAttribute.cs b/LocalPackages/net.peeweek.gameplay-ingredients/NaughtyAttributes/Core/DrawerAttributes/ProgressBarAttribute.cs new file mode 100644 index 0000000..0649477 --- /dev/null +++ b/LocalPackages/net.peeweek.gameplay-ingredients/NaughtyAttributes/Core/DrawerAttributes/ProgressBarAttribute.cs @@ -0,0 +1,32 @@ +using System; + +namespace NaughtyAttributes +{ + [AttributeUsage(AttributeTargets.Field, AllowMultiple = false, Inherited = true)] + public class ProgressBarAttribute : DrawerAttribute + { + public string Name { get; private set; } + public float MaxValue { get; private set; } + public ProgressBarColor Color { get; private set; } + + public ProgressBarAttribute(string name = "", float maxValue = 100, ProgressBarColor color = ProgressBarColor.Blue) + { + Name = name; + MaxValue = maxValue; + Color = color; + } + } + + public enum ProgressBarColor + { + Red, + Pink, + Orange, + Yellow, + Green, + Blue, + Indigo, + Violet, + White + } +} \ No newline at end of file diff --git a/LocalPackages/net.peeweek.gameplay-ingredients/Runtime/Hooks/OnStartHook.cs.meta b/LocalPackages/net.peeweek.gameplay-ingredients/NaughtyAttributes/Core/DrawerAttributes/ProgressBarAttribute.cs.meta similarity index 77% rename from LocalPackages/net.peeweek.gameplay-ingredients/Runtime/Hooks/OnStartHook.cs.meta rename to LocalPackages/net.peeweek.gameplay-ingredients/NaughtyAttributes/Core/DrawerAttributes/ProgressBarAttribute.cs.meta index 5439634..65bfa95 100644 --- a/LocalPackages/net.peeweek.gameplay-ingredients/Runtime/Hooks/OnStartHook.cs.meta +++ b/LocalPackages/net.peeweek.gameplay-ingredients/NaughtyAttributes/Core/DrawerAttributes/ProgressBarAttribute.cs.meta @@ -1,6 +1,6 @@ fileFormatVersion: 2 -guid: 718c1945292acbd4497cd28bcaa94f8d -timeCreated: 1504691534 +guid: 8d8eb74e78cba7b43b3025525c5084b9 +timeCreated: 1518435237 licenseType: Pro MonoImporter: externalObjects: {} diff --git a/LocalPackages/net.peeweek.gameplay-ingredients/NaughtyAttributes/Core/DrawerAttributes/ReadOnlyAttribute.cs b/LocalPackages/net.peeweek.gameplay-ingredients/NaughtyAttributes/Core/DrawerAttributes/ReadOnlyAttribute.cs new file mode 100644 index 0000000..d29794a --- /dev/null +++ b/LocalPackages/net.peeweek.gameplay-ingredients/NaughtyAttributes/Core/DrawerAttributes/ReadOnlyAttribute.cs @@ -0,0 +1,9 @@ +using System; + +namespace NaughtyAttributes +{ + [AttributeUsage(AttributeTargets.Field, AllowMultiple = false, Inherited = true)] + public class ReadOnlyAttribute : DrawerAttribute + { + } +} diff --git a/LocalPackages/net.peeweek.gameplay-ingredients/NaughtyAttributes/Core/DrawerAttributes/ReadOnlyAttribute.cs.meta b/LocalPackages/net.peeweek.gameplay-ingredients/NaughtyAttributes/Core/DrawerAttributes/ReadOnlyAttribute.cs.meta new file mode 100644 index 0000000..54b0ced --- /dev/null +++ b/LocalPackages/net.peeweek.gameplay-ingredients/NaughtyAttributes/Core/DrawerAttributes/ReadOnlyAttribute.cs.meta @@ -0,0 +1,13 @@ +fileFormatVersion: 2 +guid: 4fa676ebc6d589c44817272871db148b +timeCreated: 1508862052 +licenseType: Free +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/LocalPackages/net.peeweek.gameplay-ingredients/NaughtyAttributes/Core/DrawerAttributes/ReorderableListAttribute.cs b/LocalPackages/net.peeweek.gameplay-ingredients/NaughtyAttributes/Core/DrawerAttributes/ReorderableListAttribute.cs new file mode 100644 index 0000000..ff1a701 --- /dev/null +++ b/LocalPackages/net.peeweek.gameplay-ingredients/NaughtyAttributes/Core/DrawerAttributes/ReorderableListAttribute.cs @@ -0,0 +1,9 @@ +using System; + +namespace NaughtyAttributes +{ + [AttributeUsage(AttributeTargets.Field, AllowMultiple = false, Inherited = true)] + public class ReorderableListAttribute : DrawerAttribute + { + } +} diff --git a/LocalPackages/net.peeweek.gameplay-ingredients/NaughtyAttributes/Core/DrawerAttributes/ReorderableListAttribute.cs.meta b/LocalPackages/net.peeweek.gameplay-ingredients/NaughtyAttributes/Core/DrawerAttributes/ReorderableListAttribute.cs.meta new file mode 100644 index 0000000..59e4c99 --- /dev/null +++ b/LocalPackages/net.peeweek.gameplay-ingredients/NaughtyAttributes/Core/DrawerAttributes/ReorderableListAttribute.cs.meta @@ -0,0 +1,13 @@ +fileFormatVersion: 2 +guid: ff85489452472c241987e5ba4c5e512a +timeCreated: 1508402303 +licenseType: Free +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/LocalPackages/net.peeweek.gameplay-ingredients/NaughtyAttributes/Core/DrawerAttributes/ResizableTextAreaAttribute.cs b/LocalPackages/net.peeweek.gameplay-ingredients/NaughtyAttributes/Core/DrawerAttributes/ResizableTextAreaAttribute.cs new file mode 100644 index 0000000..e84e664 --- /dev/null +++ b/LocalPackages/net.peeweek.gameplay-ingredients/NaughtyAttributes/Core/DrawerAttributes/ResizableTextAreaAttribute.cs @@ -0,0 +1,9 @@ +using System; + +namespace NaughtyAttributes +{ + [AttributeUsage(AttributeTargets.Field, AllowMultiple = false, Inherited = true)] + public class ResizableTextAreaAttribute : DrawerAttribute + { + } +} diff --git a/LocalPackages/net.peeweek.gameplay-ingredients/NaughtyAttributes/Core/DrawerAttributes/ResizableTextAreaAttribute.cs.meta b/LocalPackages/net.peeweek.gameplay-ingredients/NaughtyAttributes/Core/DrawerAttributes/ResizableTextAreaAttribute.cs.meta new file mode 100644 index 0000000..43e40fd --- /dev/null +++ b/LocalPackages/net.peeweek.gameplay-ingredients/NaughtyAttributes/Core/DrawerAttributes/ResizableTextAreaAttribute.cs.meta @@ -0,0 +1,13 @@ +fileFormatVersion: 2 +guid: 1793ea6e464ee6448930ecf133ed6a1d +timeCreated: 1508583166 +licenseType: Free +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/LocalPackages/net.peeweek.gameplay-ingredients/NaughtyAttributes/Core/DrawerAttributes/ShowAssetPreviewAttribute.cs b/LocalPackages/net.peeweek.gameplay-ingredients/NaughtyAttributes/Core/DrawerAttributes/ShowAssetPreviewAttribute.cs new file mode 100644 index 0000000..6b35444 --- /dev/null +++ b/LocalPackages/net.peeweek.gameplay-ingredients/NaughtyAttributes/Core/DrawerAttributes/ShowAssetPreviewAttribute.cs @@ -0,0 +1,17 @@ +using System; + +namespace NaughtyAttributes +{ + [AttributeUsage(AttributeTargets.Field, AllowMultiple = false, Inherited = true)] + public class ShowAssetPreviewAttribute : DrawerAttribute + { + public int Width { get; private set; } + public int Height { get; private set; } + + public ShowAssetPreviewAttribute(int width = 64, int height = 64) + { + this.Width = width; + this.Height = height; + } + } +} diff --git a/LocalPackages/net.peeweek.gameplay-ingredients/NaughtyAttributes/Core/DrawerAttributes/ShowAssetPreviewAttribute.cs.meta b/LocalPackages/net.peeweek.gameplay-ingredients/NaughtyAttributes/Core/DrawerAttributes/ShowAssetPreviewAttribute.cs.meta new file mode 100644 index 0000000..bcdeb2c --- /dev/null +++ b/LocalPackages/net.peeweek.gameplay-ingredients/NaughtyAttributes/Core/DrawerAttributes/ShowAssetPreviewAttribute.cs.meta @@ -0,0 +1,13 @@ +fileFormatVersion: 2 +guid: 313b856a920a987418d6437a8e20a59f +timeCreated: 1509089502 +licenseType: Free +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/LocalPackages/net.peeweek.gameplay-ingredients/NaughtyAttributes/Core/DrawerAttributes/ShowNativePropertyAttribute.cs b/LocalPackages/net.peeweek.gameplay-ingredients/NaughtyAttributes/Core/DrawerAttributes/ShowNativePropertyAttribute.cs new file mode 100644 index 0000000..bb8a7c7 --- /dev/null +++ b/LocalPackages/net.peeweek.gameplay-ingredients/NaughtyAttributes/Core/DrawerAttributes/ShowNativePropertyAttribute.cs @@ -0,0 +1,11 @@ +using System; +using UnityEngine; + +namespace NaughtyAttributes +{ + [AttributeUsage(AttributeTargets.Property, AllowMultiple = false, Inherited = true)] + public class ShowNativePropertyAttribute : DrawerAttribute + { + + } +} diff --git a/LocalPackages/net.peeweek.gameplay-ingredients/NaughtyAttributes/Core/DrawerAttributes/ShowNativePropertyAttribute.cs.meta b/LocalPackages/net.peeweek.gameplay-ingredients/NaughtyAttributes/Core/DrawerAttributes/ShowNativePropertyAttribute.cs.meta new file mode 100644 index 0000000..29f619d --- /dev/null +++ b/LocalPackages/net.peeweek.gameplay-ingredients/NaughtyAttributes/Core/DrawerAttributes/ShowNativePropertyAttribute.cs.meta @@ -0,0 +1,13 @@ +fileFormatVersion: 2 +guid: acc7d7e8ec9e47a4aaf4167698ae076f +timeCreated: 1510926376 +licenseType: Free +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/LocalPackages/net.peeweek.gameplay-ingredients/NaughtyAttributes/Core/DrawerAttributes/ShowNonSerializedFieldAttribute.cs b/LocalPackages/net.peeweek.gameplay-ingredients/NaughtyAttributes/Core/DrawerAttributes/ShowNonSerializedFieldAttribute.cs new file mode 100644 index 0000000..8f311ef --- /dev/null +++ b/LocalPackages/net.peeweek.gameplay-ingredients/NaughtyAttributes/Core/DrawerAttributes/ShowNonSerializedFieldAttribute.cs @@ -0,0 +1,9 @@ +using System; + +namespace NaughtyAttributes +{ + [AttributeUsage(AttributeTargets.Field, AllowMultiple = false, Inherited = true)] + public class ShowNonSerializedFieldAttribute : DrawerAttribute + { + } +} diff --git a/LocalPackages/net.peeweek.gameplay-ingredients/NaughtyAttributes/Core/DrawerAttributes/ShowNonSerializedFieldAttribute.cs.meta b/LocalPackages/net.peeweek.gameplay-ingredients/NaughtyAttributes/Core/DrawerAttributes/ShowNonSerializedFieldAttribute.cs.meta new file mode 100644 index 0000000..d21b234 --- /dev/null +++ b/LocalPackages/net.peeweek.gameplay-ingredients/NaughtyAttributes/Core/DrawerAttributes/ShowNonSerializedFieldAttribute.cs.meta @@ -0,0 +1,13 @@ +fileFormatVersion: 2 +guid: a176aad85de73b34ba3ecd4f7baa367b +timeCreated: 1508835721 +licenseType: Free +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/LocalPackages/net.peeweek.gameplay-ingredients/NaughtyAttributes/Core/DrawerAttributes/SliderAttribute.cs b/LocalPackages/net.peeweek.gameplay-ingredients/NaughtyAttributes/Core/DrawerAttributes/SliderAttribute.cs new file mode 100644 index 0000000..ece2b58 --- /dev/null +++ b/LocalPackages/net.peeweek.gameplay-ingredients/NaughtyAttributes/Core/DrawerAttributes/SliderAttribute.cs @@ -0,0 +1,23 @@ +using System; + +namespace NaughtyAttributes +{ + [AttributeUsage(AttributeTargets.Field, AllowMultiple = false, Inherited = true)] + public class SliderAttribute : DrawerAttribute + { + public float MinValue { get; private set; } + public float MaxValue { get; private set; } + + public SliderAttribute(float minValue, float maxValue) + { + this.MinValue = minValue; + this.MaxValue = maxValue; + } + + public SliderAttribute(int minValue, int maxValue) + { + this.MaxValue = minValue; + this.MaxValue = maxValue; + } + } +} diff --git a/LocalPackages/net.peeweek.gameplay-ingredients/NaughtyAttributes/Core/DrawerAttributes/SliderAttribute.cs.meta b/LocalPackages/net.peeweek.gameplay-ingredients/NaughtyAttributes/Core/DrawerAttributes/SliderAttribute.cs.meta new file mode 100644 index 0000000..b121855 --- /dev/null +++ b/LocalPackages/net.peeweek.gameplay-ingredients/NaughtyAttributes/Core/DrawerAttributes/SliderAttribute.cs.meta @@ -0,0 +1,13 @@ +fileFormatVersion: 2 +guid: f75eef8142877c345ba9b95046dd3bf6 +timeCreated: 1508422518 +licenseType: Free +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/LocalPackages/net.peeweek.gameplay-ingredients/NaughtyAttributes/Core/DrawerAttributes/TagAttribute.cs b/LocalPackages/net.peeweek.gameplay-ingredients/NaughtyAttributes/Core/DrawerAttributes/TagAttribute.cs new file mode 100644 index 0000000..f7829c6 --- /dev/null +++ b/LocalPackages/net.peeweek.gameplay-ingredients/NaughtyAttributes/Core/DrawerAttributes/TagAttribute.cs @@ -0,0 +1,12 @@ +using System; + +namespace NaughtyAttributes +{ + /// + /// Make tags appear as tag popup fields + /// + [AttributeUsage(AttributeTargets.Field, AllowMultiple = false, Inherited = true)] + public class TagAttribute : DrawerAttribute + { + } +} diff --git a/LocalPackages/net.peeweek.gameplay-ingredients/NaughtyAttributes/Core/DrawerAttributes/TagAttribute.cs.meta b/LocalPackages/net.peeweek.gameplay-ingredients/NaughtyAttributes/Core/DrawerAttributes/TagAttribute.cs.meta new file mode 100644 index 0000000..475b869 --- /dev/null +++ b/LocalPackages/net.peeweek.gameplay-ingredients/NaughtyAttributes/Core/DrawerAttributes/TagAttribute.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: ad140cd5debdba44aa6db74894a5e913 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/LocalPackages/net.peeweek.gameplay-ingredients/NaughtyAttributes/Core/GroupAttributes.meta b/LocalPackages/net.peeweek.gameplay-ingredients/NaughtyAttributes/Core/GroupAttributes.meta new file mode 100644 index 0000000..4455f01 --- /dev/null +++ b/LocalPackages/net.peeweek.gameplay-ingredients/NaughtyAttributes/Core/GroupAttributes.meta @@ -0,0 +1,10 @@ +fileFormatVersion: 2 +guid: 86ca4f90dd05bc448959ecd8f44097a7 +folderAsset: yes +timeCreated: 1508330803 +licenseType: Free +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/LocalPackages/net.peeweek.gameplay-ingredients/NaughtyAttributes/Core/GroupAttributes/BoxGroupAttribute.cs b/LocalPackages/net.peeweek.gameplay-ingredients/NaughtyAttributes/Core/GroupAttributes/BoxGroupAttribute.cs new file mode 100644 index 0000000..a6f3b49 --- /dev/null +++ b/LocalPackages/net.peeweek.gameplay-ingredients/NaughtyAttributes/Core/GroupAttributes/BoxGroupAttribute.cs @@ -0,0 +1,13 @@ +using System; + +namespace NaughtyAttributes +{ + [AttributeUsage(AttributeTargets.Field, AllowMultiple = false, Inherited = true)] + public class BoxGroupAttribute : GroupAttribute + { + public BoxGroupAttribute(string name = "") + : base(name) + { + } + } +} diff --git a/LocalPackages/net.peeweek.gameplay-ingredients/NaughtyAttributes/Core/GroupAttributes/BoxGroupAttribute.cs.meta b/LocalPackages/net.peeweek.gameplay-ingredients/NaughtyAttributes/Core/GroupAttributes/BoxGroupAttribute.cs.meta new file mode 100644 index 0000000..fcdb278 --- /dev/null +++ b/LocalPackages/net.peeweek.gameplay-ingredients/NaughtyAttributes/Core/GroupAttributes/BoxGroupAttribute.cs.meta @@ -0,0 +1,13 @@ +fileFormatVersion: 2 +guid: 88c5a8d79f9e72a43a4cfa67fd08fdd6 +timeCreated: 1508326108 +licenseType: Free +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/LocalPackages/net.peeweek.gameplay-ingredients/NaughtyAttributes/Core/GroupAttributes/GroupAttribute.cs b/LocalPackages/net.peeweek.gameplay-ingredients/NaughtyAttributes/Core/GroupAttributes/GroupAttribute.cs new file mode 100644 index 0000000..a317fe2 --- /dev/null +++ b/LocalPackages/net.peeweek.gameplay-ingredients/NaughtyAttributes/Core/GroupAttributes/GroupAttribute.cs @@ -0,0 +1,14 @@ +using System; + +namespace NaughtyAttributes +{ + public abstract class GroupAttribute : NaughtyAttribute + { + public string Name { get; private set; } + + public GroupAttribute(string name) + { + this.Name = name; + } + } +} diff --git a/LocalPackages/net.peeweek.gameplay-ingredients/NaughtyAttributes/Core/GroupAttributes/GroupAttribute.cs.meta b/LocalPackages/net.peeweek.gameplay-ingredients/NaughtyAttributes/Core/GroupAttributes/GroupAttribute.cs.meta new file mode 100644 index 0000000..db3cc39 --- /dev/null +++ b/LocalPackages/net.peeweek.gameplay-ingredients/NaughtyAttributes/Core/GroupAttributes/GroupAttribute.cs.meta @@ -0,0 +1,13 @@ +fileFormatVersion: 2 +guid: beb48511ef6091e4ba054ad1b618933c +timeCreated: 1508326108 +licenseType: Free +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/LocalPackages/net.peeweek.gameplay-ingredients/NaughtyAttributes/Core/MetaAttributes.meta b/LocalPackages/net.peeweek.gameplay-ingredients/NaughtyAttributes/Core/MetaAttributes.meta new file mode 100644 index 0000000..f2ed90e --- /dev/null +++ b/LocalPackages/net.peeweek.gameplay-ingredients/NaughtyAttributes/Core/MetaAttributes.meta @@ -0,0 +1,10 @@ +fileFormatVersion: 2 +guid: 51ee806b39c5fb343ae7d268404d8c67 +folderAsset: yes +timeCreated: 1508497398 +licenseType: Free +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/LocalPackages/net.peeweek.gameplay-ingredients/NaughtyAttributes/Core/MetaAttributes/InfoBoxAttribute.cs b/LocalPackages/net.peeweek.gameplay-ingredients/NaughtyAttributes/Core/MetaAttributes/InfoBoxAttribute.cs new file mode 100644 index 0000000..d09c616 --- /dev/null +++ b/LocalPackages/net.peeweek.gameplay-ingredients/NaughtyAttributes/Core/MetaAttributes/InfoBoxAttribute.cs @@ -0,0 +1,31 @@ +using System; + +namespace NaughtyAttributes +{ + [AttributeUsage(AttributeTargets.Field, AllowMultiple = true, Inherited = true)] + public class InfoBoxAttribute : MetaAttribute + { + public string Text { get; private set; } + public InfoBoxType Type { get; private set; } + public string VisibleIf { get; private set; } + + public InfoBoxAttribute(string text, InfoBoxType type = InfoBoxType.Normal, string visibleIf = null) + { + this.Text = text; + this.Type = type; + this.VisibleIf = visibleIf; + } + + public InfoBoxAttribute(string text, string visibleIf) + : this(text, InfoBoxType.Normal, visibleIf) + { + } + } + + public enum InfoBoxType + { + Normal, + Warning, + Error + } +} diff --git a/LocalPackages/net.peeweek.gameplay-ingredients/NaughtyAttributes/Core/MetaAttributes/InfoBoxAttribute.cs.meta b/LocalPackages/net.peeweek.gameplay-ingredients/NaughtyAttributes/Core/MetaAttributes/InfoBoxAttribute.cs.meta new file mode 100644 index 0000000..19cb564 --- /dev/null +++ b/LocalPackages/net.peeweek.gameplay-ingredients/NaughtyAttributes/Core/MetaAttributes/InfoBoxAttribute.cs.meta @@ -0,0 +1,13 @@ +fileFormatVersion: 2 +guid: 42c6184c84ab19d4382b06f9017f136d +timeCreated: 1508607449 +licenseType: Free +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/LocalPackages/net.peeweek.gameplay-ingredients/NaughtyAttributes/Core/MetaAttributes/MetaAttribute.cs b/LocalPackages/net.peeweek.gameplay-ingredients/NaughtyAttributes/Core/MetaAttributes/MetaAttribute.cs new file mode 100644 index 0000000..ef2a451 --- /dev/null +++ b/LocalPackages/net.peeweek.gameplay-ingredients/NaughtyAttributes/Core/MetaAttributes/MetaAttribute.cs @@ -0,0 +1,9 @@ +using System; + +namespace NaughtyAttributes +{ + public abstract class MetaAttribute : NaughtyAttribute + { + public int Order { get; set; } + } +} diff --git a/LocalPackages/net.peeweek.gameplay-ingredients/NaughtyAttributes/Core/MetaAttributes/MetaAttribute.cs.meta b/LocalPackages/net.peeweek.gameplay-ingredients/NaughtyAttributes/Core/MetaAttributes/MetaAttribute.cs.meta new file mode 100644 index 0000000..5f5e5d7 --- /dev/null +++ b/LocalPackages/net.peeweek.gameplay-ingredients/NaughtyAttributes/Core/MetaAttributes/MetaAttribute.cs.meta @@ -0,0 +1,13 @@ +fileFormatVersion: 2 +guid: fcd6d339bcd667044a48d41a78a7830c +timeCreated: 1508497398 +licenseType: Free +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/LocalPackages/net.peeweek.gameplay-ingredients/NaughtyAttributes/Core/MetaAttributes/OnValueChangedAttribute.cs b/LocalPackages/net.peeweek.gameplay-ingredients/NaughtyAttributes/Core/MetaAttributes/OnValueChangedAttribute.cs new file mode 100644 index 0000000..ab826b8 --- /dev/null +++ b/LocalPackages/net.peeweek.gameplay-ingredients/NaughtyAttributes/Core/MetaAttributes/OnValueChangedAttribute.cs @@ -0,0 +1,15 @@ +using System; + +namespace NaughtyAttributes +{ + [AttributeUsage(AttributeTargets.Field, AllowMultiple = true, Inherited = true)] + public class OnValueChangedAttribute : MetaAttribute + { + public string CallbackName { get; private set; } + + public OnValueChangedAttribute(string callbackName) + { + this.CallbackName = callbackName; + } + } +} diff --git a/LocalPackages/net.peeweek.gameplay-ingredients/NaughtyAttributes/Core/MetaAttributes/OnValueChangedAttribute.cs.meta b/LocalPackages/net.peeweek.gameplay-ingredients/NaughtyAttributes/Core/MetaAttributes/OnValueChangedAttribute.cs.meta new file mode 100644 index 0000000..1452234 --- /dev/null +++ b/LocalPackages/net.peeweek.gameplay-ingredients/NaughtyAttributes/Core/MetaAttributes/OnValueChangedAttribute.cs.meta @@ -0,0 +1,13 @@ +fileFormatVersion: 2 +guid: a144cdc17b6e4cf4f86692ae1dc7e4d7 +timeCreated: 1508610277 +licenseType: Free +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/LocalPackages/net.peeweek.gameplay-ingredients/NaughtyAttributes/Core/NaughtyAttribute.cs b/LocalPackages/net.peeweek.gameplay-ingredients/NaughtyAttributes/Core/NaughtyAttribute.cs new file mode 100644 index 0000000..6251af9 --- /dev/null +++ b/LocalPackages/net.peeweek.gameplay-ingredients/NaughtyAttributes/Core/NaughtyAttribute.cs @@ -0,0 +1,9 @@ +using System; + +namespace NaughtyAttributes +{ + // The base class for all naughty attributes + public class NaughtyAttribute : Attribute + { + } +} diff --git a/LocalPackages/net.peeweek.gameplay-ingredients/NaughtyAttributes/Core/NaughtyAttribute.cs.meta b/LocalPackages/net.peeweek.gameplay-ingredients/NaughtyAttributes/Core/NaughtyAttribute.cs.meta new file mode 100644 index 0000000..fdf1ddf --- /dev/null +++ b/LocalPackages/net.peeweek.gameplay-ingredients/NaughtyAttributes/Core/NaughtyAttribute.cs.meta @@ -0,0 +1,13 @@ +fileFormatVersion: 2 +guid: 1accb89cb44c4a342a1857e5e3d13abb +timeCreated: 1508052914 +licenseType: Free +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/LocalPackages/net.peeweek.gameplay-ingredients/NaughtyAttributes/Core/NaughtyAttributes.Core.asmdef b/LocalPackages/net.peeweek.gameplay-ingredients/NaughtyAttributes/Core/NaughtyAttributes.Core.asmdef new file mode 100644 index 0000000..b585d0b --- /dev/null +++ b/LocalPackages/net.peeweek.gameplay-ingredients/NaughtyAttributes/Core/NaughtyAttributes.Core.asmdef @@ -0,0 +1,12 @@ +{ + "name": "NaughtyAttributes.Core", + "references": [], + "optionalUnityReferences": [], + "includePlatforms": [], + "excludePlatforms": [], + "allowUnsafeCode": false, + "overrideReferences": false, + "precompiledReferences": [], + "autoReferenced": true, + "defineConstraints": [] +} \ No newline at end of file diff --git a/LocalPackages/net.peeweek.gameplay-ingredients/NaughtyAttributes/Core/NaughtyAttributes.Core.asmdef.meta b/LocalPackages/net.peeweek.gameplay-ingredients/NaughtyAttributes/Core/NaughtyAttributes.Core.asmdef.meta new file mode 100644 index 0000000..731749c --- /dev/null +++ b/LocalPackages/net.peeweek.gameplay-ingredients/NaughtyAttributes/Core/NaughtyAttributes.Core.asmdef.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: 776d03a35f1b52c4a9aed9f56d7b4229 +AssemblyDefinitionImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/LocalPackages/net.peeweek.gameplay-ingredients/NaughtyAttributes/Core/ValidatorAttributes.meta b/LocalPackages/net.peeweek.gameplay-ingredients/NaughtyAttributes/Core/ValidatorAttributes.meta new file mode 100644 index 0000000..9bee434 --- /dev/null +++ b/LocalPackages/net.peeweek.gameplay-ingredients/NaughtyAttributes/Core/ValidatorAttributes.meta @@ -0,0 +1,10 @@ +fileFormatVersion: 2 +guid: 8a655727c2e629a438ad94f60080b9ea +folderAsset: yes +timeCreated: 1508151410 +licenseType: Free +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/LocalPackages/net.peeweek.gameplay-ingredients/NaughtyAttributes/Core/ValidatorAttributes/MaxValueAttribute.cs b/LocalPackages/net.peeweek.gameplay-ingredients/NaughtyAttributes/Core/ValidatorAttributes/MaxValueAttribute.cs new file mode 100644 index 0000000..4c54127 --- /dev/null +++ b/LocalPackages/net.peeweek.gameplay-ingredients/NaughtyAttributes/Core/ValidatorAttributes/MaxValueAttribute.cs @@ -0,0 +1,20 @@ +using System; + +namespace NaughtyAttributes +{ + [AttributeUsage(AttributeTargets.Field, AllowMultiple = false, Inherited = true)] + public class MaxValueAttribute : ValidatorAttribute + { + public float MaxValue { get; private set; } + + public MaxValueAttribute(float maxValue) + { + this.MaxValue = maxValue; + } + + public MaxValueAttribute(int maxValue) + { + this.MaxValue = maxValue; + } + } +} diff --git a/LocalPackages/net.peeweek.gameplay-ingredients/NaughtyAttributes/Core/ValidatorAttributes/MaxValueAttribute.cs.meta b/LocalPackages/net.peeweek.gameplay-ingredients/NaughtyAttributes/Core/ValidatorAttributes/MaxValueAttribute.cs.meta new file mode 100644 index 0000000..4ba3b5a --- /dev/null +++ b/LocalPackages/net.peeweek.gameplay-ingredients/NaughtyAttributes/Core/ValidatorAttributes/MaxValueAttribute.cs.meta @@ -0,0 +1,13 @@ +fileFormatVersion: 2 +guid: e018059e7fe12fd42a3a1bba0dbbf9c5 +timeCreated: 1508047804 +licenseType: Free +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/LocalPackages/net.peeweek.gameplay-ingredients/NaughtyAttributes/Core/ValidatorAttributes/MinValueAttribute.cs b/LocalPackages/net.peeweek.gameplay-ingredients/NaughtyAttributes/Core/ValidatorAttributes/MinValueAttribute.cs new file mode 100644 index 0000000..627e747 --- /dev/null +++ b/LocalPackages/net.peeweek.gameplay-ingredients/NaughtyAttributes/Core/ValidatorAttributes/MinValueAttribute.cs @@ -0,0 +1,20 @@ +using System; + +namespace NaughtyAttributes +{ + [AttributeUsage(AttributeTargets.Field, AllowMultiple = false, Inherited = true)] + public class MinValueAttribute : ValidatorAttribute + { + public float MinValue { get; private set; } + + public MinValueAttribute(float minValue) + { + this.MinValue = minValue; + } + + public MinValueAttribute(int minValue) + { + this.MinValue = minValue; + } + } +} diff --git a/LocalPackages/net.peeweek.gameplay-ingredients/NaughtyAttributes/Core/ValidatorAttributes/MinValueAttribute.cs.meta b/LocalPackages/net.peeweek.gameplay-ingredients/NaughtyAttributes/Core/ValidatorAttributes/MinValueAttribute.cs.meta new file mode 100644 index 0000000..19450e8 --- /dev/null +++ b/LocalPackages/net.peeweek.gameplay-ingredients/NaughtyAttributes/Core/ValidatorAttributes/MinValueAttribute.cs.meta @@ -0,0 +1,13 @@ +fileFormatVersion: 2 +guid: 337be62eb8c929f4ab8b3d495a712a56 +timeCreated: 1508048805 +licenseType: Free +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/LocalPackages/net.peeweek.gameplay-ingredients/NaughtyAttributes/Core/ValidatorAttributes/RequiredAttribute.cs b/LocalPackages/net.peeweek.gameplay-ingredients/NaughtyAttributes/Core/ValidatorAttributes/RequiredAttribute.cs new file mode 100644 index 0000000..903f658 --- /dev/null +++ b/LocalPackages/net.peeweek.gameplay-ingredients/NaughtyAttributes/Core/ValidatorAttributes/RequiredAttribute.cs @@ -0,0 +1,15 @@ +using System; + +namespace NaughtyAttributes +{ + [AttributeUsage(AttributeTargets.Field, AllowMultiple = false, Inherited = true)] + public class RequiredAttribute : ValidatorAttribute + { + public string Message { get; private set; } + + public RequiredAttribute(string message = null) + { + this.Message = message; + } + } +} diff --git a/LocalPackages/net.peeweek.gameplay-ingredients/NaughtyAttributes/Core/ValidatorAttributes/RequiredAttribute.cs.meta b/LocalPackages/net.peeweek.gameplay-ingredients/NaughtyAttributes/Core/ValidatorAttributes/RequiredAttribute.cs.meta new file mode 100644 index 0000000..068d000 --- /dev/null +++ b/LocalPackages/net.peeweek.gameplay-ingredients/NaughtyAttributes/Core/ValidatorAttributes/RequiredAttribute.cs.meta @@ -0,0 +1,13 @@ +fileFormatVersion: 2 +guid: 0b70ebd0fbd89c648981f08469806779 +timeCreated: 1508655546 +licenseType: Free +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/LocalPackages/net.peeweek.gameplay-ingredients/NaughtyAttributes/Core/ValidatorAttributes/ValidateInputAttribute.cs b/LocalPackages/net.peeweek.gameplay-ingredients/NaughtyAttributes/Core/ValidatorAttributes/ValidateInputAttribute.cs new file mode 100644 index 0000000..d024816 --- /dev/null +++ b/LocalPackages/net.peeweek.gameplay-ingredients/NaughtyAttributes/Core/ValidatorAttributes/ValidateInputAttribute.cs @@ -0,0 +1,17 @@ +using System; + +namespace NaughtyAttributes +{ + [AttributeUsage(AttributeTargets.Field, AllowMultiple = false, Inherited = true)] + public class ValidateInputAttribute : ValidatorAttribute + { + public string CallbackName { get; private set; } + public string Message { get; private set; } + + public ValidateInputAttribute(string callbackName, string message = null) + { + this.CallbackName = callbackName; + this.Message = message; + } + } +} diff --git a/LocalPackages/net.peeweek.gameplay-ingredients/NaughtyAttributes/Core/ValidatorAttributes/ValidateInputAttribute.cs.meta b/LocalPackages/net.peeweek.gameplay-ingredients/NaughtyAttributes/Core/ValidatorAttributes/ValidateInputAttribute.cs.meta new file mode 100644 index 0000000..ed365d1 --- /dev/null +++ b/LocalPackages/net.peeweek.gameplay-ingredients/NaughtyAttributes/Core/ValidatorAttributes/ValidateInputAttribute.cs.meta @@ -0,0 +1,13 @@ +fileFormatVersion: 2 +guid: f13ea28cf56e89f4cb335e28c9ab5d9a +timeCreated: 1508657795 +licenseType: Free +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/LocalPackages/net.peeweek.gameplay-ingredients/NaughtyAttributes/Core/ValidatorAttributes/ValidatorAttribute.cs b/LocalPackages/net.peeweek.gameplay-ingredients/NaughtyAttributes/Core/ValidatorAttributes/ValidatorAttribute.cs new file mode 100644 index 0000000..38222eb --- /dev/null +++ b/LocalPackages/net.peeweek.gameplay-ingredients/NaughtyAttributes/Core/ValidatorAttributes/ValidatorAttribute.cs @@ -0,0 +1,8 @@ +using System; + +namespace NaughtyAttributes +{ + public abstract class ValidatorAttribute : NaughtyAttribute + { + } +} diff --git a/LocalPackages/net.peeweek.gameplay-ingredients/NaughtyAttributes/Core/ValidatorAttributes/ValidatorAttribute.cs.meta b/LocalPackages/net.peeweek.gameplay-ingredients/NaughtyAttributes/Core/ValidatorAttributes/ValidatorAttribute.cs.meta new file mode 100644 index 0000000..668f7e1 --- /dev/null +++ b/LocalPackages/net.peeweek.gameplay-ingredients/NaughtyAttributes/Core/ValidatorAttributes/ValidatorAttribute.cs.meta @@ -0,0 +1,13 @@ +fileFormatVersion: 2 +guid: 5fac74a9575c45342be1e6dda45610ad +timeCreated: 1508151410 +licenseType: Free +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/LocalPackages/net.peeweek.gameplay-ingredients/NaughtyAttributes/Editor.meta b/LocalPackages/net.peeweek.gameplay-ingredients/NaughtyAttributes/Editor.meta new file mode 100644 index 0000000..8110aa8 --- /dev/null +++ b/LocalPackages/net.peeweek.gameplay-ingredients/NaughtyAttributes/Editor.meta @@ -0,0 +1,10 @@ +fileFormatVersion: 2 +guid: b76068e69df25a94ab378b0b6829c4f0 +folderAsset: yes +timeCreated: 1507995613 +licenseType: Free +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/LocalPackages/net.peeweek.gameplay-ingredients/NaughtyAttributes/Editor/Attributes.meta b/LocalPackages/net.peeweek.gameplay-ingredients/NaughtyAttributes/Editor/Attributes.meta new file mode 100644 index 0000000..3f8ebe7 --- /dev/null +++ b/LocalPackages/net.peeweek.gameplay-ingredients/NaughtyAttributes/Editor/Attributes.meta @@ -0,0 +1,10 @@ +fileFormatVersion: 2 +guid: bfd420e5bf6a25049b8fcea8b2f48c94 +folderAsset: yes +timeCreated: 1508153828 +licenseType: Free +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/LocalPackages/net.peeweek.gameplay-ingredients/NaughtyAttributes/Editor/Attributes/BaseAttribute.cs b/LocalPackages/net.peeweek.gameplay-ingredients/NaughtyAttributes/Editor/Attributes/BaseAttribute.cs new file mode 100644 index 0000000..b3fef44 --- /dev/null +++ b/LocalPackages/net.peeweek.gameplay-ingredients/NaughtyAttributes/Editor/Attributes/BaseAttribute.cs @@ -0,0 +1,23 @@ +using System; + +namespace NaughtyAttributes.Editor +{ + [AttributeUsage(AttributeTargets.Class, AllowMultiple = false, Inherited = true)] + public abstract class BaseAttribute : Attribute, IAttribute + { + private Type targetAttributeType; + + public BaseAttribute(Type targetAttributeType) + { + this.targetAttributeType = targetAttributeType; + } + + public Type TargetAttributeType + { + get + { + return this.targetAttributeType; + } + } + } +} diff --git a/LocalPackages/net.peeweek.gameplay-ingredients/NaughtyAttributes/Editor/Attributes/BaseAttribute.cs.meta b/LocalPackages/net.peeweek.gameplay-ingredients/NaughtyAttributes/Editor/Attributes/BaseAttribute.cs.meta new file mode 100644 index 0000000..d12b1ae --- /dev/null +++ b/LocalPackages/net.peeweek.gameplay-ingredients/NaughtyAttributes/Editor/Attributes/BaseAttribute.cs.meta @@ -0,0 +1,13 @@ +fileFormatVersion: 2 +guid: dd861c512b7cd804fa5f01b4d0e9f5bc +timeCreated: 1508424822 +licenseType: Free +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/LocalPackages/net.peeweek.gameplay-ingredients/NaughtyAttributes/Editor/Attributes/FieldDrawerAttribute.cs b/LocalPackages/net.peeweek.gameplay-ingredients/NaughtyAttributes/Editor/Attributes/FieldDrawerAttribute.cs new file mode 100644 index 0000000..e2de8b0 --- /dev/null +++ b/LocalPackages/net.peeweek.gameplay-ingredients/NaughtyAttributes/Editor/Attributes/FieldDrawerAttribute.cs @@ -0,0 +1,11 @@ +using System; + +namespace NaughtyAttributes.Editor +{ + public class FieldDrawerAttribute : BaseAttribute + { + public FieldDrawerAttribute(Type targetAttributeType) : base(targetAttributeType) + { + } + } +} diff --git a/LocalPackages/net.peeweek.gameplay-ingredients/NaughtyAttributes/Editor/Attributes/FieldDrawerAttribute.cs.meta b/LocalPackages/net.peeweek.gameplay-ingredients/NaughtyAttributes/Editor/Attributes/FieldDrawerAttribute.cs.meta new file mode 100644 index 0000000..456e222 --- /dev/null +++ b/LocalPackages/net.peeweek.gameplay-ingredients/NaughtyAttributes/Editor/Attributes/FieldDrawerAttribute.cs.meta @@ -0,0 +1,13 @@ +fileFormatVersion: 2 +guid: ad0dbf00ca9ec1e4290145dc40bda96f +timeCreated: 1508835980 +licenseType: Free +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/LocalPackages/net.peeweek.gameplay-ingredients/NaughtyAttributes/Editor/Attributes/IAttribute.cs b/LocalPackages/net.peeweek.gameplay-ingredients/NaughtyAttributes/Editor/Attributes/IAttribute.cs new file mode 100644 index 0000000..5d24b68 --- /dev/null +++ b/LocalPackages/net.peeweek.gameplay-ingredients/NaughtyAttributes/Editor/Attributes/IAttribute.cs @@ -0,0 +1,9 @@ +using System; + +namespace NaughtyAttributes.Editor +{ + public interface IAttribute + { + Type TargetAttributeType { get; } + } +} diff --git a/LocalPackages/net.peeweek.gameplay-ingredients/NaughtyAttributes/Editor/Attributes/IAttribute.cs.meta b/LocalPackages/net.peeweek.gameplay-ingredients/NaughtyAttributes/Editor/Attributes/IAttribute.cs.meta new file mode 100644 index 0000000..4b3a9d9 --- /dev/null +++ b/LocalPackages/net.peeweek.gameplay-ingredients/NaughtyAttributes/Editor/Attributes/IAttribute.cs.meta @@ -0,0 +1,13 @@ +fileFormatVersion: 2 +guid: eec883c51d802eb49be41f384e227dad +timeCreated: 1508424822 +licenseType: Free +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/LocalPackages/net.peeweek.gameplay-ingredients/NaughtyAttributes/Editor/Attributes/MethodDrawerAttribute.cs b/LocalPackages/net.peeweek.gameplay-ingredients/NaughtyAttributes/Editor/Attributes/MethodDrawerAttribute.cs new file mode 100644 index 0000000..ad78d4b --- /dev/null +++ b/LocalPackages/net.peeweek.gameplay-ingredients/NaughtyAttributes/Editor/Attributes/MethodDrawerAttribute.cs @@ -0,0 +1,11 @@ +using System; + +namespace NaughtyAttributes.Editor +{ + public class MethodDrawerAttribute : BaseAttribute + { + public MethodDrawerAttribute(Type targetAttributeType) : base(targetAttributeType) + { + } + } +} diff --git a/LocalPackages/net.peeweek.gameplay-ingredients/NaughtyAttributes/Editor/Attributes/MethodDrawerAttribute.cs.meta b/LocalPackages/net.peeweek.gameplay-ingredients/NaughtyAttributes/Editor/Attributes/MethodDrawerAttribute.cs.meta new file mode 100644 index 0000000..7b6acd3 --- /dev/null +++ b/LocalPackages/net.peeweek.gameplay-ingredients/NaughtyAttributes/Editor/Attributes/MethodDrawerAttribute.cs.meta @@ -0,0 +1,13 @@ +fileFormatVersion: 2 +guid: b89ac4d9b78686548baa09fb0b103850 +timeCreated: 1508592495 +licenseType: Free +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/LocalPackages/net.peeweek.gameplay-ingredients/NaughtyAttributes/Editor/Attributes/NativePropertyDrawerAttribute.cs b/LocalPackages/net.peeweek.gameplay-ingredients/NaughtyAttributes/Editor/Attributes/NativePropertyDrawerAttribute.cs new file mode 100644 index 0000000..d60e141 --- /dev/null +++ b/LocalPackages/net.peeweek.gameplay-ingredients/NaughtyAttributes/Editor/Attributes/NativePropertyDrawerAttribute.cs @@ -0,0 +1,11 @@ +using System; + +namespace NaughtyAttributes.Editor +{ + public class NativePropertyDrawerAttribute : BaseAttribute + { + public NativePropertyDrawerAttribute(Type targetAttributeType) : base(targetAttributeType) + { + } + } +} diff --git a/LocalPackages/net.peeweek.gameplay-ingredients/NaughtyAttributes/Editor/Attributes/NativePropertyDrawerAttribute.cs.meta b/LocalPackages/net.peeweek.gameplay-ingredients/NaughtyAttributes/Editor/Attributes/NativePropertyDrawerAttribute.cs.meta new file mode 100644 index 0000000..9a726e7 --- /dev/null +++ b/LocalPackages/net.peeweek.gameplay-ingredients/NaughtyAttributes/Editor/Attributes/NativePropertyDrawerAttribute.cs.meta @@ -0,0 +1,13 @@ +fileFormatVersion: 2 +guid: 7c30e23a060c0614b876d7f14e0ee649 +timeCreated: 1510924166 +licenseType: Free +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/LocalPackages/net.peeweek.gameplay-ingredients/NaughtyAttributes/Editor/Attributes/PropertyDrawConditionAttribute.cs b/LocalPackages/net.peeweek.gameplay-ingredients/NaughtyAttributes/Editor/Attributes/PropertyDrawConditionAttribute.cs new file mode 100644 index 0000000..c8fa6e9 --- /dev/null +++ b/LocalPackages/net.peeweek.gameplay-ingredients/NaughtyAttributes/Editor/Attributes/PropertyDrawConditionAttribute.cs @@ -0,0 +1,11 @@ +using System; + +namespace NaughtyAttributes.Editor +{ + public class PropertyDrawConditionAttribute : BaseAttribute + { + public PropertyDrawConditionAttribute(Type targetAttributeType) : base(targetAttributeType) + { + } + } +} diff --git a/LocalPackages/net.peeweek.gameplay-ingredients/NaughtyAttributes/Editor/Attributes/PropertyDrawConditionAttribute.cs.meta b/LocalPackages/net.peeweek.gameplay-ingredients/NaughtyAttributes/Editor/Attributes/PropertyDrawConditionAttribute.cs.meta new file mode 100644 index 0000000..663b290 --- /dev/null +++ b/LocalPackages/net.peeweek.gameplay-ingredients/NaughtyAttributes/Editor/Attributes/PropertyDrawConditionAttribute.cs.meta @@ -0,0 +1,13 @@ +fileFormatVersion: 2 +guid: d7962631135870e4fa748e6f81cd64d4 +timeCreated: 1508414568 +licenseType: Free +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/LocalPackages/net.peeweek.gameplay-ingredients/NaughtyAttributes/Editor/Attributes/PropertyDrawerAttribute.cs b/LocalPackages/net.peeweek.gameplay-ingredients/NaughtyAttributes/Editor/Attributes/PropertyDrawerAttribute.cs new file mode 100644 index 0000000..cce3c96 --- /dev/null +++ b/LocalPackages/net.peeweek.gameplay-ingredients/NaughtyAttributes/Editor/Attributes/PropertyDrawerAttribute.cs @@ -0,0 +1,11 @@ +using System; + +namespace NaughtyAttributes.Editor +{ + public class PropertyDrawerAttribute : BaseAttribute + { + public PropertyDrawerAttribute(Type targetAttributeType) : base(targetAttributeType) + { + } + } +} diff --git a/LocalPackages/net.peeweek.gameplay-ingredients/NaughtyAttributes/Editor/Attributes/PropertyDrawerAttribute.cs.meta b/LocalPackages/net.peeweek.gameplay-ingredients/NaughtyAttributes/Editor/Attributes/PropertyDrawerAttribute.cs.meta new file mode 100644 index 0000000..3b4803b --- /dev/null +++ b/LocalPackages/net.peeweek.gameplay-ingredients/NaughtyAttributes/Editor/Attributes/PropertyDrawerAttribute.cs.meta @@ -0,0 +1,13 @@ +fileFormatVersion: 2 +guid: 77bb6824c4e9e054db05347dd8465f24 +timeCreated: 1508153828 +licenseType: Free +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/LocalPackages/net.peeweek.gameplay-ingredients/NaughtyAttributes/Editor/Attributes/PropertyGrouperAttribute.cs b/LocalPackages/net.peeweek.gameplay-ingredients/NaughtyAttributes/Editor/Attributes/PropertyGrouperAttribute.cs new file mode 100644 index 0000000..5574cc5 --- /dev/null +++ b/LocalPackages/net.peeweek.gameplay-ingredients/NaughtyAttributes/Editor/Attributes/PropertyGrouperAttribute.cs @@ -0,0 +1,11 @@ +using System; + +namespace NaughtyAttributes.Editor +{ + public class PropertyGrouperAttribute : BaseAttribute + { + public PropertyGrouperAttribute(Type targetAttributeType) : base(targetAttributeType) + { + } + } +} diff --git a/LocalPackages/net.peeweek.gameplay-ingredients/NaughtyAttributes/Editor/Attributes/PropertyGrouperAttribute.cs.meta b/LocalPackages/net.peeweek.gameplay-ingredients/NaughtyAttributes/Editor/Attributes/PropertyGrouperAttribute.cs.meta new file mode 100644 index 0000000..757cf05 --- /dev/null +++ b/LocalPackages/net.peeweek.gameplay-ingredients/NaughtyAttributes/Editor/Attributes/PropertyGrouperAttribute.cs.meta @@ -0,0 +1,13 @@ +fileFormatVersion: 2 +guid: 9d1b7efb592ab4a4796c70edaad2be75 +timeCreated: 1508332897 +licenseType: Free +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/LocalPackages/net.peeweek.gameplay-ingredients/NaughtyAttributes/Editor/Attributes/PropertyMetaAttribute.cs b/LocalPackages/net.peeweek.gameplay-ingredients/NaughtyAttributes/Editor/Attributes/PropertyMetaAttribute.cs new file mode 100644 index 0000000..0d2e09c --- /dev/null +++ b/LocalPackages/net.peeweek.gameplay-ingredients/NaughtyAttributes/Editor/Attributes/PropertyMetaAttribute.cs @@ -0,0 +1,11 @@ +using System; + +namespace NaughtyAttributes.Editor +{ + public class PropertyMetaAttribute : BaseAttribute + { + public PropertyMetaAttribute(Type targetAttributeType) : base(targetAttributeType) + { + } + } +} diff --git a/LocalPackages/net.peeweek.gameplay-ingredients/NaughtyAttributes/Editor/Attributes/PropertyMetaAttribute.cs.meta b/LocalPackages/net.peeweek.gameplay-ingredients/NaughtyAttributes/Editor/Attributes/PropertyMetaAttribute.cs.meta new file mode 100644 index 0000000..2537218 --- /dev/null +++ b/LocalPackages/net.peeweek.gameplay-ingredients/NaughtyAttributes/Editor/Attributes/PropertyMetaAttribute.cs.meta @@ -0,0 +1,13 @@ +fileFormatVersion: 2 +guid: b46e1700b41c60141b19b0a7ed25a383 +timeCreated: 1508497398 +licenseType: Free +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/LocalPackages/net.peeweek.gameplay-ingredients/NaughtyAttributes/Editor/Attributes/PropertyValidatorAttribute.cs b/LocalPackages/net.peeweek.gameplay-ingredients/NaughtyAttributes/Editor/Attributes/PropertyValidatorAttribute.cs new file mode 100644 index 0000000..375bd33 --- /dev/null +++ b/LocalPackages/net.peeweek.gameplay-ingredients/NaughtyAttributes/Editor/Attributes/PropertyValidatorAttribute.cs @@ -0,0 +1,11 @@ +using System; + +namespace NaughtyAttributes.Editor +{ + public class PropertyValidatorAttribute : BaseAttribute + { + public PropertyValidatorAttribute(Type targetAttributeType) : base(targetAttributeType) + { + } + } +} diff --git a/LocalPackages/net.peeweek.gameplay-ingredients/NaughtyAttributes/Editor/Attributes/PropertyValidatorAttribute.cs.meta b/LocalPackages/net.peeweek.gameplay-ingredients/NaughtyAttributes/Editor/Attributes/PropertyValidatorAttribute.cs.meta new file mode 100644 index 0000000..1e3fbfe --- /dev/null +++ b/LocalPackages/net.peeweek.gameplay-ingredients/NaughtyAttributes/Editor/Attributes/PropertyValidatorAttribute.cs.meta @@ -0,0 +1,13 @@ +fileFormatVersion: 2 +guid: 38c34a83bfd0a07468f20ae50c36737f +timeCreated: 1508153828 +licenseType: Free +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/LocalPackages/net.peeweek.gameplay-ingredients/NaughtyAttributes/Editor/CodeGeneration.meta b/LocalPackages/net.peeweek.gameplay-ingredients/NaughtyAttributes/Editor/CodeGeneration.meta new file mode 100644 index 0000000..4d91c4b --- /dev/null +++ b/LocalPackages/net.peeweek.gameplay-ingredients/NaughtyAttributes/Editor/CodeGeneration.meta @@ -0,0 +1,10 @@ +fileFormatVersion: 2 +guid: 3876cb6aacfb99f46803d5e50eacdf2c +folderAsset: yes +timeCreated: 1508230862 +licenseType: Free +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/LocalPackages/net.peeweek.gameplay-ingredients/NaughtyAttributes/Editor/CodeGeneration/CodeGenerator.cs b/LocalPackages/net.peeweek.gameplay-ingredients/NaughtyAttributes/Editor/CodeGeneration/CodeGenerator.cs new file mode 100644 index 0000000..bafbf0b --- /dev/null +++ b/LocalPackages/net.peeweek.gameplay-ingredients/NaughtyAttributes/Editor/CodeGeneration/CodeGenerator.cs @@ -0,0 +1,101 @@ +using System; +using System.Collections.Generic; +using System.Reflection; +using System.Text; +using System.Text.RegularExpressions; +using UnityEngine; +using UnityEditor; + +namespace NaughtyAttributes.Editor +{ + public class CodeGenerator : UnityEditor.Editor + { + private static readonly string GENERATED_CODE_TARGET_FOLDER = + (Application.dataPath.Replace("Assets", string.Empty) + AssetDatabase.GUIDToAssetPath(AssetDatabase.FindAssets("CodeGenerator")[0])) + .Replace("CodeGenerator.cs", string.Empty) + .Replace("/", "\\"); + + private static readonly string CLASS_NAME_PLACEHOLDER = "__classname__"; + private static readonly string ENTRIES_PLACEHOLDER = "__entries__"; + private static readonly string META_ENTRY_FORMAT = "metasByAttributeType[typeof({0})] = new {1}();" + Environment.NewLine; + private static readonly string DRAWER_ENTRY_FORMAT = "drawersByAttributeType[typeof({0})] = new {1}();" + Environment.NewLine; + private static readonly string GROUPER_ENTRY_FORMAT = "groupersByAttributeType[typeof({0})] = new {1}();" + Environment.NewLine; + private static readonly string VALIDATOR_ENTRY_FORMAT = "validatorsByAttributeType[typeof({0})] = new {1}();" + Environment.NewLine; + private static readonly string DRAW_CONDITION_ENTRY_FORMAT = "drawConditionsByAttributeType[typeof({0})] = new {1}();" + Environment.NewLine; + + //[UnityEditor.Callbacks.DidReloadScripts] + [MenuItem("Tools/NaughtyAttributes/Update Attributes Database")] + private static void GenerateCode() + { + GenerateScript("PropertyMetaDatabase", "PropertyMetaDatabaseTemplate", META_ENTRY_FORMAT); + GenerateScript("PropertyDrawerDatabase", "PropertyDrawerDatabaseTemplate", DRAWER_ENTRY_FORMAT); + GenerateScript("PropertyGrouperDatabase", "PropertyGrouperDatabaseTemplate", GROUPER_ENTRY_FORMAT); + GenerateScript("PropertyValidatorDatabase", "PropertyValidatorDatabaseTemplate", VALIDATOR_ENTRY_FORMAT); + GenerateScript("PropertyDrawConditionDatabase", "PropertyDrawConditionDatabaseTemplate", DRAW_CONDITION_ENTRY_FORMAT); + + GenerateScript("FieldDrawerDatabase", "FieldDrawerDatabaseTemplate", DRAWER_ENTRY_FORMAT); + GenerateScript("MethodDrawerDatabase", "MethodDrawerDatabaseTemplate", DRAWER_ENTRY_FORMAT); + GenerateScript("NativePropertyDrawerDatabase", "NativePropertyDrawerDbTemplate", DRAWER_ENTRY_FORMAT); + + AssetDatabase.Refresh(); + } + + private static void GenerateScript(string scriptName, string templateName, string entryFormat) + where TAttribute : IAttribute + { + string[] templateAssets = AssetDatabase.FindAssets(templateName); + if (templateAssets.Length == 0) + { + return; + } + + string templateGUID = templateAssets[0]; + string templateRelativePath = AssetDatabase.GUIDToAssetPath(templateGUID); + string templateFormat = (AssetDatabase.LoadAssetAtPath(templateRelativePath, typeof(TextAsset)) as TextAsset).ToString(); + //string templateFullPath = (Application.dataPath.Replace("Assets", string.Empty) + templateRelativePath).Replace("/", "\\"); + //string templateFormat = IOUtility.ReadFromFile(templateFullPath); + + StringBuilder entriesBuilder = new StringBuilder(); + List subTypes = GetAllSubTypes(typeof(TClass)); + + foreach (var subType in subTypes) + { + IAttribute[] attributes = (IAttribute[])subType.GetCustomAttributes(typeof(TAttribute), true); + if (attributes.Length > 0) + { + entriesBuilder.AppendFormat(entryFormat, attributes[0].TargetAttributeType.Name, subType.Name); + } + } + + string scriptContent = templateFormat + .Replace(CLASS_NAME_PLACEHOLDER, scriptName) + .Replace(ENTRIES_PLACEHOLDER, entriesBuilder.ToString()); + + scriptContent = Regex.Replace(scriptContent, @"\r\n|\n\r|\r|\n", Environment.NewLine); // Normalize line endings + + string scriptPath = GENERATED_CODE_TARGET_FOLDER + scriptName + ".cs"; + + IOUtility.WriteToFile(scriptPath, scriptContent); + } + + private static List GetAllSubTypes(Type baseClass) + { + var result = new List(); + Assembly[] assemblies = AppDomain.CurrentDomain.GetAssemblies(); + + foreach (var assemly in assemblies) + { + Type[] types = assemly.GetTypes(); + foreach (var type in types) + { + if (type.IsSubclassOf(baseClass)) + { + result.Add(type); + } + } + } + + return result; + } + } +} diff --git a/LocalPackages/net.peeweek.gameplay-ingredients/NaughtyAttributes/Editor/CodeGeneration/CodeGenerator.cs.meta b/LocalPackages/net.peeweek.gameplay-ingredients/NaughtyAttributes/Editor/CodeGeneration/CodeGenerator.cs.meta new file mode 100644 index 0000000..2bbd870 --- /dev/null +++ b/LocalPackages/net.peeweek.gameplay-ingredients/NaughtyAttributes/Editor/CodeGeneration/CodeGenerator.cs.meta @@ -0,0 +1,13 @@ +fileFormatVersion: 2 +guid: 990da0e1629b14049842bf2ac82cbff0 +timeCreated: 1508230160 +licenseType: Free +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/LocalPackages/net.peeweek.gameplay-ingredients/NaughtyAttributes/Editor/CodeGeneration/FieldDrawerDatabase.cs b/LocalPackages/net.peeweek.gameplay-ingredients/NaughtyAttributes/Editor/CodeGeneration/FieldDrawerDatabase.cs new file mode 100644 index 0000000..a1e4692 --- /dev/null +++ b/LocalPackages/net.peeweek.gameplay-ingredients/NaughtyAttributes/Editor/CodeGeneration/FieldDrawerDatabase.cs @@ -0,0 +1,33 @@ +// This class is auto generated + +using System; +using System.Collections.Generic; + +namespace NaughtyAttributes.Editor +{ + public static class FieldDrawerDatabase + { + private static Dictionary drawersByAttributeType; + + static FieldDrawerDatabase() + { + drawersByAttributeType = new Dictionary(); + drawersByAttributeType[typeof(ShowNonSerializedFieldAttribute)] = new ShowNonSerializedFieldFieldDrawer(); + + } + + public static FieldDrawer GetDrawerForAttribute(Type attributeType) + { + FieldDrawer drawer; + if (drawersByAttributeType.TryGetValue(attributeType, out drawer)) + { + return drawer; + } + else + { + return null; + } + } + } +} + diff --git a/LocalPackages/net.peeweek.gameplay-ingredients/NaughtyAttributes/Editor/CodeGeneration/FieldDrawerDatabase.cs.meta b/LocalPackages/net.peeweek.gameplay-ingredients/NaughtyAttributes/Editor/CodeGeneration/FieldDrawerDatabase.cs.meta new file mode 100644 index 0000000..52c69e9 --- /dev/null +++ b/LocalPackages/net.peeweek.gameplay-ingredients/NaughtyAttributes/Editor/CodeGeneration/FieldDrawerDatabase.cs.meta @@ -0,0 +1,13 @@ +fileFormatVersion: 2 +guid: b2406e32d0ab1214ab4959f1cdc8a609 +timeCreated: 1508836346 +licenseType: Free +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/LocalPackages/net.peeweek.gameplay-ingredients/NaughtyAttributes/Editor/CodeGeneration/MethodDrawerDatabase.cs b/LocalPackages/net.peeweek.gameplay-ingredients/NaughtyAttributes/Editor/CodeGeneration/MethodDrawerDatabase.cs new file mode 100644 index 0000000..832fb60 --- /dev/null +++ b/LocalPackages/net.peeweek.gameplay-ingredients/NaughtyAttributes/Editor/CodeGeneration/MethodDrawerDatabase.cs @@ -0,0 +1,33 @@ +// This class is auto generated + +using System; +using System.Collections.Generic; + +namespace NaughtyAttributes.Editor +{ + public static class MethodDrawerDatabase + { + private static Dictionary drawersByAttributeType; + + static MethodDrawerDatabase() + { + drawersByAttributeType = new Dictionary(); + drawersByAttributeType[typeof(ButtonAttribute)] = new ButtonMethodDrawer(); + + } + + public static MethodDrawer GetDrawerForAttribute(Type attributeType) + { + MethodDrawer drawer; + if (drawersByAttributeType.TryGetValue(attributeType, out drawer)) + { + return drawer; + } + else + { + return null; + } + } + } +} + diff --git a/LocalPackages/net.peeweek.gameplay-ingredients/NaughtyAttributes/Editor/CodeGeneration/MethodDrawerDatabase.cs.meta b/LocalPackages/net.peeweek.gameplay-ingredients/NaughtyAttributes/Editor/CodeGeneration/MethodDrawerDatabase.cs.meta new file mode 100644 index 0000000..82b0f85 --- /dev/null +++ b/LocalPackages/net.peeweek.gameplay-ingredients/NaughtyAttributes/Editor/CodeGeneration/MethodDrawerDatabase.cs.meta @@ -0,0 +1,13 @@ +fileFormatVersion: 2 +guid: 40b81aa63ff76d34ea67277db99a6a25 +timeCreated: 1508592498 +licenseType: Free +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/LocalPackages/net.peeweek.gameplay-ingredients/NaughtyAttributes/Editor/CodeGeneration/NativePropertyDrawerDatabase.cs b/LocalPackages/net.peeweek.gameplay-ingredients/NaughtyAttributes/Editor/CodeGeneration/NativePropertyDrawerDatabase.cs new file mode 100644 index 0000000..2844f95 --- /dev/null +++ b/LocalPackages/net.peeweek.gameplay-ingredients/NaughtyAttributes/Editor/CodeGeneration/NativePropertyDrawerDatabase.cs @@ -0,0 +1,33 @@ +// This class is auto generated + +using System; +using System.Collections.Generic; + +namespace NaughtyAttributes.Editor +{ + public static class NativePropertyDrawerDatabase + { + private static Dictionary drawersByAttributeType; + + static NativePropertyDrawerDatabase() + { + drawersByAttributeType = new Dictionary(); + drawersByAttributeType[typeof(ShowNativePropertyAttribute)] = new ShowNativePropertyNativePropertyDrawer(); + + } + + public static NativePropertyDrawer GetDrawerForAttribute(Type attributeType) + { + NativePropertyDrawer drawer; + if (drawersByAttributeType.TryGetValue(attributeType, out drawer)) + { + return drawer; + } + else + { + return null; + } + } + } +} + diff --git a/LocalPackages/net.peeweek.gameplay-ingredients/NaughtyAttributes/Editor/CodeGeneration/NativePropertyDrawerDatabase.cs.meta b/LocalPackages/net.peeweek.gameplay-ingredients/NaughtyAttributes/Editor/CodeGeneration/NativePropertyDrawerDatabase.cs.meta new file mode 100644 index 0000000..b86e8d3 --- /dev/null +++ b/LocalPackages/net.peeweek.gameplay-ingredients/NaughtyAttributes/Editor/CodeGeneration/NativePropertyDrawerDatabase.cs.meta @@ -0,0 +1,13 @@ +fileFormatVersion: 2 +guid: 9fd2f82e21266a94ea967208610dda1e +timeCreated: 1510925645 +licenseType: Free +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/LocalPackages/net.peeweek.gameplay-ingredients/NaughtyAttributes/Editor/CodeGeneration/PropertyDrawConditionDatabase.cs b/LocalPackages/net.peeweek.gameplay-ingredients/NaughtyAttributes/Editor/CodeGeneration/PropertyDrawConditionDatabase.cs new file mode 100644 index 0000000..2bf40b8 --- /dev/null +++ b/LocalPackages/net.peeweek.gameplay-ingredients/NaughtyAttributes/Editor/CodeGeneration/PropertyDrawConditionDatabase.cs @@ -0,0 +1,34 @@ +// This class is auto generated + +using System; +using System.Collections.Generic; + +namespace NaughtyAttributes.Editor +{ + public static class PropertyDrawConditionDatabase + { + private static Dictionary drawConditionsByAttributeType; + + static PropertyDrawConditionDatabase() + { + drawConditionsByAttributeType = new Dictionary(); + drawConditionsByAttributeType[typeof(HideIfAttribute)] = new HideIfPropertyDrawCondition(); +drawConditionsByAttributeType[typeof(ShowIfAttribute)] = new ShowIfPropertyDrawCondition(); + + } + + public static PropertyDrawCondition GetDrawConditionForAttribute(Type attributeType) + { + PropertyDrawCondition drawCondition; + if (drawConditionsByAttributeType.TryGetValue(attributeType, out drawCondition)) + { + return drawCondition; + } + else + { + return null; + } + } + } +} + diff --git a/LocalPackages/net.peeweek.gameplay-ingredients/NaughtyAttributes/Editor/CodeGeneration/PropertyDrawConditionDatabase.cs.meta b/LocalPackages/net.peeweek.gameplay-ingredients/NaughtyAttributes/Editor/CodeGeneration/PropertyDrawConditionDatabase.cs.meta new file mode 100644 index 0000000..e4b5bff --- /dev/null +++ b/LocalPackages/net.peeweek.gameplay-ingredients/NaughtyAttributes/Editor/CodeGeneration/PropertyDrawConditionDatabase.cs.meta @@ -0,0 +1,13 @@ +fileFormatVersion: 2 +guid: 0b96dc9fe878bfc49865d28d601a7468 +timeCreated: 1508414568 +licenseType: Free +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/LocalPackages/net.peeweek.gameplay-ingredients/NaughtyAttributes/Editor/CodeGeneration/PropertyDrawerDatabase.cs b/LocalPackages/net.peeweek.gameplay-ingredients/NaughtyAttributes/Editor/CodeGeneration/PropertyDrawerDatabase.cs new file mode 100644 index 0000000..ff6c213 --- /dev/null +++ b/LocalPackages/net.peeweek.gameplay-ingredients/NaughtyAttributes/Editor/CodeGeneration/PropertyDrawerDatabase.cs @@ -0,0 +1,52 @@ +// This class is auto generated + +using System; +using System.Collections.Generic; + +namespace NaughtyAttributes.Editor +{ + public static class PropertyDrawerDatabase + { + private static Dictionary drawersByAttributeType; + + static PropertyDrawerDatabase() + { + drawersByAttributeType = new Dictionary(); + drawersByAttributeType[typeof(DisableIfAttribute)] = new DisableIfPropertyDrawer(); +drawersByAttributeType[typeof(DropdownAttribute)] = new DropdownPropertyDrawer(); +drawersByAttributeType[typeof(EnableIfAttribute)] = new EnableIfPropertyDrawer(); +drawersByAttributeType[typeof(LabelAttribute)] = new LabelPropertyDrawer(); +drawersByAttributeType[typeof(MinMaxSliderAttribute)] = new MinMaxSliderPropertyDrawer(); +drawersByAttributeType[typeof(ProgressBarAttribute)] = new ProgressBarPropertyDrawer(); +drawersByAttributeType[typeof(ReadOnlyAttribute)] = new ReadOnlyPropertyDrawer(); +drawersByAttributeType[typeof(ReorderableListAttribute)] = new ReorderableListPropertyDrawer(); +drawersByAttributeType[typeof(ResizableTextAreaAttribute)] = new ResizableTextAreaPropertyDrawer(); +drawersByAttributeType[typeof(ShowAssetPreviewAttribute)] = new ShowAssetPreviewPropertyDrawer(); +drawersByAttributeType[typeof(SliderAttribute)] = new SliderPropertyDrawer(); +drawersByAttributeType[typeof(TagAttribute)] = new TagPropertyDrawer(); + + } + + public static PropertyDrawer GetDrawerForAttribute(Type attributeType) + { + PropertyDrawer drawer; + if (drawersByAttributeType.TryGetValue(attributeType, out drawer)) + { + return drawer; + } + else + { + return null; + } + } + + public static void ClearCache() + { + foreach (var kvp in drawersByAttributeType) + { + kvp.Value.ClearCache(); + } + } + } +} + diff --git a/LocalPackages/net.peeweek.gameplay-ingredients/NaughtyAttributes/Editor/CodeGeneration/PropertyDrawerDatabase.cs.meta b/LocalPackages/net.peeweek.gameplay-ingredients/NaughtyAttributes/Editor/CodeGeneration/PropertyDrawerDatabase.cs.meta new file mode 100644 index 0000000..36c43db --- /dev/null +++ b/LocalPackages/net.peeweek.gameplay-ingredients/NaughtyAttributes/Editor/CodeGeneration/PropertyDrawerDatabase.cs.meta @@ -0,0 +1,13 @@ +fileFormatVersion: 2 +guid: 57bb89ab38f8da84db719a3fad7934d2 +timeCreated: 1508241644 +licenseType: Free +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/LocalPackages/net.peeweek.gameplay-ingredients/NaughtyAttributes/Editor/CodeGeneration/PropertyGrouperDatabase.cs b/LocalPackages/net.peeweek.gameplay-ingredients/NaughtyAttributes/Editor/CodeGeneration/PropertyGrouperDatabase.cs new file mode 100644 index 0000000..d2d067e --- /dev/null +++ b/LocalPackages/net.peeweek.gameplay-ingredients/NaughtyAttributes/Editor/CodeGeneration/PropertyGrouperDatabase.cs @@ -0,0 +1,33 @@ +// This class is auto generated + +using System; +using System.Collections.Generic; + +namespace NaughtyAttributes.Editor +{ + public static class PropertyGrouperDatabase + { + private static Dictionary groupersByAttributeType; + + static PropertyGrouperDatabase() + { + groupersByAttributeType = new Dictionary(); + groupersByAttributeType[typeof(BoxGroupAttribute)] = new BoxGroupPropertyGrouper(); + + } + + public static PropertyGrouper GetGrouperForAttribute(Type attributeType) + { + PropertyGrouper grouper; + if (groupersByAttributeType.TryGetValue(attributeType, out grouper)) + { + return grouper; + } + else + { + return null; + } + } + } +} + diff --git a/LocalPackages/net.peeweek.gameplay-ingredients/NaughtyAttributes/Editor/CodeGeneration/PropertyGrouperDatabase.cs.meta b/LocalPackages/net.peeweek.gameplay-ingredients/NaughtyAttributes/Editor/CodeGeneration/PropertyGrouperDatabase.cs.meta new file mode 100644 index 0000000..bc0f34b --- /dev/null +++ b/LocalPackages/net.peeweek.gameplay-ingredients/NaughtyAttributes/Editor/CodeGeneration/PropertyGrouperDatabase.cs.meta @@ -0,0 +1,13 @@ +fileFormatVersion: 2 +guid: 0e5fed99fdc5f794291677a80073b4ba +timeCreated: 1508333008 +licenseType: Free +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/LocalPackages/net.peeweek.gameplay-ingredients/NaughtyAttributes/Editor/CodeGeneration/PropertyMetaDatabase.cs b/LocalPackages/net.peeweek.gameplay-ingredients/NaughtyAttributes/Editor/CodeGeneration/PropertyMetaDatabase.cs new file mode 100644 index 0000000..45dfc00 --- /dev/null +++ b/LocalPackages/net.peeweek.gameplay-ingredients/NaughtyAttributes/Editor/CodeGeneration/PropertyMetaDatabase.cs @@ -0,0 +1,34 @@ +// This class is auto generated + +using System; +using System.Collections.Generic; + +namespace NaughtyAttributes.Editor +{ + public static class PropertyMetaDatabase + { + private static Dictionary metasByAttributeType; + + static PropertyMetaDatabase() + { + metasByAttributeType = new Dictionary(); + metasByAttributeType[typeof(InfoBoxAttribute)] = new InfoBoxPropertyMeta(); +metasByAttributeType[typeof(OnValueChangedAttribute)] = new OnValueChangedPropertyMeta(); + + } + + public static PropertyMeta GetMetaForAttribute(Type attributeType) + { + PropertyMeta meta; + if (metasByAttributeType.TryGetValue(attributeType, out meta)) + { + return meta; + } + else + { + return null; + } + } + } +} + diff --git a/LocalPackages/net.peeweek.gameplay-ingredients/NaughtyAttributes/Editor/CodeGeneration/PropertyMetaDatabase.cs.meta b/LocalPackages/net.peeweek.gameplay-ingredients/NaughtyAttributes/Editor/CodeGeneration/PropertyMetaDatabase.cs.meta new file mode 100644 index 0000000..6a60430 --- /dev/null +++ b/LocalPackages/net.peeweek.gameplay-ingredients/NaughtyAttributes/Editor/CodeGeneration/PropertyMetaDatabase.cs.meta @@ -0,0 +1,13 @@ +fileFormatVersion: 2 +guid: 57233c5ec1975024aa0723241b2f8210 +timeCreated: 1508497398 +licenseType: Free +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/LocalPackages/net.peeweek.gameplay-ingredients/NaughtyAttributes/Editor/CodeGeneration/PropertyValidatorDatabase.cs b/LocalPackages/net.peeweek.gameplay-ingredients/NaughtyAttributes/Editor/CodeGeneration/PropertyValidatorDatabase.cs new file mode 100644 index 0000000..c74ca91 --- /dev/null +++ b/LocalPackages/net.peeweek.gameplay-ingredients/NaughtyAttributes/Editor/CodeGeneration/PropertyValidatorDatabase.cs @@ -0,0 +1,36 @@ +// This class is auto generated + +using System; +using System.Collections.Generic; + +namespace NaughtyAttributes.Editor +{ + public static class PropertyValidatorDatabase + { + private static Dictionary validatorsByAttributeType; + + static PropertyValidatorDatabase() + { + validatorsByAttributeType = new Dictionary(); + validatorsByAttributeType[typeof(MaxValueAttribute)] = new MaxValuePropertyValidator(); +validatorsByAttributeType[typeof(MinValueAttribute)] = new MinValuePropertyValidator(); +validatorsByAttributeType[typeof(RequiredAttribute)] = new RequiredPropertyValidator(); +validatorsByAttributeType[typeof(ValidateInputAttribute)] = new ValidateInputPropertyValidator(); + + } + + public static PropertyValidator GetValidatorForAttribute(Type attributeType) + { + PropertyValidator validator; + if (validatorsByAttributeType.TryGetValue(attributeType, out validator)) + { + return validator; + } + else + { + return null; + } + } + } +} + diff --git a/LocalPackages/net.peeweek.gameplay-ingredients/NaughtyAttributes/Editor/CodeGeneration/PropertyValidatorDatabase.cs.meta b/LocalPackages/net.peeweek.gameplay-ingredients/NaughtyAttributes/Editor/CodeGeneration/PropertyValidatorDatabase.cs.meta new file mode 100644 index 0000000..6d882da --- /dev/null +++ b/LocalPackages/net.peeweek.gameplay-ingredients/NaughtyAttributes/Editor/CodeGeneration/PropertyValidatorDatabase.cs.meta @@ -0,0 +1,13 @@ +fileFormatVersion: 2 +guid: 24e9da8a6b324374a9f655d3a867b284 +timeCreated: 1508241122 +licenseType: Free +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/LocalPackages/net.peeweek.gameplay-ingredients/NaughtyAttributes/Editor/CodeGeneration/Templates.meta b/LocalPackages/net.peeweek.gameplay-ingredients/NaughtyAttributes/Editor/CodeGeneration/Templates.meta new file mode 100644 index 0000000..5d830f1 --- /dev/null +++ b/LocalPackages/net.peeweek.gameplay-ingredients/NaughtyAttributes/Editor/CodeGeneration/Templates.meta @@ -0,0 +1,10 @@ +fileFormatVersion: 2 +guid: 7b15ea6695a69d74ab656006617d8d21 +folderAsset: yes +timeCreated: 1508230862 +licenseType: Free +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/LocalPackages/net.peeweek.gameplay-ingredients/NaughtyAttributes/Editor/CodeGeneration/Templates/FieldDrawerDatabaseTemplate.txt b/LocalPackages/net.peeweek.gameplay-ingredients/NaughtyAttributes/Editor/CodeGeneration/Templates/FieldDrawerDatabaseTemplate.txt new file mode 100644 index 0000000..926a6d7 --- /dev/null +++ b/LocalPackages/net.peeweek.gameplay-ingredients/NaughtyAttributes/Editor/CodeGeneration/Templates/FieldDrawerDatabaseTemplate.txt @@ -0,0 +1,31 @@ +// This class is auto generated + +using System; +using System.Collections.Generic; + +namespace NaughtyAttributes.Editor +{ + public static class __classname__ + { + private static Dictionary drawersByAttributeType; + + static __classname__() + { + drawersByAttributeType = new Dictionary(); + __entries__ + } + + public static FieldDrawer GetDrawerForAttribute(Type attributeType) + { + FieldDrawer drawer; + if (drawersByAttributeType.TryGetValue(attributeType, out drawer)) + { + return drawer; + } + else + { + return null; + } + } + } +} diff --git a/LocalPackages/net.peeweek.gameplay-ingredients/NaughtyAttributes/Editor/CodeGeneration/Templates/FieldDrawerDatabaseTemplate.txt.meta b/LocalPackages/net.peeweek.gameplay-ingredients/NaughtyAttributes/Editor/CodeGeneration/Templates/FieldDrawerDatabaseTemplate.txt.meta new file mode 100644 index 0000000..43e8f76 --- /dev/null +++ b/LocalPackages/net.peeweek.gameplay-ingredients/NaughtyAttributes/Editor/CodeGeneration/Templates/FieldDrawerDatabaseTemplate.txt.meta @@ -0,0 +1,9 @@ +fileFormatVersion: 2 +guid: 943b4c41373856243996247275be2cd8 +timeCreated: 1508836344 +licenseType: Free +TextScriptImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/LocalPackages/net.peeweek.gameplay-ingredients/NaughtyAttributes/Editor/CodeGeneration/Templates/MethodDrawerDatabaseTemplate.txt b/LocalPackages/net.peeweek.gameplay-ingredients/NaughtyAttributes/Editor/CodeGeneration/Templates/MethodDrawerDatabaseTemplate.txt new file mode 100644 index 0000000..d6efd8a --- /dev/null +++ b/LocalPackages/net.peeweek.gameplay-ingredients/NaughtyAttributes/Editor/CodeGeneration/Templates/MethodDrawerDatabaseTemplate.txt @@ -0,0 +1,31 @@ +// This class is auto generated + +using System; +using System.Collections.Generic; + +namespace NaughtyAttributes.Editor +{ + public static class __classname__ + { + private static Dictionary drawersByAttributeType; + + static __classname__() + { + drawersByAttributeType = new Dictionary(); + __entries__ + } + + public static MethodDrawer GetDrawerForAttribute(Type attributeType) + { + MethodDrawer drawer; + if (drawersByAttributeType.TryGetValue(attributeType, out drawer)) + { + return drawer; + } + else + { + return null; + } + } + } +} diff --git a/LocalPackages/net.peeweek.gameplay-ingredients/NaughtyAttributes/Editor/CodeGeneration/Templates/MethodDrawerDatabaseTemplate.txt.meta b/LocalPackages/net.peeweek.gameplay-ingredients/NaughtyAttributes/Editor/CodeGeneration/Templates/MethodDrawerDatabaseTemplate.txt.meta new file mode 100644 index 0000000..4531345 --- /dev/null +++ b/LocalPackages/net.peeweek.gameplay-ingredients/NaughtyAttributes/Editor/CodeGeneration/Templates/MethodDrawerDatabaseTemplate.txt.meta @@ -0,0 +1,9 @@ +fileFormatVersion: 2 +guid: 52d15465eb3439f4a9b95963a21d19b7 +timeCreated: 1508592495 +licenseType: Free +TextScriptImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/LocalPackages/net.peeweek.gameplay-ingredients/NaughtyAttributes/Editor/CodeGeneration/Templates/NativePropertyDrawerDbTemplate.txt b/LocalPackages/net.peeweek.gameplay-ingredients/NaughtyAttributes/Editor/CodeGeneration/Templates/NativePropertyDrawerDbTemplate.txt new file mode 100644 index 0000000..fe9cca1 --- /dev/null +++ b/LocalPackages/net.peeweek.gameplay-ingredients/NaughtyAttributes/Editor/CodeGeneration/Templates/NativePropertyDrawerDbTemplate.txt @@ -0,0 +1,31 @@ +// This class is auto generated + +using System; +using System.Collections.Generic; + +namespace NaughtyAttributes.Editor +{ + public static class __classname__ + { + private static Dictionary drawersByAttributeType; + + static __classname__() + { + drawersByAttributeType = new Dictionary(); + __entries__ + } + + public static NativePropertyDrawer GetDrawerForAttribute(Type attributeType) + { + NativePropertyDrawer drawer; + if (drawersByAttributeType.TryGetValue(attributeType, out drawer)) + { + return drawer; + } + else + { + return null; + } + } + } +} diff --git a/LocalPackages/net.peeweek.gameplay-ingredients/NaughtyAttributes/Editor/CodeGeneration/Templates/NativePropertyDrawerDbTemplate.txt.meta b/LocalPackages/net.peeweek.gameplay-ingredients/NaughtyAttributes/Editor/CodeGeneration/Templates/NativePropertyDrawerDbTemplate.txt.meta new file mode 100644 index 0000000..4c16e8c --- /dev/null +++ b/LocalPackages/net.peeweek.gameplay-ingredients/NaughtyAttributes/Editor/CodeGeneration/Templates/NativePropertyDrawerDbTemplate.txt.meta @@ -0,0 +1,9 @@ +fileFormatVersion: 2 +guid: b82f5f6bf1fd4314c93624a8bc8835fd +timeCreated: 1510924467 +licenseType: Free +TextScriptImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/LocalPackages/net.peeweek.gameplay-ingredients/NaughtyAttributes/Editor/CodeGeneration/Templates/PropertyDrawConditionDatabaseTemplate.txt b/LocalPackages/net.peeweek.gameplay-ingredients/NaughtyAttributes/Editor/CodeGeneration/Templates/PropertyDrawConditionDatabaseTemplate.txt new file mode 100644 index 0000000..adc064a --- /dev/null +++ b/LocalPackages/net.peeweek.gameplay-ingredients/NaughtyAttributes/Editor/CodeGeneration/Templates/PropertyDrawConditionDatabaseTemplate.txt @@ -0,0 +1,31 @@ +// This class is auto generated + +using System; +using System.Collections.Generic; + +namespace NaughtyAttributes.Editor +{ + public static class __classname__ + { + private static Dictionary drawConditionsByAttributeType; + + static __classname__() + { + drawConditionsByAttributeType = new Dictionary(); + __entries__ + } + + public static PropertyDrawCondition GetDrawConditionForAttribute(Type attributeType) + { + PropertyDrawCondition drawCondition; + if (drawConditionsByAttributeType.TryGetValue(attributeType, out drawCondition)) + { + return drawCondition; + } + else + { + return null; + } + } + } +} diff --git a/LocalPackages/net.peeweek.gameplay-ingredients/NaughtyAttributes/Editor/CodeGeneration/Templates/PropertyDrawConditionDatabaseTemplate.txt.meta b/LocalPackages/net.peeweek.gameplay-ingredients/NaughtyAttributes/Editor/CodeGeneration/Templates/PropertyDrawConditionDatabaseTemplate.txt.meta new file mode 100644 index 0000000..1d19d37 --- /dev/null +++ b/LocalPackages/net.peeweek.gameplay-ingredients/NaughtyAttributes/Editor/CodeGeneration/Templates/PropertyDrawConditionDatabaseTemplate.txt.meta @@ -0,0 +1,9 @@ +fileFormatVersion: 2 +guid: b36f5858330c2d140a697f19ba6cc36b +timeCreated: 1508414568 +licenseType: Free +TextScriptImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/LocalPackages/net.peeweek.gameplay-ingredients/NaughtyAttributes/Editor/CodeGeneration/Templates/PropertyDrawerDatabaseTemplate.txt b/LocalPackages/net.peeweek.gameplay-ingredients/NaughtyAttributes/Editor/CodeGeneration/Templates/PropertyDrawerDatabaseTemplate.txt new file mode 100644 index 0000000..338dde4 --- /dev/null +++ b/LocalPackages/net.peeweek.gameplay-ingredients/NaughtyAttributes/Editor/CodeGeneration/Templates/PropertyDrawerDatabaseTemplate.txt @@ -0,0 +1,39 @@ +// This class is auto generated + +using System; +using System.Collections.Generic; + +namespace NaughtyAttributes.Editor +{ + public static class __classname__ + { + private static Dictionary drawersByAttributeType; + + static __classname__() + { + drawersByAttributeType = new Dictionary(); + __entries__ + } + + public static PropertyDrawer GetDrawerForAttribute(Type attributeType) + { + PropertyDrawer drawer; + if (drawersByAttributeType.TryGetValue(attributeType, out drawer)) + { + return drawer; + } + else + { + return null; + } + } + + public static void ClearCache() + { + foreach (var kvp in drawersByAttributeType) + { + kvp.Value.ClearCache(); + } + } + } +} diff --git a/LocalPackages/net.peeweek.gameplay-ingredients/NaughtyAttributes/Editor/CodeGeneration/Templates/PropertyDrawerDatabaseTemplate.txt.meta b/LocalPackages/net.peeweek.gameplay-ingredients/NaughtyAttributes/Editor/CodeGeneration/Templates/PropertyDrawerDatabaseTemplate.txt.meta new file mode 100644 index 0000000..26014c9 --- /dev/null +++ b/LocalPackages/net.peeweek.gameplay-ingredients/NaughtyAttributes/Editor/CodeGeneration/Templates/PropertyDrawerDatabaseTemplate.txt.meta @@ -0,0 +1,9 @@ +fileFormatVersion: 2 +guid: 136a96a904b577244b08be5d5542a77d +timeCreated: 1508241102 +licenseType: Free +TextScriptImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/LocalPackages/net.peeweek.gameplay-ingredients/NaughtyAttributes/Editor/CodeGeneration/Templates/PropertyGrouperDatabaseTemplate.txt b/LocalPackages/net.peeweek.gameplay-ingredients/NaughtyAttributes/Editor/CodeGeneration/Templates/PropertyGrouperDatabaseTemplate.txt new file mode 100644 index 0000000..5065a45 --- /dev/null +++ b/LocalPackages/net.peeweek.gameplay-ingredients/NaughtyAttributes/Editor/CodeGeneration/Templates/PropertyGrouperDatabaseTemplate.txt @@ -0,0 +1,31 @@ +// This class is auto generated + +using System; +using System.Collections.Generic; + +namespace NaughtyAttributes.Editor +{ + public static class __classname__ + { + private static Dictionary groupersByAttributeType; + + static __classname__() + { + groupersByAttributeType = new Dictionary(); + __entries__ + } + + public static PropertyGrouper GetGrouperForAttribute(Type attributeType) + { + PropertyGrouper grouper; + if (groupersByAttributeType.TryGetValue(attributeType, out grouper)) + { + return grouper; + } + else + { + return null; + } + } + } +} diff --git a/LocalPackages/net.peeweek.gameplay-ingredients/NaughtyAttributes/Editor/CodeGeneration/Templates/PropertyGrouperDatabaseTemplate.txt.meta b/LocalPackages/net.peeweek.gameplay-ingredients/NaughtyAttributes/Editor/CodeGeneration/Templates/PropertyGrouperDatabaseTemplate.txt.meta new file mode 100644 index 0000000..1167151 --- /dev/null +++ b/LocalPackages/net.peeweek.gameplay-ingredients/NaughtyAttributes/Editor/CodeGeneration/Templates/PropertyGrouperDatabaseTemplate.txt.meta @@ -0,0 +1,9 @@ +fileFormatVersion: 2 +guid: 7fcc5bff99ecd4843b766f23cd585b55 +timeCreated: 1508332899 +licenseType: Free +TextScriptImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/LocalPackages/net.peeweek.gameplay-ingredients/NaughtyAttributes/Editor/CodeGeneration/Templates/PropertyMetaDatabaseTemplate.txt b/LocalPackages/net.peeweek.gameplay-ingredients/NaughtyAttributes/Editor/CodeGeneration/Templates/PropertyMetaDatabaseTemplate.txt new file mode 100644 index 0000000..d88bea4 --- /dev/null +++ b/LocalPackages/net.peeweek.gameplay-ingredients/NaughtyAttributes/Editor/CodeGeneration/Templates/PropertyMetaDatabaseTemplate.txt @@ -0,0 +1,31 @@ +// This class is auto generated + +using System; +using System.Collections.Generic; + +namespace NaughtyAttributes.Editor +{ + public static class __classname__ + { + private static Dictionary metasByAttributeType; + + static __classname__() + { + metasByAttributeType = new Dictionary(); + __entries__ + } + + public static PropertyMeta GetMetaForAttribute(Type attributeType) + { + PropertyMeta meta; + if (metasByAttributeType.TryGetValue(attributeType, out meta)) + { + return meta; + } + else + { + return null; + } + } + } +} diff --git a/LocalPackages/net.peeweek.gameplay-ingredients/NaughtyAttributes/Editor/CodeGeneration/Templates/PropertyMetaDatabaseTemplate.txt.meta b/LocalPackages/net.peeweek.gameplay-ingredients/NaughtyAttributes/Editor/CodeGeneration/Templates/PropertyMetaDatabaseTemplate.txt.meta new file mode 100644 index 0000000..849d247 --- /dev/null +++ b/LocalPackages/net.peeweek.gameplay-ingredients/NaughtyAttributes/Editor/CodeGeneration/Templates/PropertyMetaDatabaseTemplate.txt.meta @@ -0,0 +1,9 @@ +fileFormatVersion: 2 +guid: fde25cf95f45b50469fcf4ee1e38993c +timeCreated: 1508497401 +licenseType: Free +TextScriptImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/LocalPackages/net.peeweek.gameplay-ingredients/NaughtyAttributes/Editor/CodeGeneration/Templates/PropertyValidatorDatabaseTemplate.txt b/LocalPackages/net.peeweek.gameplay-ingredients/NaughtyAttributes/Editor/CodeGeneration/Templates/PropertyValidatorDatabaseTemplate.txt new file mode 100644 index 0000000..2a63494 --- /dev/null +++ b/LocalPackages/net.peeweek.gameplay-ingredients/NaughtyAttributes/Editor/CodeGeneration/Templates/PropertyValidatorDatabaseTemplate.txt @@ -0,0 +1,31 @@ +// This class is auto generated + +using System; +using System.Collections.Generic; + +namespace NaughtyAttributes.Editor +{ + public static class __classname__ + { + private static Dictionary validatorsByAttributeType; + + static __classname__() + { + validatorsByAttributeType = new Dictionary(); + __entries__ + } + + public static PropertyValidator GetValidatorForAttribute(Type attributeType) + { + PropertyValidator validator; + if (validatorsByAttributeType.TryGetValue(attributeType, out validator)) + { + return validator; + } + else + { + return null; + } + } + } +} diff --git a/LocalPackages/net.peeweek.gameplay-ingredients/NaughtyAttributes/Editor/CodeGeneration/Templates/PropertyValidatorDatabaseTemplate.txt.meta b/LocalPackages/net.peeweek.gameplay-ingredients/NaughtyAttributes/Editor/CodeGeneration/Templates/PropertyValidatorDatabaseTemplate.txt.meta new file mode 100644 index 0000000..c0c96d4 --- /dev/null +++ b/LocalPackages/net.peeweek.gameplay-ingredients/NaughtyAttributes/Editor/CodeGeneration/Templates/PropertyValidatorDatabaseTemplate.txt.meta @@ -0,0 +1,9 @@ +fileFormatVersion: 2 +guid: a21c3d37c1492da4386198388150024c +timeCreated: 1508230862 +licenseType: Free +TextScriptImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/LocalPackages/net.peeweek.gameplay-ingredients/NaughtyAttributes/Editor/Editors.meta b/LocalPackages/net.peeweek.gameplay-ingredients/NaughtyAttributes/Editor/Editors.meta new file mode 100644 index 0000000..2c445db --- /dev/null +++ b/LocalPackages/net.peeweek.gameplay-ingredients/NaughtyAttributes/Editor/Editors.meta @@ -0,0 +1,10 @@ +fileFormatVersion: 2 +guid: 4db73d2276d0e8144a206c5c2cd350de +folderAsset: yes +timeCreated: 1508055750 +licenseType: Free +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/LocalPackages/net.peeweek.gameplay-ingredients/NaughtyAttributes/Editor/Editors/InspectorEditor.cs b/LocalPackages/net.peeweek.gameplay-ingredients/NaughtyAttributes/Editor/Editors/InspectorEditor.cs new file mode 100644 index 0000000..da91482 --- /dev/null +++ b/LocalPackages/net.peeweek.gameplay-ingredients/NaughtyAttributes/Editor/Editors/InspectorEditor.cs @@ -0,0 +1,329 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Reflection; +using UnityEditor; +using UnityEngine; + +namespace NaughtyAttributes.Editor +{ + [CanEditMultipleObjects] + [CustomEditor(typeof(UnityEngine.Object), true)] + public class InspectorEditor : UnityEditor.Editor + { + private SerializedProperty script; + + private IEnumerable fields; + private HashSet groupedFields; + private Dictionary> groupedFieldsByGroupName; + private IEnumerable nonSerializedFields; + private IEnumerable nativeProperties; + private IEnumerable methods; + + private Dictionary serializedPropertiesByFieldName; + + private bool useDefaultInspector; + + private void OnEnable() + { + this.script = this.serializedObject.FindProperty("m_Script"); + + // Cache serialized fields + this.fields = ReflectionUtility.GetAllFields(this.target, f => this.serializedObject.FindProperty(f.Name) != null); + + // If there are no NaughtyAttributes use default inspector + if (this.fields.All(f => f.GetCustomAttributes(typeof(NaughtyAttribute), true).Length == 0)) + { + this.useDefaultInspector = true; + } + else + { + this.useDefaultInspector = false; + + // Cache grouped fields + this.groupedFields = new HashSet(this.fields.Where(f => f.GetCustomAttributes(typeof(GroupAttribute), true).Length > 0)); + + // Cache grouped fields by group name + this.groupedFieldsByGroupName = new Dictionary>(); + foreach (var groupedField in this.groupedFields) + { + string groupName = (groupedField.GetCustomAttributes(typeof(GroupAttribute), true)[0] as GroupAttribute).Name; + + if (this.groupedFieldsByGroupName.ContainsKey(groupName)) + { + this.groupedFieldsByGroupName[groupName].Add(groupedField); + } + else + { + this.groupedFieldsByGroupName[groupName] = new List() + { + groupedField + }; + } + } + + // Cache serialized properties by field name + this.serializedPropertiesByFieldName = new Dictionary(); + foreach (var field in this.fields) + { + this.serializedPropertiesByFieldName[field.Name] = this.serializedObject.FindProperty(field.Name); + } + } + + // Cache non-serialized fields + this.nonSerializedFields = ReflectionUtility.GetAllFields( + this.target, f => f.GetCustomAttributes(typeof(DrawerAttribute), true).Length > 0 && this.serializedObject.FindProperty(f.Name) == null); + + // Cache the native properties + this.nativeProperties = ReflectionUtility.GetAllProperties( + this.target, p => p.GetCustomAttributes(typeof(DrawerAttribute), true).Length > 0); + + // Cache methods with DrawerAttribute + this.methods = ReflectionUtility.GetAllMethods( + this.target, m => m.GetCustomAttributes(typeof(DrawerAttribute), true).Length > 0); + } + + private void OnDisable() + { + PropertyDrawerDatabase.ClearCache(); + } + + public override void OnInspectorGUI() + { + if (this.useDefaultInspector) + { + this.DrawDefaultInspector(); + } + else + { + this.serializedObject.Update(); + + if (this.script != null) + { + GUI.enabled = false; + EditorGUILayout.PropertyField(this.script); + GUI.enabled = true; + } + + // Draw fields + HashSet drawnGroups = new HashSet(); + foreach (var field in this.fields) + { + if (this.groupedFields.Contains(field)) + { + // Draw grouped fields + string groupName = (field.GetCustomAttributes(typeof(GroupAttribute), true)[0] as GroupAttribute).Name; + if (!drawnGroups.Contains(groupName)) + { + drawnGroups.Add(groupName); + + PropertyGrouper grouper = this.GetPropertyGrouperForField(field); + if (grouper != null) + { + grouper.BeginGroup(groupName); + + this.ValidateAndDrawFields(this.groupedFieldsByGroupName[groupName]); + + grouper.EndGroup(); + } + else + { + this.ValidateAndDrawFields(this.groupedFieldsByGroupName[groupName]); + } + } + } + else + { + // Draw non-grouped field + this.ValidateAndDrawField(field); + } + } + + this.serializedObject.ApplyModifiedProperties(); + } + + // Draw non-serialized fields + foreach (var field in this.nonSerializedFields) + { + DrawerAttribute drawerAttribute = (DrawerAttribute)field.GetCustomAttributes(typeof(DrawerAttribute), true)[0]; + FieldDrawer drawer = FieldDrawerDatabase.GetDrawerForAttribute(drawerAttribute.GetType()); + if (drawer != null) + { + drawer.DrawField(this.target, field); + } + } + + // Draw native properties + foreach (var property in this.nativeProperties) + { + DrawerAttribute drawerAttribute = (DrawerAttribute)property.GetCustomAttributes(typeof(DrawerAttribute), true)[0]; + NativePropertyDrawer drawer = NativePropertyDrawerDatabase.GetDrawerForAttribute(drawerAttribute.GetType()); + if (drawer != null) + { + drawer.DrawNativeProperty(this.target, property); + } + } + + // Draw methods + foreach (var method in this.methods) + { + DrawerAttribute drawerAttribute = (DrawerAttribute)method.GetCustomAttributes(typeof(DrawerAttribute), true)[0]; + MethodDrawer methodDrawer = MethodDrawerDatabase.GetDrawerForAttribute(drawerAttribute.GetType()); + if (methodDrawer != null) + { + methodDrawer.DrawMethod(this.target, method); + } + } + } + + private void ValidateAndDrawFields(IEnumerable fields) + { + foreach (var field in fields) + { + this.ValidateAndDrawField(field); + } + } + + private void ValidateAndDrawField(FieldInfo field) + { + if (!ShouldDrawField(field)) + { + return; + } + + this.ValidateField(field); + this.ApplyFieldMeta(field); + this.DrawField(field); + } + + private void ValidateField(FieldInfo field) + { + ValidatorAttribute[] validatorAttributes = (ValidatorAttribute[])field.GetCustomAttributes(typeof(ValidatorAttribute), true); + + foreach (var attribute in validatorAttributes) + { + PropertyValidator validator = PropertyValidatorDatabase.GetValidatorForAttribute(attribute.GetType()); + if (validator != null) + { + validator.ValidateProperty(this.serializedPropertiesByFieldName[field.Name]); + } + } + } + + private bool ShouldDrawField(FieldInfo field) + { + // Check if the field has draw conditions + PropertyDrawCondition drawCondition = this.GetPropertyDrawConditionForField(field); + if (drawCondition != null) + { + bool canDrawProperty = drawCondition.CanDrawProperty(this.serializedPropertiesByFieldName[field.Name]); + if (!canDrawProperty) + { + return false; + } + } + + // Check if the field has HideInInspectorAttribute + HideInInspector[] hideInInspectorAttributes = (HideInInspector[])field.GetCustomAttributes(typeof(HideInInspector), true); + if (hideInInspectorAttributes.Length > 0) + { + return false; + } + + return true; + } + + private void DrawField(FieldInfo field) + { + EditorGUI.BeginChangeCheck(); + PropertyDrawer drawer = this.GetPropertyDrawerForField(field); + if (drawer != null) + { + drawer.DrawProperty(this.serializedPropertiesByFieldName[field.Name]); + } + else + { + EditorDrawUtility.DrawPropertyField(this.serializedPropertiesByFieldName[field.Name]); + } + + if (EditorGUI.EndChangeCheck()) + { + OnValueChangedAttribute[] onValueChangedAttributes = (OnValueChangedAttribute[])field.GetCustomAttributes(typeof(OnValueChangedAttribute), true); + foreach (var onValueChangedAttribute in onValueChangedAttributes) + { + PropertyMeta meta = PropertyMetaDatabase.GetMetaForAttribute(onValueChangedAttribute.GetType()); + if (meta != null) + { + meta.ApplyPropertyMeta(this.serializedPropertiesByFieldName[field.Name], onValueChangedAttribute); + } + } + } + } + + private void ApplyFieldMeta(FieldInfo field) + { + // Apply custom meta attributes + MetaAttribute[] metaAttributes = field + .GetCustomAttributes(typeof(MetaAttribute), true) + .Where(attr => attr.GetType() != typeof(OnValueChangedAttribute)) + .Select(obj => obj as MetaAttribute) + .ToArray(); + + Array.Sort(metaAttributes, (x, y) => + { + return x.Order - y.Order; + }); + + foreach (var metaAttribute in metaAttributes) + { + PropertyMeta meta = PropertyMetaDatabase.GetMetaForAttribute(metaAttribute.GetType()); + if (meta != null) + { + meta.ApplyPropertyMeta(this.serializedPropertiesByFieldName[field.Name], metaAttribute); + } + } + } + + private PropertyDrawer GetPropertyDrawerForField(FieldInfo field) + { + DrawerAttribute[] drawerAttributes = (DrawerAttribute[])field.GetCustomAttributes(typeof(DrawerAttribute), true); + if (drawerAttributes.Length > 0) + { + PropertyDrawer drawer = PropertyDrawerDatabase.GetDrawerForAttribute(drawerAttributes[0].GetType()); + return drawer; + } + else + { + return null; + } + } + + private PropertyGrouper GetPropertyGrouperForField(FieldInfo field) + { + GroupAttribute[] groupAttributes = (GroupAttribute[])field.GetCustomAttributes(typeof(GroupAttribute), true); + if (groupAttributes.Length > 0) + { + PropertyGrouper grouper = PropertyGrouperDatabase.GetGrouperForAttribute(groupAttributes[0].GetType()); + return grouper; + } + else + { + return null; + } + } + + private PropertyDrawCondition GetPropertyDrawConditionForField(FieldInfo field) + { + DrawConditionAttribute[] drawConditionAttributes = (DrawConditionAttribute[])field.GetCustomAttributes(typeof(DrawConditionAttribute), true); + if (drawConditionAttributes.Length > 0) + { + PropertyDrawCondition drawCondition = PropertyDrawConditionDatabase.GetDrawConditionForAttribute(drawConditionAttributes[0].GetType()); + return drawCondition; + } + else + { + return null; + } + } + } +} diff --git a/LocalPackages/net.peeweek.gameplay-ingredients/NaughtyAttributes/Editor/Editors/InspectorEditor.cs.meta b/LocalPackages/net.peeweek.gameplay-ingredients/NaughtyAttributes/Editor/Editors/InspectorEditor.cs.meta new file mode 100644 index 0000000..b623552 --- /dev/null +++ b/LocalPackages/net.peeweek.gameplay-ingredients/NaughtyAttributes/Editor/Editors/InspectorEditor.cs.meta @@ -0,0 +1,13 @@ +fileFormatVersion: 2 +guid: 9e82d6d6926a6c74688e2787b37630d1 +timeCreated: 1508055750 +licenseType: Free +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/LocalPackages/net.peeweek.gameplay-ingredients/NaughtyAttributes/Editor/FieldDrawers.meta b/LocalPackages/net.peeweek.gameplay-ingredients/NaughtyAttributes/Editor/FieldDrawers.meta new file mode 100644 index 0000000..ed81436 --- /dev/null +++ b/LocalPackages/net.peeweek.gameplay-ingredients/NaughtyAttributes/Editor/FieldDrawers.meta @@ -0,0 +1,10 @@ +fileFormatVersion: 2 +guid: 79b05858e72c1b0498eca7954843c802 +folderAsset: yes +timeCreated: 1508835721 +licenseType: Free +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/LocalPackages/net.peeweek.gameplay-ingredients/NaughtyAttributes/Editor/FieldDrawers/FieldDrawer.cs b/LocalPackages/net.peeweek.gameplay-ingredients/NaughtyAttributes/Editor/FieldDrawers/FieldDrawer.cs new file mode 100644 index 0000000..805a064 --- /dev/null +++ b/LocalPackages/net.peeweek.gameplay-ingredients/NaughtyAttributes/Editor/FieldDrawers/FieldDrawer.cs @@ -0,0 +1,9 @@ +using System.Reflection; + +namespace NaughtyAttributes.Editor +{ + public abstract class FieldDrawer + { + public abstract void DrawField(UnityEngine.Object target, FieldInfo field); + } +} diff --git a/LocalPackages/net.peeweek.gameplay-ingredients/NaughtyAttributes/Editor/FieldDrawers/FieldDrawer.cs.meta b/LocalPackages/net.peeweek.gameplay-ingredients/NaughtyAttributes/Editor/FieldDrawers/FieldDrawer.cs.meta new file mode 100644 index 0000000..789d479 --- /dev/null +++ b/LocalPackages/net.peeweek.gameplay-ingredients/NaughtyAttributes/Editor/FieldDrawers/FieldDrawer.cs.meta @@ -0,0 +1,13 @@ +fileFormatVersion: 2 +guid: 8949267118f232a4fbebd777de8ed6fe +timeCreated: 1508835721 +licenseType: Free +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/LocalPackages/net.peeweek.gameplay-ingredients/NaughtyAttributes/Editor/FieldDrawers/ShowNonSerializedFieldFieldDrawer.cs b/LocalPackages/net.peeweek.gameplay-ingredients/NaughtyAttributes/Editor/FieldDrawers/ShowNonSerializedFieldFieldDrawer.cs new file mode 100644 index 0000000..efc3a39 --- /dev/null +++ b/LocalPackages/net.peeweek.gameplay-ingredients/NaughtyAttributes/Editor/FieldDrawers/ShowNonSerializedFieldFieldDrawer.cs @@ -0,0 +1,25 @@ +using System.Reflection; +using UnityEditor; + +namespace NaughtyAttributes.Editor +{ + [FieldDrawer(typeof(ShowNonSerializedFieldAttribute))] + public class ShowNonSerializedFieldFieldDrawer : FieldDrawer + { + public override void DrawField(UnityEngine.Object target, FieldInfo field) + { + object value = field.GetValue(target); + + if (value == null) + { + string warning = string.Format("{0} doesn't support {1} types", typeof(ShowNonSerializedFieldFieldDrawer).Name, "Reference"); + EditorDrawUtility.DrawHelpBox(warning, MessageType.Warning, context: target); + } + else if (!EditorDrawUtility.DrawLayoutField(value, field.Name)) + { + string warning = string.Format("{0} doesn't support {1} types", typeof(ShowNonSerializedFieldFieldDrawer).Name, field.FieldType.Name); + EditorDrawUtility.DrawHelpBox(warning, MessageType.Warning, context: target); + } + } + } +} diff --git a/LocalPackages/net.peeweek.gameplay-ingredients/NaughtyAttributes/Editor/FieldDrawers/ShowNonSerializedFieldFieldDrawer.cs.meta b/LocalPackages/net.peeweek.gameplay-ingredients/NaughtyAttributes/Editor/FieldDrawers/ShowNonSerializedFieldFieldDrawer.cs.meta new file mode 100644 index 0000000..fa3410c --- /dev/null +++ b/LocalPackages/net.peeweek.gameplay-ingredients/NaughtyAttributes/Editor/FieldDrawers/ShowNonSerializedFieldFieldDrawer.cs.meta @@ -0,0 +1,13 @@ +fileFormatVersion: 2 +guid: 8449d5c2158e97d479caaec24c61baec +timeCreated: 1508835721 +licenseType: Free +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/LocalPackages/net.peeweek.gameplay-ingredients/NaughtyAttributes/Editor/MethodDrawers.meta b/LocalPackages/net.peeweek.gameplay-ingredients/NaughtyAttributes/Editor/MethodDrawers.meta new file mode 100644 index 0000000..7e351e2 --- /dev/null +++ b/LocalPackages/net.peeweek.gameplay-ingredients/NaughtyAttributes/Editor/MethodDrawers.meta @@ -0,0 +1,10 @@ +fileFormatVersion: 2 +guid: f95312994b1f8c746a402669cb1655eb +folderAsset: yes +timeCreated: 1508592494 +licenseType: Free +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/LocalPackages/net.peeweek.gameplay-ingredients/NaughtyAttributes/Editor/MethodDrawers/ButtonMethodDrawer.cs b/LocalPackages/net.peeweek.gameplay-ingredients/NaughtyAttributes/Editor/MethodDrawers/ButtonMethodDrawer.cs new file mode 100644 index 0000000..a6e1f7b --- /dev/null +++ b/LocalPackages/net.peeweek.gameplay-ingredients/NaughtyAttributes/Editor/MethodDrawers/ButtonMethodDrawer.cs @@ -0,0 +1,29 @@ +using System.Reflection; +using UnityEditor; +using UnityEngine; + +namespace NaughtyAttributes.Editor +{ + [MethodDrawer(typeof(ButtonAttribute))] + public class ButtonMethodDrawer : MethodDrawer + { + public override void DrawMethod(UnityEngine.Object target, MethodInfo methodInfo) + { + if (methodInfo.GetParameters().Length == 0) + { + ButtonAttribute buttonAttribute = (ButtonAttribute)methodInfo.GetCustomAttributes(typeof(ButtonAttribute), true)[0]; + string buttonText = string.IsNullOrEmpty(buttonAttribute.Text) ? methodInfo.Name : buttonAttribute.Text; + + if (GUILayout.Button(buttonText)) + { + methodInfo.Invoke(target, null); + } + } + else + { + string warning = typeof(ButtonAttribute).Name + " works only on methods with no parameters"; + EditorDrawUtility.DrawHelpBox(warning, MessageType.Warning, context: target); + } + } + } +} diff --git a/LocalPackages/net.peeweek.gameplay-ingredients/NaughtyAttributes/Editor/MethodDrawers/ButtonMethodDrawer.cs.meta b/LocalPackages/net.peeweek.gameplay-ingredients/NaughtyAttributes/Editor/MethodDrawers/ButtonMethodDrawer.cs.meta new file mode 100644 index 0000000..cff17a7 --- /dev/null +++ b/LocalPackages/net.peeweek.gameplay-ingredients/NaughtyAttributes/Editor/MethodDrawers/ButtonMethodDrawer.cs.meta @@ -0,0 +1,13 @@ +fileFormatVersion: 2 +guid: ad01ec1a22422c6409f913d60ce39d61 +timeCreated: 1508592494 +licenseType: Free +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/LocalPackages/net.peeweek.gameplay-ingredients/NaughtyAttributes/Editor/MethodDrawers/MethodDrawer.cs b/LocalPackages/net.peeweek.gameplay-ingredients/NaughtyAttributes/Editor/MethodDrawers/MethodDrawer.cs new file mode 100644 index 0000000..687688d --- /dev/null +++ b/LocalPackages/net.peeweek.gameplay-ingredients/NaughtyAttributes/Editor/MethodDrawers/MethodDrawer.cs @@ -0,0 +1,9 @@ +using System.Reflection; + +namespace NaughtyAttributes.Editor +{ + public abstract class MethodDrawer + { + public abstract void DrawMethod(UnityEngine.Object target, MethodInfo methodInfo); + } +} diff --git a/LocalPackages/net.peeweek.gameplay-ingredients/NaughtyAttributes/Editor/MethodDrawers/MethodDrawer.cs.meta b/LocalPackages/net.peeweek.gameplay-ingredients/NaughtyAttributes/Editor/MethodDrawers/MethodDrawer.cs.meta new file mode 100644 index 0000000..22137e5 --- /dev/null +++ b/LocalPackages/net.peeweek.gameplay-ingredients/NaughtyAttributes/Editor/MethodDrawers/MethodDrawer.cs.meta @@ -0,0 +1,13 @@ +fileFormatVersion: 2 +guid: a65a1addcdd323249b590f7a06110869 +timeCreated: 1508592494 +licenseType: Free +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/LocalPackages/net.peeweek.gameplay-ingredients/NaughtyAttributes/Editor/NativePropertyDrawers.meta b/LocalPackages/net.peeweek.gameplay-ingredients/NaughtyAttributes/Editor/NativePropertyDrawers.meta new file mode 100644 index 0000000..665bbfc --- /dev/null +++ b/LocalPackages/net.peeweek.gameplay-ingredients/NaughtyAttributes/Editor/NativePropertyDrawers.meta @@ -0,0 +1,10 @@ +fileFormatVersion: 2 +guid: ae67cc6bfa799f147968e9b0371a21fc +folderAsset: yes +timeCreated: 1510924467 +licenseType: Free +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/LocalPackages/net.peeweek.gameplay-ingredients/NaughtyAttributes/Editor/NativePropertyDrawers/NativePropertyDrawer.cs b/LocalPackages/net.peeweek.gameplay-ingredients/NaughtyAttributes/Editor/NativePropertyDrawers/NativePropertyDrawer.cs new file mode 100644 index 0000000..0fb0e6b --- /dev/null +++ b/LocalPackages/net.peeweek.gameplay-ingredients/NaughtyAttributes/Editor/NativePropertyDrawers/NativePropertyDrawer.cs @@ -0,0 +1,9 @@ +using System.Reflection; + +namespace NaughtyAttributes.Editor +{ + public abstract class NativePropertyDrawer + { + public abstract void DrawNativeProperty(UnityEngine.Object target, PropertyInfo property); + } +} diff --git a/LocalPackages/net.peeweek.gameplay-ingredients/NaughtyAttributes/Editor/NativePropertyDrawers/NativePropertyDrawer.cs.meta b/LocalPackages/net.peeweek.gameplay-ingredients/NaughtyAttributes/Editor/NativePropertyDrawers/NativePropertyDrawer.cs.meta new file mode 100644 index 0000000..897323c --- /dev/null +++ b/LocalPackages/net.peeweek.gameplay-ingredients/NaughtyAttributes/Editor/NativePropertyDrawers/NativePropertyDrawer.cs.meta @@ -0,0 +1,13 @@ +fileFormatVersion: 2 +guid: 715c5ada29663a245b0b35937c892377 +timeCreated: 1510924467 +licenseType: Free +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/LocalPackages/net.peeweek.gameplay-ingredients/NaughtyAttributes/Editor/NativePropertyDrawers/ShowNativePropertyNativePropertyDrawer.cs b/LocalPackages/net.peeweek.gameplay-ingredients/NaughtyAttributes/Editor/NativePropertyDrawers/ShowNativePropertyNativePropertyDrawer.cs new file mode 100644 index 0000000..326247e --- /dev/null +++ b/LocalPackages/net.peeweek.gameplay-ingredients/NaughtyAttributes/Editor/NativePropertyDrawers/ShowNativePropertyNativePropertyDrawer.cs @@ -0,0 +1,25 @@ +using System.Reflection; +using UnityEditor; + +namespace NaughtyAttributes.Editor +{ + [NativePropertyDrawer(typeof(ShowNativePropertyAttribute))] + public class ShowNativePropertyNativePropertyDrawer : NativePropertyDrawer + { + public override void DrawNativeProperty(UnityEngine.Object target, PropertyInfo property) + { + object value = property.GetValue(target, null); + + if (value == null) + { + string warning = string.Format("{0} doesn't support {1} types", typeof(ShowNativePropertyNativePropertyDrawer).Name, "Reference"); + EditorDrawUtility.DrawHelpBox(warning, MessageType.Warning, context: target); + } + else if (!EditorDrawUtility.DrawLayoutField(value, property.Name)) + { + string warning = string.Format("{0} doesn't support {1} types", typeof(ShowNativePropertyNativePropertyDrawer).Name, property.PropertyType.Name); + EditorDrawUtility.DrawHelpBox(warning, MessageType.Warning, context: target); + } + } + } +} diff --git a/LocalPackages/net.peeweek.gameplay-ingredients/NaughtyAttributes/Editor/NativePropertyDrawers/ShowNativePropertyNativePropertyDrawer.cs.meta b/LocalPackages/net.peeweek.gameplay-ingredients/NaughtyAttributes/Editor/NativePropertyDrawers/ShowNativePropertyNativePropertyDrawer.cs.meta new file mode 100644 index 0000000..9b1f424 --- /dev/null +++ b/LocalPackages/net.peeweek.gameplay-ingredients/NaughtyAttributes/Editor/NativePropertyDrawers/ShowNativePropertyNativePropertyDrawer.cs.meta @@ -0,0 +1,13 @@ +fileFormatVersion: 2 +guid: 518b0fde2a9d15d498bc17fd1d7062c7 +timeCreated: 1510926376 +licenseType: Free +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/LocalPackages/net.peeweek.gameplay-ingredients/NaughtyAttributes/Editor/NaughtyAttributes.Editor.asmdef b/LocalPackages/net.peeweek.gameplay-ingredients/NaughtyAttributes/Editor/NaughtyAttributes.Editor.asmdef new file mode 100644 index 0000000..e1aafc2 --- /dev/null +++ b/LocalPackages/net.peeweek.gameplay-ingredients/NaughtyAttributes/Editor/NaughtyAttributes.Editor.asmdef @@ -0,0 +1,16 @@ +{ + "name": "NaughtyAttributes.Editor", + "references": [ + "NaughtyAttributes.Core" + ], + "optionalUnityReferences": [], + "includePlatforms": [ + "Editor" + ], + "excludePlatforms": [], + "allowUnsafeCode": false, + "overrideReferences": false, + "precompiledReferences": [], + "autoReferenced": true, + "defineConstraints": [] +} \ No newline at end of file diff --git a/LocalPackages/net.peeweek.gameplay-ingredients/NaughtyAttributes/Editor/NaughtyAttributes.Editor.asmdef.meta b/LocalPackages/net.peeweek.gameplay-ingredients/NaughtyAttributes/Editor/NaughtyAttributes.Editor.asmdef.meta new file mode 100644 index 0000000..70dc9f2 --- /dev/null +++ b/LocalPackages/net.peeweek.gameplay-ingredients/NaughtyAttributes/Editor/NaughtyAttributes.Editor.asmdef.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: f88fb04354076c646a4107a491394033 +AssemblyDefinitionImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/LocalPackages/net.peeweek.gameplay-ingredients/NaughtyAttributes/Editor/PropertyDrawConditions.meta b/LocalPackages/net.peeweek.gameplay-ingredients/NaughtyAttributes/Editor/PropertyDrawConditions.meta new file mode 100644 index 0000000..6742dcd --- /dev/null +++ b/LocalPackages/net.peeweek.gameplay-ingredients/NaughtyAttributes/Editor/PropertyDrawConditions.meta @@ -0,0 +1,10 @@ +fileFormatVersion: 2 +guid: 0ed2b7d432f0ad644b1f0752cf65aa9c +folderAsset: yes +timeCreated: 1508414568 +licenseType: Free +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/LocalPackages/net.peeweek.gameplay-ingredients/NaughtyAttributes/Editor/PropertyDrawConditions/HideIfPropertyDrawCondition.cs b/LocalPackages/net.peeweek.gameplay-ingredients/NaughtyAttributes/Editor/PropertyDrawConditions/HideIfPropertyDrawCondition.cs new file mode 100644 index 0000000..84276db --- /dev/null +++ b/LocalPackages/net.peeweek.gameplay-ingredients/NaughtyAttributes/Editor/PropertyDrawConditions/HideIfPropertyDrawCondition.cs @@ -0,0 +1,9 @@ +using UnityEditor; + +namespace NaughtyAttributes.Editor +{ + [PropertyDrawCondition(typeof(HideIfAttribute))] + public class HideIfPropertyDrawCondition : ShowIfPropertyDrawCondition + { + } +} diff --git a/LocalPackages/net.peeweek.gameplay-ingredients/NaughtyAttributes/Editor/PropertyDrawConditions/HideIfPropertyDrawCondition.cs.meta b/LocalPackages/net.peeweek.gameplay-ingredients/NaughtyAttributes/Editor/PropertyDrawConditions/HideIfPropertyDrawCondition.cs.meta new file mode 100644 index 0000000..2b7cd1d --- /dev/null +++ b/LocalPackages/net.peeweek.gameplay-ingredients/NaughtyAttributes/Editor/PropertyDrawConditions/HideIfPropertyDrawCondition.cs.meta @@ -0,0 +1,13 @@ +fileFormatVersion: 2 +guid: f7e60d80f0231654ab13cfb1178e6eb8 +timeCreated: 1508414568 +licenseType: Free +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/LocalPackages/net.peeweek.gameplay-ingredients/NaughtyAttributes/Editor/PropertyDrawConditions/PropertyDrawCondition.cs b/LocalPackages/net.peeweek.gameplay-ingredients/NaughtyAttributes/Editor/PropertyDrawConditions/PropertyDrawCondition.cs new file mode 100644 index 0000000..2ea9f7a --- /dev/null +++ b/LocalPackages/net.peeweek.gameplay-ingredients/NaughtyAttributes/Editor/PropertyDrawConditions/PropertyDrawCondition.cs @@ -0,0 +1,9 @@ +using UnityEditor; + +namespace NaughtyAttributes.Editor +{ + public abstract class PropertyDrawCondition + { + public abstract bool CanDrawProperty(SerializedProperty property); + } +} diff --git a/LocalPackages/net.peeweek.gameplay-ingredients/NaughtyAttributes/Editor/PropertyDrawConditions/PropertyDrawCondition.cs.meta b/LocalPackages/net.peeweek.gameplay-ingredients/NaughtyAttributes/Editor/PropertyDrawConditions/PropertyDrawCondition.cs.meta new file mode 100644 index 0000000..f326b5d --- /dev/null +++ b/LocalPackages/net.peeweek.gameplay-ingredients/NaughtyAttributes/Editor/PropertyDrawConditions/PropertyDrawCondition.cs.meta @@ -0,0 +1,13 @@ +fileFormatVersion: 2 +guid: ce2d1d9afa04cae43a18bd01ec9447eb +timeCreated: 1508414568 +licenseType: Free +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/LocalPackages/net.peeweek.gameplay-ingredients/NaughtyAttributes/Editor/PropertyDrawConditions/ShowIfPropertyDrawCondition.cs b/LocalPackages/net.peeweek.gameplay-ingredients/NaughtyAttributes/Editor/PropertyDrawConditions/ShowIfPropertyDrawCondition.cs new file mode 100644 index 0000000..3cd1a97 --- /dev/null +++ b/LocalPackages/net.peeweek.gameplay-ingredients/NaughtyAttributes/Editor/PropertyDrawConditions/ShowIfPropertyDrawCondition.cs @@ -0,0 +1,70 @@ +using System.Collections.Generic; +using System.Reflection; +using UnityEditor; + +namespace NaughtyAttributes.Editor +{ + [PropertyDrawCondition(typeof(ShowIfAttribute))] + public class ShowIfPropertyDrawCondition : PropertyDrawCondition + { + public override bool CanDrawProperty(SerializedProperty property) + { + ShowIfAttribute showIfAttribute = PropertyUtility.GetAttribute(property); + UnityEngine.Object target = PropertyUtility.GetTargetObject(property); + + List conditionValues = new List(); + foreach (var condition in showIfAttribute.Conditions) + { + FieldInfo conditionField = ReflectionUtility.GetField(target, condition); + if (conditionField != null && + conditionField.FieldType == typeof(bool)) + { + conditionValues.Add((bool)conditionField.GetValue(target)); + } + + MethodInfo conditionMethod = ReflectionUtility.GetMethod(target, condition); + if (conditionMethod != null && + conditionMethod.ReturnType == typeof(bool) && + conditionMethod.GetParameters().Length == 0) + { + conditionValues.Add((bool)conditionMethod.Invoke(target, null)); + } + } + + if (conditionValues.Count > 0) + { + bool draw; + if (showIfAttribute.ConditionOperator == ConditionOperator.And) + { + draw = true; + foreach (var value in conditionValues) + { + draw = draw && value; + } + } + else + { + draw = false; + foreach (var value in conditionValues) + { + draw = draw || value; + } + } + + if (showIfAttribute.Reversed) + { + draw = !draw; + } + + return draw; + } + else + { + string warning = showIfAttribute.GetType().Name + " needs a valid boolean condition field or method name to work"; + EditorDrawUtility.DrawHelpBox(warning, MessageType.Warning, context: target); + + return true; + } + } + } +} diff --git a/LocalPackages/net.peeweek.gameplay-ingredients/NaughtyAttributes/Editor/PropertyDrawConditions/ShowIfPropertyDrawCondition.cs.meta b/LocalPackages/net.peeweek.gameplay-ingredients/NaughtyAttributes/Editor/PropertyDrawConditions/ShowIfPropertyDrawCondition.cs.meta new file mode 100644 index 0000000..2e7a555 --- /dev/null +++ b/LocalPackages/net.peeweek.gameplay-ingredients/NaughtyAttributes/Editor/PropertyDrawConditions/ShowIfPropertyDrawCondition.cs.meta @@ -0,0 +1,13 @@ +fileFormatVersion: 2 +guid: fce0c8241476ad94cbbcdd6faae90700 +timeCreated: 1508414568 +licenseType: Free +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/LocalPackages/net.peeweek.gameplay-ingredients/NaughtyAttributes/Editor/PropertyDrawers.meta b/LocalPackages/net.peeweek.gameplay-ingredients/NaughtyAttributes/Editor/PropertyDrawers.meta new file mode 100644 index 0000000..7f3a245 --- /dev/null +++ b/LocalPackages/net.peeweek.gameplay-ingredients/NaughtyAttributes/Editor/PropertyDrawers.meta @@ -0,0 +1,10 @@ +fileFormatVersion: 2 +guid: 4327d74fca5deaa4c83c483fe468d274 +folderAsset: yes +timeCreated: 1508051576 +licenseType: Free +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/LocalPackages/net.peeweek.gameplay-ingredients/NaughtyAttributes/Editor/PropertyDrawers/DisableIfPropertyDrawer.cs b/LocalPackages/net.peeweek.gameplay-ingredients/NaughtyAttributes/Editor/PropertyDrawers/DisableIfPropertyDrawer.cs new file mode 100644 index 0000000..ed27b41 --- /dev/null +++ b/LocalPackages/net.peeweek.gameplay-ingredients/NaughtyAttributes/Editor/PropertyDrawers/DisableIfPropertyDrawer.cs @@ -0,0 +1,9 @@ +using UnityEditor; + +namespace NaughtyAttributes.Editor +{ + [PropertyDrawer(typeof(DisableIfAttribute))] + public class DisableIfPropertyDrawer : EnableIfPropertyDrawer + { + } +} diff --git a/LocalPackages/net.peeweek.gameplay-ingredients/NaughtyAttributes/Editor/PropertyDrawers/DisableIfPropertyDrawer.cs.meta b/LocalPackages/net.peeweek.gameplay-ingredients/NaughtyAttributes/Editor/PropertyDrawers/DisableIfPropertyDrawer.cs.meta new file mode 100644 index 0000000..579b0a4 --- /dev/null +++ b/LocalPackages/net.peeweek.gameplay-ingredients/NaughtyAttributes/Editor/PropertyDrawers/DisableIfPropertyDrawer.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 6093965e939dcd24687aed40741be04b +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/LocalPackages/net.peeweek.gameplay-ingredients/NaughtyAttributes/Editor/PropertyDrawers/DropdownPropertyDrawer.cs b/LocalPackages/net.peeweek.gameplay-ingredients/NaughtyAttributes/Editor/PropertyDrawers/DropdownPropertyDrawer.cs new file mode 100644 index 0000000..f7ac834 --- /dev/null +++ b/LocalPackages/net.peeweek.gameplay-ingredients/NaughtyAttributes/Editor/PropertyDrawers/DropdownPropertyDrawer.cs @@ -0,0 +1,130 @@ +using UnityEngine; +using UnityEditor; +using System.Reflection; +using System.Collections; +using System; +using System.Collections.Generic; + +namespace NaughtyAttributes.Editor +{ + [PropertyDrawer(typeof(DropdownAttribute))] + public class DropdownPropertyDrawer : PropertyDrawer + { + public override void DrawProperty(SerializedProperty property) + { + EditorDrawUtility.DrawHeader(property); + + DropdownAttribute dropdownAttribute = PropertyUtility.GetAttribute(property); + UnityEngine.Object target = PropertyUtility.GetTargetObject(property); + + FieldInfo fieldInfo = ReflectionUtility.GetField(target, property.name); + FieldInfo valuesFieldInfo = ReflectionUtility.GetField(target, dropdownAttribute.ValuesFieldName); + + if (valuesFieldInfo == null) + { + this.DrawWarningBox(string.Format("{0} cannot find a values field with name \"{1}\"", dropdownAttribute.GetType().Name, dropdownAttribute.ValuesFieldName)); + EditorGUILayout.PropertyField(property, true); + } + else if (valuesFieldInfo.GetValue(target) is IList && + fieldInfo.FieldType == this.GetElementType(valuesFieldInfo)) + { + // Selected value + object selectedValue = fieldInfo.GetValue(target); + + // Values and display options + IList valuesList = (IList)valuesFieldInfo.GetValue(target); + object[] values = new object[valuesList.Count]; + string[] displayOptions = new string[valuesList.Count]; + + for (int i = 0; i < values.Length; i++) + { + object value = valuesList[i]; + values[i] = value; + displayOptions[i] = value.ToString(); + } + + // Selected value index + int selectedValueIndex = Array.IndexOf(values, selectedValue); + if (selectedValueIndex < 0) + { + selectedValueIndex = 0; + } + + // Draw the dropdown + this.DrawDropdown(target, fieldInfo, property.displayName, selectedValueIndex, values, displayOptions); + } + else if (valuesFieldInfo.GetValue(target) is IDropdownList) + { + // Current value + object selectedValue = fieldInfo.GetValue(target); + + // Current value index, values and display options + IDropdownList dropdown = (IDropdownList)valuesFieldInfo.GetValue(target); + IEnumerator> dropdownEnumerator = dropdown.GetEnumerator(); + + int index = -1; + int selectedValueIndex = -1; + List values = new List(); + List displayOptions = new List(); + + while (dropdownEnumerator.MoveNext()) + { + index++; + + KeyValuePair current = dropdownEnumerator.Current; + if (current.Value.Equals(selectedValue)) + { + selectedValueIndex = index; + } + + values.Add(current.Value); + displayOptions.Add(current.Key); + } + + if (selectedValueIndex < 0) + { + selectedValueIndex = 0; + } + + // Draw the dropdown + this.DrawDropdown(target, fieldInfo, property.displayName, selectedValueIndex, values.ToArray(), displayOptions.ToArray()); + } + else + { + this.DrawWarningBox(typeof(DropdownAttribute).Name + " works only when the type of the field is equal to the element type of the array"); + EditorGUILayout.PropertyField(property, true); + } + } + + private Type GetElementType(FieldInfo listFieldInfo) + { + if (listFieldInfo.FieldType.IsGenericType) + { + return listFieldInfo.FieldType.GetGenericArguments()[0]; + } + else + { + return listFieldInfo.FieldType.GetElementType(); + } + } + + private void DrawDropdown(UnityEngine.Object target, FieldInfo fieldInfo, string label, int selectedValueIndex, object[] values, string[] displayOptions) + { + EditorGUI.BeginChangeCheck(); + + int newIndex = EditorGUILayout.Popup(label, selectedValueIndex, displayOptions); + + if (EditorGUI.EndChangeCheck()) + { + Undo.RecordObject(target, "Dropdown"); + fieldInfo.SetValue(target, values[newIndex]); + } + } + + private void DrawWarningBox(string message) + { + EditorGUILayout.HelpBox(message, MessageType.Warning); + Debug.LogWarning(message); + } + } +} diff --git a/LocalPackages/net.peeweek.gameplay-ingredients/NaughtyAttributes/Editor/PropertyDrawers/DropdownPropertyDrawer.cs.meta b/LocalPackages/net.peeweek.gameplay-ingredients/NaughtyAttributes/Editor/PropertyDrawers/DropdownPropertyDrawer.cs.meta new file mode 100644 index 0000000..eb68163 --- /dev/null +++ b/LocalPackages/net.peeweek.gameplay-ingredients/NaughtyAttributes/Editor/PropertyDrawers/DropdownPropertyDrawer.cs.meta @@ -0,0 +1,13 @@ +fileFormatVersion: 2 +guid: 19d935f1205a5804c80c51c3ad95a271 +timeCreated: 1508753698 +licenseType: Free +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/LocalPackages/net.peeweek.gameplay-ingredients/NaughtyAttributes/Editor/PropertyDrawers/EnableIfPropertyDrawer.cs b/LocalPackages/net.peeweek.gameplay-ingredients/NaughtyAttributes/Editor/PropertyDrawers/EnableIfPropertyDrawer.cs new file mode 100644 index 0000000..dfb8060 --- /dev/null +++ b/LocalPackages/net.peeweek.gameplay-ingredients/NaughtyAttributes/Editor/PropertyDrawers/EnableIfPropertyDrawer.cs @@ -0,0 +1,71 @@ +using System.Collections.Generic; +using System.Reflection; +using UnityEditor; +using UnityEngine; + +namespace NaughtyAttributes.Editor +{ + [PropertyDrawer(typeof(EnableIfAttribute))] + public class EnableIfPropertyDrawer : PropertyDrawer + { + public override void DrawProperty(SerializedProperty property) + { + EnableIfAttribute enableIfAttribute = PropertyUtility.GetAttribute(property); + UnityEngine.Object target = PropertyUtility.GetTargetObject(property); + + List conditionValues = new List(); + foreach (var condition in enableIfAttribute.Conditions) + { + FieldInfo conditionField = ReflectionUtility.GetField(target, condition); + if (conditionField != null && + conditionField.FieldType == typeof(bool)) + { + conditionValues.Add((bool)conditionField.GetValue(target)); + } + + MethodInfo conditionMethod = ReflectionUtility.GetMethod(target, condition); + if (conditionMethod != null && + conditionMethod.ReturnType == typeof(bool) && + conditionMethod.GetParameters().Length == 0) + { + conditionValues.Add((bool)conditionMethod.Invoke(target, null)); + } + } + + if (conditionValues.Count > 0) + { + bool enabled; + if (enableIfAttribute.ConditionOperator == ConditionOperator.And) + { + enabled = true; + foreach (var value in conditionValues) + { + enabled = enabled && value; + } + } + else + { + enabled = false; + foreach (var value in conditionValues) + { + enabled = enabled || value; + } + } + + if (enableIfAttribute.Reversed) + { + enabled = !enabled; + } + + GUI.enabled = enabled; + EditorDrawUtility.DrawPropertyField(property); + GUI.enabled = true; + } + else + { + string warning = enableIfAttribute.GetType().Name + " needs a valid boolean condition field or method name to work"; + EditorDrawUtility.DrawHelpBox(warning, MessageType.Warning, context: target); + } + } + } +} diff --git a/LocalPackages/net.peeweek.gameplay-ingredients/NaughtyAttributes/Editor/PropertyDrawers/EnableIfPropertyDrawer.cs.meta b/LocalPackages/net.peeweek.gameplay-ingredients/NaughtyAttributes/Editor/PropertyDrawers/EnableIfPropertyDrawer.cs.meta new file mode 100644 index 0000000..9b1abe6 --- /dev/null +++ b/LocalPackages/net.peeweek.gameplay-ingredients/NaughtyAttributes/Editor/PropertyDrawers/EnableIfPropertyDrawer.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 36d4c9f730abf4945814f7e205003836 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/LocalPackages/net.peeweek.gameplay-ingredients/NaughtyAttributes/Editor/PropertyDrawers/LabelPropertyDrawer.cs b/LocalPackages/net.peeweek.gameplay-ingredients/NaughtyAttributes/Editor/PropertyDrawers/LabelPropertyDrawer.cs new file mode 100644 index 0000000..301b48f --- /dev/null +++ b/LocalPackages/net.peeweek.gameplay-ingredients/NaughtyAttributes/Editor/PropertyDrawers/LabelPropertyDrawer.cs @@ -0,0 +1,16 @@ +using UnityEngine; +using UnityEditor; + +namespace NaughtyAttributes.Editor +{ + [PropertyDrawer(typeof(LabelAttribute))] + public class LabelPropertyDrawer : PropertyDrawer + { + public override void DrawProperty(SerializedProperty property) + { + var labelAttribute = PropertyUtility.GetAttribute(property); + var guiContent = new GUIContent(labelAttribute.Label); + EditorGUILayout.PropertyField(property, guiContent, true); + } + } +} diff --git a/LocalPackages/net.peeweek.gameplay-ingredients/NaughtyAttributes/Editor/PropertyDrawers/LabelPropertyDrawer.cs.meta b/LocalPackages/net.peeweek.gameplay-ingredients/NaughtyAttributes/Editor/PropertyDrawers/LabelPropertyDrawer.cs.meta new file mode 100644 index 0000000..bfd5f26 --- /dev/null +++ b/LocalPackages/net.peeweek.gameplay-ingredients/NaughtyAttributes/Editor/PropertyDrawers/LabelPropertyDrawer.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: efcf74639df2db34c8302355c0d29454 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/LocalPackages/net.peeweek.gameplay-ingredients/NaughtyAttributes/Editor/PropertyDrawers/MinMaxSliderPropertyDrawer.cs b/LocalPackages/net.peeweek.gameplay-ingredients/NaughtyAttributes/Editor/PropertyDrawers/MinMaxSliderPropertyDrawer.cs new file mode 100644 index 0000000..f902046 --- /dev/null +++ b/LocalPackages/net.peeweek.gameplay-ingredients/NaughtyAttributes/Editor/PropertyDrawers/MinMaxSliderPropertyDrawer.cs @@ -0,0 +1,76 @@ +using UnityEngine; +using UnityEditor; + +namespace NaughtyAttributes.Editor +{ + [PropertyDrawer(typeof(MinMaxSliderAttribute))] + public class MinMaxSliderPropertyDrawer : PropertyDrawer + { + public override void DrawProperty(SerializedProperty property) + { + EditorDrawUtility.DrawHeader(property); + + MinMaxSliderAttribute minMaxSliderAttribute = PropertyUtility.GetAttribute(property); + + if (property.propertyType == SerializedPropertyType.Vector2) + { + Rect controlRect = EditorGUILayout.GetControlRect(); + float labelWidth = EditorGUIUtility.labelWidth; + float floatFieldWidth = EditorGUIUtility.fieldWidth; + float sliderWidth = controlRect.width - labelWidth - 2f * floatFieldWidth; + float sliderPadding = 5f; + + Rect labelRect = new Rect( + controlRect.x, + controlRect.y, + labelWidth, + controlRect.height); + + Rect sliderRect = new Rect( + controlRect.x + labelWidth + floatFieldWidth + sliderPadding, + controlRect.y, + sliderWidth - 2f * sliderPadding, + controlRect.height); + + Rect minFloatFieldRect = new Rect( + controlRect.x + labelWidth, + controlRect.y, + floatFieldWidth, + controlRect.height); + + Rect maxFloatFieldRect = new Rect( + controlRect.x + labelWidth + floatFieldWidth + sliderWidth, + controlRect.y, + floatFieldWidth, + controlRect.height); + + // Draw the label + EditorGUI.LabelField(labelRect, property.displayName); + + // Draw the slider + EditorGUI.BeginChangeCheck(); + + Vector2 sliderValue = property.vector2Value; + EditorGUI.MinMaxSlider(sliderRect, ref sliderValue.x, ref sliderValue.y, minMaxSliderAttribute.MinValue, minMaxSliderAttribute.MaxValue); + + sliderValue.x = EditorGUI.FloatField(minFloatFieldRect, sliderValue.x); + sliderValue.x = Mathf.Clamp(sliderValue.x, minMaxSliderAttribute.MinValue, Mathf.Min(minMaxSliderAttribute.MaxValue, sliderValue.y)); + + sliderValue.y = EditorGUI.FloatField(maxFloatFieldRect, sliderValue.y); + sliderValue.y = Mathf.Clamp(sliderValue.y, Mathf.Max(minMaxSliderAttribute.MinValue, sliderValue.x), minMaxSliderAttribute.MaxValue); + + if (EditorGUI.EndChangeCheck()) + { + property.vector2Value = sliderValue; + } + } + else + { + string warning = minMaxSliderAttribute.GetType().Name + " can be used only on Vector2 fields"; + EditorDrawUtility.DrawHelpBox(warning, MessageType.Warning, context: PropertyUtility.GetTargetObject(property)); + + EditorDrawUtility.DrawPropertyField(property); + } + } + } +} diff --git a/LocalPackages/net.peeweek.gameplay-ingredients/NaughtyAttributes/Editor/PropertyDrawers/MinMaxSliderPropertyDrawer.cs.meta b/LocalPackages/net.peeweek.gameplay-ingredients/NaughtyAttributes/Editor/PropertyDrawers/MinMaxSliderPropertyDrawer.cs.meta new file mode 100644 index 0000000..ca0af07 --- /dev/null +++ b/LocalPackages/net.peeweek.gameplay-ingredients/NaughtyAttributes/Editor/PropertyDrawers/MinMaxSliderPropertyDrawer.cs.meta @@ -0,0 +1,13 @@ +fileFormatVersion: 2 +guid: 27011af81554b5b4489b155f09275475 +timeCreated: 1508427131 +licenseType: Free +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/LocalPackages/net.peeweek.gameplay-ingredients/NaughtyAttributes/Editor/PropertyDrawers/ProgressBarPropertyDrawer.cs b/LocalPackages/net.peeweek.gameplay-ingredients/NaughtyAttributes/Editor/PropertyDrawers/ProgressBarPropertyDrawer.cs new file mode 100644 index 0000000..582f2b1 --- /dev/null +++ b/LocalPackages/net.peeweek.gameplay-ingredients/NaughtyAttributes/Editor/PropertyDrawers/ProgressBarPropertyDrawer.cs @@ -0,0 +1,96 @@ +using UnityEngine; +using UnityEditor; +using System; + +namespace NaughtyAttributes.Editor +{ + [PropertyDrawer(typeof(ProgressBarAttribute))] + public class ProgressBarPropertyDrawer : PropertyDrawer + { + public override void DrawProperty(SerializedProperty property) + { + EditorDrawUtility.DrawHeader(property); + + if (property.propertyType != SerializedPropertyType.Float && property.propertyType != SerializedPropertyType.Integer) + { + EditorGUILayout.HelpBox("Field " + property.name + " is not a number", MessageType.Warning); + return; + } + + var value = property.propertyType == SerializedPropertyType.Integer ? property.intValue : property.floatValue; + var valueFormatted = property.propertyType == SerializedPropertyType.Integer ? value.ToString() : String.Format("{0:0.00}", value); + + ProgressBarAttribute progressBarAttribute = PropertyUtility.GetAttribute(property); + var position = EditorGUILayout.GetControlRect(); + var maxValue = progressBarAttribute.MaxValue; + float lineHight = EditorGUIUtility.singleLineHeight; + float padding = EditorGUIUtility.standardVerticalSpacing; + var barPosition = new Rect(position.position.x, position.position.y, position.size.x, lineHight); + + var fillPercentage = value / maxValue; + var barLabel = (!string.IsNullOrEmpty(progressBarAttribute.Name) ? "[" + progressBarAttribute.Name + "] " : "") + valueFormatted + "/" + maxValue; + + var color = GetColor(progressBarAttribute.Color); + var color2 = Color.white; + DrawBar(barPosition, Mathf.Clamp01(fillPercentage), barLabel, color, color2); + } + + private void DrawBar(Rect position, float fillPercent, string label, Color barColor, Color labelColor) + { + if (Event.current.type != EventType.Repaint) + { + return; + } + + Color savedColor = GUI.color; + + var fillRect = new Rect(position.x, position.y, position.width * fillPercent, position.height); + + EditorGUI.DrawRect(position, new Color(0.13f, 0.13f, 0.13f)); + EditorGUI.DrawRect(fillRect, barColor); + + // set alignment and cache the default + var align = GUI.skin.label.alignment; + GUI.skin.label.alignment = TextAnchor.UpperCenter; + + // set the color and cache the default + var c = GUI.contentColor; + GUI.contentColor = labelColor; + + // calculate the position + var labelRect = new Rect(position.x, position.y - 2, position.width, position.height); + + // draw~ + EditorGUI.DropShadowLabel(labelRect, label); + + // reset color and alignment + GUI.contentColor = c; + GUI.skin.label.alignment = align; + } + + private Color GetColor(ProgressBarColor color) + { + switch (color) + { + case ProgressBarColor.Red: + return new Color32(255, 0, 63, 255); + case ProgressBarColor.Pink: + return new Color32(255, 152, 203, 255); + case ProgressBarColor.Orange: + return new Color32(255, 128, 0, 255); + case ProgressBarColor.Yellow: + return new Color32(255, 211, 0, 255); + case ProgressBarColor.Green: + return new Color32(102, 255, 0, 255); + case ProgressBarColor.Blue: + return new Color32(0, 135, 189, 255); + case ProgressBarColor.Indigo: + return new Color32(75, 0, 130, 255); + case ProgressBarColor.Violet: + return new Color32(127, 0, 255, 255); + default: + return Color.white; + } + } + } +} diff --git a/LocalPackages/net.peeweek.gameplay-ingredients/NaughtyAttributes/Editor/PropertyDrawers/ProgressBarPropertyDrawer.cs.meta b/LocalPackages/net.peeweek.gameplay-ingredients/NaughtyAttributes/Editor/PropertyDrawers/ProgressBarPropertyDrawer.cs.meta new file mode 100644 index 0000000..c7403f8 --- /dev/null +++ b/LocalPackages/net.peeweek.gameplay-ingredients/NaughtyAttributes/Editor/PropertyDrawers/ProgressBarPropertyDrawer.cs.meta @@ -0,0 +1,13 @@ +fileFormatVersion: 2 +guid: 47ba764aac86a4d488c8acd0af8f0d23 +timeCreated: 1518435237 +licenseType: Pro +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/LocalPackages/net.peeweek.gameplay-ingredients/NaughtyAttributes/Editor/PropertyDrawers/PropertyDrawer.cs b/LocalPackages/net.peeweek.gameplay-ingredients/NaughtyAttributes/Editor/PropertyDrawers/PropertyDrawer.cs new file mode 100644 index 0000000..762c30e --- /dev/null +++ b/LocalPackages/net.peeweek.gameplay-ingredients/NaughtyAttributes/Editor/PropertyDrawers/PropertyDrawer.cs @@ -0,0 +1,14 @@ +using UnityEditor; + +namespace NaughtyAttributes.Editor +{ + public abstract class PropertyDrawer + { + public abstract void DrawProperty(SerializedProperty property); + + public virtual void ClearCache() + { + + } + } +} diff --git a/LocalPackages/net.peeweek.gameplay-ingredients/NaughtyAttributes/Editor/PropertyDrawers/PropertyDrawer.cs.meta b/LocalPackages/net.peeweek.gameplay-ingredients/NaughtyAttributes/Editor/PropertyDrawers/PropertyDrawer.cs.meta new file mode 100644 index 0000000..276a963 --- /dev/null +++ b/LocalPackages/net.peeweek.gameplay-ingredients/NaughtyAttributes/Editor/PropertyDrawers/PropertyDrawer.cs.meta @@ -0,0 +1,13 @@ +fileFormatVersion: 2 +guid: fd2df67a49fb7bd4d8e3914c5a2cf4a8 +timeCreated: 1508051576 +licenseType: Free +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/LocalPackages/net.peeweek.gameplay-ingredients/NaughtyAttributes/Editor/PropertyDrawers/ReadOnlyPropertyDrawer.cs b/LocalPackages/net.peeweek.gameplay-ingredients/NaughtyAttributes/Editor/PropertyDrawers/ReadOnlyPropertyDrawer.cs new file mode 100644 index 0000000..a255642 --- /dev/null +++ b/LocalPackages/net.peeweek.gameplay-ingredients/NaughtyAttributes/Editor/PropertyDrawers/ReadOnlyPropertyDrawer.cs @@ -0,0 +1,16 @@ +using UnityEditor; +using UnityEngine; + +namespace NaughtyAttributes.Editor +{ + [PropertyDrawer(typeof(ReadOnlyAttribute))] + public class ReadOnlyPropertyDrawer : PropertyDrawer + { + public override void DrawProperty(SerializedProperty property) + { + GUI.enabled = false; + EditorDrawUtility.DrawPropertyField(property); + GUI.enabled = true; + } + } +} diff --git a/LocalPackages/net.peeweek.gameplay-ingredients/NaughtyAttributes/Editor/PropertyDrawers/ReadOnlyPropertyDrawer.cs.meta b/LocalPackages/net.peeweek.gameplay-ingredients/NaughtyAttributes/Editor/PropertyDrawers/ReadOnlyPropertyDrawer.cs.meta new file mode 100644 index 0000000..aa80c05 --- /dev/null +++ b/LocalPackages/net.peeweek.gameplay-ingredients/NaughtyAttributes/Editor/PropertyDrawers/ReadOnlyPropertyDrawer.cs.meta @@ -0,0 +1,13 @@ +fileFormatVersion: 2 +guid: a392efb1d44b30744bb7bf76e479cfab +timeCreated: 1508862451 +licenseType: Free +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/LocalPackages/net.peeweek.gameplay-ingredients/NaughtyAttributes/Editor/PropertyDrawers/ReorderableListPropertyDrawer.cs b/LocalPackages/net.peeweek.gameplay-ingredients/NaughtyAttributes/Editor/PropertyDrawers/ReorderableListPropertyDrawer.cs new file mode 100644 index 0000000..c618477 --- /dev/null +++ b/LocalPackages/net.peeweek.gameplay-ingredients/NaughtyAttributes/Editor/PropertyDrawers/ReorderableListPropertyDrawer.cs @@ -0,0 +1,70 @@ +using UnityEngine; +using UnityEditor; +using UnityEditorInternal; +using System.Collections.Generic; + +namespace NaughtyAttributes.Editor +{ + [PropertyDrawer(typeof(ReorderableListAttribute))] + public class ReorderableListPropertyDrawer : PropertyDrawer + { + private Dictionary reorderableListsByPropertyName = new Dictionary(); + + string GetPropertyKeyName(SerializedProperty property) + { + return property.serializedObject.targetObject.GetInstanceID() + "/" + property.name; + } + + public override void DrawProperty(SerializedProperty property) + { + EditorDrawUtility.DrawHeader(property); + + if (property.isArray) + { + var key = GetPropertyKeyName(property); + + if (!this.reorderableListsByPropertyName.ContainsKey(key)) + { + ReorderableList reorderableList = new ReorderableList(property.serializedObject, property, true, true, true, true) + { + drawHeaderCallback = (Rect rect) => + { + EditorGUI.LabelField(rect, string.Format("{0}: {1}", property.displayName, property.arraySize), EditorStyles.label); + }, + + drawElementCallback = (Rect rect, int index, bool isActive, bool isFocused) => + { + var element = property.GetArrayElementAtIndex(index); + rect.y += 1.0f; + rect.x += 10.0f; + rect.width -= 10.0f; + + EditorGUI.PropertyField(new Rect(rect.x, rect.y, rect.width, EditorGUIUtility.singleLineHeight), element, true); + }, + + elementHeightCallback = (int index) => + { + return EditorGUI.GetPropertyHeight(property.GetArrayElementAtIndex(index)) + 4.0f; + } + }; + + this.reorderableListsByPropertyName[key] = reorderableList; + } + + this.reorderableListsByPropertyName[key].DoLayoutList(); + } + else + { + string warning = typeof(ReorderableListAttribute).Name + " can be used only on arrays or lists"; + EditorDrawUtility.DrawHelpBox(warning, MessageType.Warning, context: PropertyUtility.GetTargetObject(property)); + + EditorDrawUtility.DrawPropertyField(property); + } + } + + public override void ClearCache() + { + this.reorderableListsByPropertyName.Clear(); + } + } +} diff --git a/LocalPackages/net.peeweek.gameplay-ingredients/NaughtyAttributes/Editor/PropertyDrawers/ReorderableListPropertyDrawer.cs.meta b/LocalPackages/net.peeweek.gameplay-ingredients/NaughtyAttributes/Editor/PropertyDrawers/ReorderableListPropertyDrawer.cs.meta new file mode 100644 index 0000000..c06f619 --- /dev/null +++ b/LocalPackages/net.peeweek.gameplay-ingredients/NaughtyAttributes/Editor/PropertyDrawers/ReorderableListPropertyDrawer.cs.meta @@ -0,0 +1,13 @@ +fileFormatVersion: 2 +guid: 6d5a6c66de03d1d4882f0c83b0e5f8f2 +timeCreated: 1508402303 +licenseType: Free +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/LocalPackages/net.peeweek.gameplay-ingredients/NaughtyAttributes/Editor/PropertyDrawers/ResizableTextAreaPropertyDrawer.cs b/LocalPackages/net.peeweek.gameplay-ingredients/NaughtyAttributes/Editor/PropertyDrawers/ResizableTextAreaPropertyDrawer.cs new file mode 100644 index 0000000..e2fd1d8 --- /dev/null +++ b/LocalPackages/net.peeweek.gameplay-ingredients/NaughtyAttributes/Editor/PropertyDrawers/ResizableTextAreaPropertyDrawer.cs @@ -0,0 +1,35 @@ +using UnityEngine; +using UnityEditor; + +namespace NaughtyAttributes.Editor +{ + [PropertyDrawer(typeof(ResizableTextAreaAttribute))] + public class ResizableTextAreaPropertyDrawer : PropertyDrawer + { + public override void DrawProperty(SerializedProperty property) + { + EditorDrawUtility.DrawHeader(property); + + if (property.propertyType == SerializedPropertyType.String) + { + EditorGUILayout.LabelField(property.displayName); + + EditorGUI.BeginChangeCheck(); + + string textAreaValue = EditorGUILayout.TextArea(property.stringValue, GUILayout.MinHeight(EditorGUIUtility.singleLineHeight * 3f)); + + if (EditorGUI.EndChangeCheck()) + { + property.stringValue = textAreaValue; + } + } + else + { + string warning = PropertyUtility.GetAttribute(property).GetType().Name + " can only be used on string fields"; + EditorDrawUtility.DrawHelpBox(warning, MessageType.Warning, context: PropertyUtility.GetTargetObject(property)); + + EditorDrawUtility.DrawPropertyField(property); + } + } + } +} diff --git a/LocalPackages/net.peeweek.gameplay-ingredients/NaughtyAttributes/Editor/PropertyDrawers/ResizableTextAreaPropertyDrawer.cs.meta b/LocalPackages/net.peeweek.gameplay-ingredients/NaughtyAttributes/Editor/PropertyDrawers/ResizableTextAreaPropertyDrawer.cs.meta new file mode 100644 index 0000000..898f9d2 --- /dev/null +++ b/LocalPackages/net.peeweek.gameplay-ingredients/NaughtyAttributes/Editor/PropertyDrawers/ResizableTextAreaPropertyDrawer.cs.meta @@ -0,0 +1,13 @@ +fileFormatVersion: 2 +guid: 57848d4e847a8d445a53095abdbbb274 +timeCreated: 1508583167 +licenseType: Free +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/LocalPackages/net.peeweek.gameplay-ingredients/NaughtyAttributes/Editor/PropertyDrawers/ShowAssetPreviewPropertyDrawer.cs b/LocalPackages/net.peeweek.gameplay-ingredients/NaughtyAttributes/Editor/PropertyDrawers/ShowAssetPreviewPropertyDrawer.cs new file mode 100644 index 0000000..f2e42b7 --- /dev/null +++ b/LocalPackages/net.peeweek.gameplay-ingredients/NaughtyAttributes/Editor/PropertyDrawers/ShowAssetPreviewPropertyDrawer.cs @@ -0,0 +1,40 @@ +using UnityEngine; +using UnityEditor; + +namespace NaughtyAttributes.Editor +{ + [PropertyDrawer(typeof(ShowAssetPreviewAttribute))] + public class ShowAssetPreviewPropertyDrawer : PropertyDrawer + { + public override void DrawProperty(SerializedProperty property) + { + EditorDrawUtility.DrawPropertyField(property); + + if (property.propertyType == SerializedPropertyType.ObjectReference) + { + if (property.objectReferenceValue != null) + { + Texture2D previewTexture = AssetPreview.GetAssetPreview(property.objectReferenceValue); + if (previewTexture != null) + { + ShowAssetPreviewAttribute showAssetPreviewAttribute = PropertyUtility.GetAttribute(property); + int width = Mathf.Clamp(showAssetPreviewAttribute.Width, 0, previewTexture.width); + int height = Mathf.Clamp(showAssetPreviewAttribute.Height, 0, previewTexture.height); + + GUILayout.Label(previewTexture, GUILayout.MaxWidth(width), GUILayout.MaxHeight(height)); + } + else + { + string warning = property.name + " doesn't have an asset preview"; + EditorDrawUtility.DrawHelpBox(warning, MessageType.Warning, context: PropertyUtility.GetTargetObject(property)); + } + } + } + else + { + string warning = property.name + " doesn't have an asset preview"; + EditorDrawUtility.DrawHelpBox(warning, MessageType.Warning, context: PropertyUtility.GetTargetObject(property)); + } + } + } +} diff --git a/LocalPackages/net.peeweek.gameplay-ingredients/NaughtyAttributes/Editor/PropertyDrawers/ShowAssetPreviewPropertyDrawer.cs.meta b/LocalPackages/net.peeweek.gameplay-ingredients/NaughtyAttributes/Editor/PropertyDrawers/ShowAssetPreviewPropertyDrawer.cs.meta new file mode 100644 index 0000000..4c4b7c0 --- /dev/null +++ b/LocalPackages/net.peeweek.gameplay-ingredients/NaughtyAttributes/Editor/PropertyDrawers/ShowAssetPreviewPropertyDrawer.cs.meta @@ -0,0 +1,13 @@ +fileFormatVersion: 2 +guid: 6c461f4d7edd955419e5e6ce2c874599 +timeCreated: 1509089502 +licenseType: Free +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/LocalPackages/net.peeweek.gameplay-ingredients/NaughtyAttributes/Editor/PropertyDrawers/SliderPropertyDrawer.cs b/LocalPackages/net.peeweek.gameplay-ingredients/NaughtyAttributes/Editor/PropertyDrawers/SliderPropertyDrawer.cs new file mode 100644 index 0000000..49280f0 --- /dev/null +++ b/LocalPackages/net.peeweek.gameplay-ingredients/NaughtyAttributes/Editor/PropertyDrawers/SliderPropertyDrawer.cs @@ -0,0 +1,31 @@ +using UnityEditor; + +namespace NaughtyAttributes.Editor +{ + [PropertyDrawer(typeof(SliderAttribute))] + public class SliderPropertyDrawer : PropertyDrawer + { + public override void DrawProperty(SerializedProperty property) + { + EditorDrawUtility.DrawHeader(property); + + SliderAttribute sliderAttribute = PropertyUtility.GetAttribute(property); + + if (property.propertyType == SerializedPropertyType.Integer) + { + EditorGUILayout.IntSlider(property, (int)sliderAttribute.MinValue, (int)sliderAttribute.MaxValue); + } + else if (property.propertyType == SerializedPropertyType.Float) + { + EditorGUILayout.Slider(property, sliderAttribute.MinValue, sliderAttribute.MaxValue); + } + else + { + string warning = sliderAttribute.GetType().Name + " can be used only on int or float fields"; + EditorDrawUtility.DrawHelpBox(warning, MessageType.Warning, context: PropertyUtility.GetTargetObject(property)); + + EditorDrawUtility.DrawPropertyField(property); + } + } + } +} diff --git a/LocalPackages/net.peeweek.gameplay-ingredients/NaughtyAttributes/Editor/PropertyDrawers/SliderPropertyDrawer.cs.meta b/LocalPackages/net.peeweek.gameplay-ingredients/NaughtyAttributes/Editor/PropertyDrawers/SliderPropertyDrawer.cs.meta new file mode 100644 index 0000000..5aae3b0 --- /dev/null +++ b/LocalPackages/net.peeweek.gameplay-ingredients/NaughtyAttributes/Editor/PropertyDrawers/SliderPropertyDrawer.cs.meta @@ -0,0 +1,13 @@ +fileFormatVersion: 2 +guid: ae129a284d179ae41b8ab20f506e5d99 +timeCreated: 1508422518 +licenseType: Free +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/LocalPackages/net.peeweek.gameplay-ingredients/NaughtyAttributes/Editor/PropertyDrawers/TagPropertyDrawer.cs b/LocalPackages/net.peeweek.gameplay-ingredients/NaughtyAttributes/Editor/PropertyDrawers/TagPropertyDrawer.cs new file mode 100644 index 0000000..462a1f1 --- /dev/null +++ b/LocalPackages/net.peeweek.gameplay-ingredients/NaughtyAttributes/Editor/PropertyDrawers/TagPropertyDrawer.cs @@ -0,0 +1,56 @@ +using UnityEditor; +using System.Collections.Generic; + +namespace NaughtyAttributes.Editor +{ + // Original by Dylan Engelman + // http://jupiterlighthousestudio.com/custom-inspectors-unity/ + // Altered by Brecht Lecluyse http://www.brechtos.com + // and Sichen Liu https://sichenn.github.io + [PropertyDrawer(typeof(TagAttribute))] + public class TagPropertyDrawer : PropertyDrawer + { + public override void DrawProperty(SerializedProperty property) + { + if (property.propertyType == SerializedPropertyType.String) + { + // generate the taglist + custom tags + List tagList = new List(); + tagList.Add("(None)"); + tagList.Add("Untagged"); + tagList.AddRange(UnityEditorInternal.InternalEditorUtility.tags); + + string propertyString = property.stringValue; + int index = 0; + // check if there is an entry that matches the entry and get the index + // we skip index 0 as that is a special custom case + for (int i = 1; i < tagList.Count; i++) + { + if (tagList[i] == propertyString) + { + index = i; + break; + } + } + + // Draw the popup box with the current selected index + index = EditorGUILayout.Popup(property.displayName, index, tagList.ToArray()); + + // Adjust the actual string value of the property based on the selection + if (index > 0) + { + property.stringValue = tagList[index]; + } + else + { + property.stringValue = string.Empty; + } + } + else + { + EditorGUILayout.HelpBox(property.type + " is not supported by TagAttribute\n" + + "Use string instead", MessageType.Warning); + } + } + } +} \ No newline at end of file diff --git a/LocalPackages/net.peeweek.gameplay-ingredients/NaughtyAttributes/Editor/PropertyDrawers/TagPropertyDrawer.cs.meta b/LocalPackages/net.peeweek.gameplay-ingredients/NaughtyAttributes/Editor/PropertyDrawers/TagPropertyDrawer.cs.meta new file mode 100644 index 0000000..7a841a8 --- /dev/null +++ b/LocalPackages/net.peeweek.gameplay-ingredients/NaughtyAttributes/Editor/PropertyDrawers/TagPropertyDrawer.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: f915ac324502a0e48990bfe775312665 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/LocalPackages/net.peeweek.gameplay-ingredients/NaughtyAttributes/Editor/PropertyGroupers.meta b/LocalPackages/net.peeweek.gameplay-ingredients/NaughtyAttributes/Editor/PropertyGroupers.meta new file mode 100644 index 0000000..d850feb --- /dev/null +++ b/LocalPackages/net.peeweek.gameplay-ingredients/NaughtyAttributes/Editor/PropertyGroupers.meta @@ -0,0 +1,10 @@ +fileFormatVersion: 2 +guid: 35fed6de66b90ad418e2ca247a303b9b +folderAsset: yes +timeCreated: 1508331735 +licenseType: Free +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/LocalPackages/net.peeweek.gameplay-ingredients/NaughtyAttributes/Editor/PropertyGroupers/BoxGroupPropertyGrouper.cs b/LocalPackages/net.peeweek.gameplay-ingredients/NaughtyAttributes/Editor/PropertyGroupers/BoxGroupPropertyGrouper.cs new file mode 100644 index 0000000..e84eaf3 --- /dev/null +++ b/LocalPackages/net.peeweek.gameplay-ingredients/NaughtyAttributes/Editor/PropertyGroupers/BoxGroupPropertyGrouper.cs @@ -0,0 +1,24 @@ +using UnityEditor; +using UnityEngine; + +namespace NaughtyAttributes.Editor +{ + [PropertyGrouper(typeof(BoxGroupAttribute))] + public class BoxGroupPropertyGrouper : PropertyGrouper + { + public override void BeginGroup(string label) + { + EditorGUILayout.BeginVertical(GUI.skin.box); + + if (!string.IsNullOrEmpty(label)) + { + EditorGUILayout.LabelField(label, EditorStyles.boldLabel); + } + } + + public override void EndGroup() + { + EditorGUILayout.EndVertical(); + } + } +} diff --git a/LocalPackages/net.peeweek.gameplay-ingredients/NaughtyAttributes/Editor/PropertyGroupers/BoxGroupPropertyGrouper.cs.meta b/LocalPackages/net.peeweek.gameplay-ingredients/NaughtyAttributes/Editor/PropertyGroupers/BoxGroupPropertyGrouper.cs.meta new file mode 100644 index 0000000..b11e43f --- /dev/null +++ b/LocalPackages/net.peeweek.gameplay-ingredients/NaughtyAttributes/Editor/PropertyGroupers/BoxGroupPropertyGrouper.cs.meta @@ -0,0 +1,13 @@ +fileFormatVersion: 2 +guid: 657c1fb836d709c4b964d04f07ddd047 +timeCreated: 1508332897 +licenseType: Free +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/LocalPackages/net.peeweek.gameplay-ingredients/NaughtyAttributes/Editor/PropertyGroupers/PropertyGrouper.cs b/LocalPackages/net.peeweek.gameplay-ingredients/NaughtyAttributes/Editor/PropertyGroupers/PropertyGrouper.cs new file mode 100644 index 0000000..2e4492a --- /dev/null +++ b/LocalPackages/net.peeweek.gameplay-ingredients/NaughtyAttributes/Editor/PropertyGroupers/PropertyGrouper.cs @@ -0,0 +1,11 @@ +using System; + +namespace NaughtyAttributes.Editor +{ + public abstract class PropertyGrouper + { + public abstract void BeginGroup(string label); + + public abstract void EndGroup(); + } +} diff --git a/LocalPackages/net.peeweek.gameplay-ingredients/NaughtyAttributes/Editor/PropertyGroupers/PropertyGrouper.cs.meta b/LocalPackages/net.peeweek.gameplay-ingredients/NaughtyAttributes/Editor/PropertyGroupers/PropertyGrouper.cs.meta new file mode 100644 index 0000000..1e2a88a --- /dev/null +++ b/LocalPackages/net.peeweek.gameplay-ingredients/NaughtyAttributes/Editor/PropertyGroupers/PropertyGrouper.cs.meta @@ -0,0 +1,13 @@ +fileFormatVersion: 2 +guid: 207d6d654fe48184c97a1c946d0ad8a4 +timeCreated: 1508331735 +licenseType: Free +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/LocalPackages/net.peeweek.gameplay-ingredients/NaughtyAttributes/Editor/PropertyMetas.meta b/LocalPackages/net.peeweek.gameplay-ingredients/NaughtyAttributes/Editor/PropertyMetas.meta new file mode 100644 index 0000000..58792a1 --- /dev/null +++ b/LocalPackages/net.peeweek.gameplay-ingredients/NaughtyAttributes/Editor/PropertyMetas.meta @@ -0,0 +1,10 @@ +fileFormatVersion: 2 +guid: 254c9f391295da84fb392b742e7fceae +folderAsset: yes +timeCreated: 1508497398 +licenseType: Free +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/LocalPackages/net.peeweek.gameplay-ingredients/NaughtyAttributes/Editor/PropertyMetas/InfoBoxPropertyMeta.cs b/LocalPackages/net.peeweek.gameplay-ingredients/NaughtyAttributes/Editor/PropertyMetas/InfoBoxPropertyMeta.cs new file mode 100644 index 0000000..9d43e5c --- /dev/null +++ b/LocalPackages/net.peeweek.gameplay-ingredients/NaughtyAttributes/Editor/PropertyMetas/InfoBoxPropertyMeta.cs @@ -0,0 +1,68 @@ +using System.Reflection; +using UnityEditor; + +namespace NaughtyAttributes.Editor +{ + [PropertyMeta(typeof(InfoBoxAttribute))] + public class InfoBoxPropertyMeta : PropertyMeta + { + public override void ApplyPropertyMeta(SerializedProperty property, MetaAttribute metaAttribute) + { + InfoBoxAttribute infoBoxAttribute = (InfoBoxAttribute)metaAttribute; + UnityEngine.Object target = PropertyUtility.GetTargetObject(property); + + if (!string.IsNullOrEmpty(infoBoxAttribute.VisibleIf)) + { + FieldInfo conditionField = ReflectionUtility.GetField(target, infoBoxAttribute.VisibleIf); + if (conditionField != null && + conditionField.FieldType == typeof(bool)) + { + if ((bool)conditionField.GetValue(target)) + { + this.DrawInfoBox(infoBoxAttribute.Text, infoBoxAttribute.Type); + } + + return; + } + + MethodInfo conditionMethod = ReflectionUtility.GetMethod(target, infoBoxAttribute.VisibleIf); + if (conditionMethod != null && + conditionMethod.ReturnType == typeof(bool) && + conditionMethod.GetParameters().Length == 0) + { + if ((bool)conditionMethod.Invoke(target, null)) + { + this.DrawInfoBox(infoBoxAttribute.Text, infoBoxAttribute.Type); + } + + return; + } + + string warning = infoBoxAttribute.GetType().Name + " needs a valid boolean condition field or method name to work"; + EditorDrawUtility.DrawHelpBox(warning, MessageType.Warning, context: PropertyUtility.GetTargetObject(property)); + } + else + { + this.DrawInfoBox(infoBoxAttribute.Text, infoBoxAttribute.Type); + } + } + + private void DrawInfoBox(string infoText, InfoBoxType infoBoxType) + { + switch (infoBoxType) + { + case InfoBoxType.Normal: + EditorGUILayout.HelpBox(infoText, MessageType.Info); + break; + + case InfoBoxType.Warning: + EditorGUILayout.HelpBox(infoText, MessageType.Warning); + break; + + case InfoBoxType.Error: + EditorGUILayout.HelpBox(infoText, MessageType.Error); + break; + } + } + } +} diff --git a/LocalPackages/net.peeweek.gameplay-ingredients/NaughtyAttributes/Editor/PropertyMetas/InfoBoxPropertyMeta.cs.meta b/LocalPackages/net.peeweek.gameplay-ingredients/NaughtyAttributes/Editor/PropertyMetas/InfoBoxPropertyMeta.cs.meta new file mode 100644 index 0000000..bb4c001 --- /dev/null +++ b/LocalPackages/net.peeweek.gameplay-ingredients/NaughtyAttributes/Editor/PropertyMetas/InfoBoxPropertyMeta.cs.meta @@ -0,0 +1,13 @@ +fileFormatVersion: 2 +guid: 998d996265069854eae8d1241df0c8aa +timeCreated: 1508607449 +licenseType: Free +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/LocalPackages/net.peeweek.gameplay-ingredients/NaughtyAttributes/Editor/PropertyMetas/OnValueChangedPropertyMeta.cs b/LocalPackages/net.peeweek.gameplay-ingredients/NaughtyAttributes/Editor/PropertyMetas/OnValueChangedPropertyMeta.cs new file mode 100644 index 0000000..75303ce --- /dev/null +++ b/LocalPackages/net.peeweek.gameplay-ingredients/NaughtyAttributes/Editor/PropertyMetas/OnValueChangedPropertyMeta.cs @@ -0,0 +1,31 @@ +using System.Reflection; +using UnityEditor; +using UnityEngine; + +namespace NaughtyAttributes.Editor +{ + [PropertyMeta(typeof(OnValueChangedAttribute))] + public class OnValueChangedPropertyMeta : PropertyMeta + { + public override void ApplyPropertyMeta(SerializedProperty property, MetaAttribute metaAttribute) + { + OnValueChangedAttribute onValueChangedAttribute = (OnValueChangedAttribute)metaAttribute; + UnityEngine.Object target = PropertyUtility.GetTargetObject(property); + + MethodInfo callbackMethod = ReflectionUtility.GetMethod(target, onValueChangedAttribute.CallbackName); + if (callbackMethod != null && + callbackMethod.ReturnType == typeof(void) && + callbackMethod.GetParameters().Length == 0) + { + property.serializedObject.ApplyModifiedProperties(); // We must apply modifications so that the callback can be invoked with up-to-date data + + callbackMethod.Invoke(target, null); + } + else + { + string warning = onValueChangedAttribute.GetType().Name + " can invoke only action methods - with void return type and no parameters"; + Debug.LogWarning(warning, target); + } + } + } +} diff --git a/LocalPackages/net.peeweek.gameplay-ingredients/NaughtyAttributes/Editor/PropertyMetas/OnValueChangedPropertyMeta.cs.meta b/LocalPackages/net.peeweek.gameplay-ingredients/NaughtyAttributes/Editor/PropertyMetas/OnValueChangedPropertyMeta.cs.meta new file mode 100644 index 0000000..4c29909 --- /dev/null +++ b/LocalPackages/net.peeweek.gameplay-ingredients/NaughtyAttributes/Editor/PropertyMetas/OnValueChangedPropertyMeta.cs.meta @@ -0,0 +1,13 @@ +fileFormatVersion: 2 +guid: a55050bf047356c49b1598f431d277e9 +timeCreated: 1508612140 +licenseType: Free +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/LocalPackages/net.peeweek.gameplay-ingredients/NaughtyAttributes/Editor/PropertyMetas/PropertyMeta.cs b/LocalPackages/net.peeweek.gameplay-ingredients/NaughtyAttributes/Editor/PropertyMetas/PropertyMeta.cs new file mode 100644 index 0000000..3d9b499 --- /dev/null +++ b/LocalPackages/net.peeweek.gameplay-ingredients/NaughtyAttributes/Editor/PropertyMetas/PropertyMeta.cs @@ -0,0 +1,9 @@ +using UnityEditor; + +namespace NaughtyAttributes.Editor +{ + public abstract class PropertyMeta + { + public abstract void ApplyPropertyMeta(SerializedProperty property, MetaAttribute metaAttribute); + } +} diff --git a/LocalPackages/net.peeweek.gameplay-ingredients/NaughtyAttributes/Editor/PropertyMetas/PropertyMeta.cs.meta b/LocalPackages/net.peeweek.gameplay-ingredients/NaughtyAttributes/Editor/PropertyMetas/PropertyMeta.cs.meta new file mode 100644 index 0000000..831ab49 --- /dev/null +++ b/LocalPackages/net.peeweek.gameplay-ingredients/NaughtyAttributes/Editor/PropertyMetas/PropertyMeta.cs.meta @@ -0,0 +1,13 @@ +fileFormatVersion: 2 +guid: 87cd72b1f8ad36840a07e1128f77ec5b +timeCreated: 1508497398 +licenseType: Free +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/LocalPackages/net.peeweek.gameplay-ingredients/NaughtyAttributes/Editor/PropertyValidators.meta b/LocalPackages/net.peeweek.gameplay-ingredients/NaughtyAttributes/Editor/PropertyValidators.meta new file mode 100644 index 0000000..6713dc9 --- /dev/null +++ b/LocalPackages/net.peeweek.gameplay-ingredients/NaughtyAttributes/Editor/PropertyValidators.meta @@ -0,0 +1,10 @@ +fileFormatVersion: 2 +guid: efd539f7816167541ba63e633f2a9a7c +folderAsset: yes +timeCreated: 1508153828 +licenseType: Free +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/LocalPackages/net.peeweek.gameplay-ingredients/NaughtyAttributes/Editor/PropertyValidators/MaxValuePropertyValidator.cs b/LocalPackages/net.peeweek.gameplay-ingredients/NaughtyAttributes/Editor/PropertyValidators/MaxValuePropertyValidator.cs new file mode 100644 index 0000000..454313f --- /dev/null +++ b/LocalPackages/net.peeweek.gameplay-ingredients/NaughtyAttributes/Editor/PropertyValidators/MaxValuePropertyValidator.cs @@ -0,0 +1,33 @@ +using UnityEditor; + +namespace NaughtyAttributes.Editor +{ + [PropertyValidator(typeof(MaxValueAttribute))] + public class MaxValuePropertyValidator : PropertyValidator + { + public override void ValidateProperty(SerializedProperty property) + { + MaxValueAttribute maxValueAttribute = PropertyUtility.GetAttribute(property); + + if (property.propertyType == SerializedPropertyType.Integer) + { + if (property.intValue > maxValueAttribute.MaxValue) + { + property.intValue = (int)maxValueAttribute.MaxValue; + } + } + else if (property.propertyType == SerializedPropertyType.Float) + { + if (property.floatValue > maxValueAttribute.MaxValue) + { + property.floatValue = maxValueAttribute.MaxValue; + } + } + else + { + string warning = maxValueAttribute.GetType().Name + " can be used only on int or float fields"; + EditorDrawUtility.DrawHelpBox(warning, MessageType.Warning, context: PropertyUtility.GetTargetObject(property)); + } + } + } +} diff --git a/LocalPackages/net.peeweek.gameplay-ingredients/NaughtyAttributes/Editor/PropertyValidators/MaxValuePropertyValidator.cs.meta b/LocalPackages/net.peeweek.gameplay-ingredients/NaughtyAttributes/Editor/PropertyValidators/MaxValuePropertyValidator.cs.meta new file mode 100644 index 0000000..a11c91a --- /dev/null +++ b/LocalPackages/net.peeweek.gameplay-ingredients/NaughtyAttributes/Editor/PropertyValidators/MaxValuePropertyValidator.cs.meta @@ -0,0 +1,13 @@ +fileFormatVersion: 2 +guid: 84ddaea11c76b9c4f9a0b56dbab25b4c +timeCreated: 1508153828 +licenseType: Free +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/LocalPackages/net.peeweek.gameplay-ingredients/NaughtyAttributes/Editor/PropertyValidators/MinValuePropertyValidator.cs b/LocalPackages/net.peeweek.gameplay-ingredients/NaughtyAttributes/Editor/PropertyValidators/MinValuePropertyValidator.cs new file mode 100644 index 0000000..30a80b1 --- /dev/null +++ b/LocalPackages/net.peeweek.gameplay-ingredients/NaughtyAttributes/Editor/PropertyValidators/MinValuePropertyValidator.cs @@ -0,0 +1,33 @@ +using UnityEditor; + +namespace NaughtyAttributes.Editor +{ + [PropertyValidator(typeof(MinValueAttribute))] + public class MinValuePropertyValidator : PropertyValidator + { + public override void ValidateProperty(SerializedProperty property) + { + MinValueAttribute minValueAttribute = PropertyUtility.GetAttribute(property); + + if (property.propertyType == SerializedPropertyType.Integer) + { + if (property.intValue < minValueAttribute.MinValue) + { + property.intValue = (int)minValueAttribute.MinValue; + } + } + else if (property.propertyType == SerializedPropertyType.Float) + { + if (property.floatValue < minValueAttribute.MinValue) + { + property.floatValue = minValueAttribute.MinValue; + } + } + else + { + string warning = minValueAttribute.GetType().Name + " can be used only on int or float fields"; + EditorDrawUtility.DrawHelpBox(warning, MessageType.Warning, context: PropertyUtility.GetTargetObject(property)); + } + } + } +} diff --git a/LocalPackages/net.peeweek.gameplay-ingredients/NaughtyAttributes/Editor/PropertyValidators/MinValuePropertyValidator.cs.meta b/LocalPackages/net.peeweek.gameplay-ingredients/NaughtyAttributes/Editor/PropertyValidators/MinValuePropertyValidator.cs.meta new file mode 100644 index 0000000..929ac89 --- /dev/null +++ b/LocalPackages/net.peeweek.gameplay-ingredients/NaughtyAttributes/Editor/PropertyValidators/MinValuePropertyValidator.cs.meta @@ -0,0 +1,13 @@ +fileFormatVersion: 2 +guid: 68add38e187dd154889b1e3b13247621 +timeCreated: 1508153828 +licenseType: Free +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/LocalPackages/net.peeweek.gameplay-ingredients/NaughtyAttributes/Editor/PropertyValidators/PropertyValidator.cs b/LocalPackages/net.peeweek.gameplay-ingredients/NaughtyAttributes/Editor/PropertyValidators/PropertyValidator.cs new file mode 100644 index 0000000..c7380ea --- /dev/null +++ b/LocalPackages/net.peeweek.gameplay-ingredients/NaughtyAttributes/Editor/PropertyValidators/PropertyValidator.cs @@ -0,0 +1,9 @@ +using UnityEditor; + +namespace NaughtyAttributes.Editor +{ + public abstract class PropertyValidator + { + public abstract void ValidateProperty(SerializedProperty property); + } +} diff --git a/LocalPackages/net.peeweek.gameplay-ingredients/NaughtyAttributes/Editor/PropertyValidators/PropertyValidator.cs.meta b/LocalPackages/net.peeweek.gameplay-ingredients/NaughtyAttributes/Editor/PropertyValidators/PropertyValidator.cs.meta new file mode 100644 index 0000000..56aca33 --- /dev/null +++ b/LocalPackages/net.peeweek.gameplay-ingredients/NaughtyAttributes/Editor/PropertyValidators/PropertyValidator.cs.meta @@ -0,0 +1,13 @@ +fileFormatVersion: 2 +guid: 73502d09058a2e344a1eb20859d29203 +timeCreated: 1508153828 +licenseType: Free +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/LocalPackages/net.peeweek.gameplay-ingredients/NaughtyAttributes/Editor/PropertyValidators/RequiredPropertyValidator.cs b/LocalPackages/net.peeweek.gameplay-ingredients/NaughtyAttributes/Editor/PropertyValidators/RequiredPropertyValidator.cs new file mode 100644 index 0000000..5f16c6e --- /dev/null +++ b/LocalPackages/net.peeweek.gameplay-ingredients/NaughtyAttributes/Editor/PropertyValidators/RequiredPropertyValidator.cs @@ -0,0 +1,32 @@ +using UnityEditor; + +namespace NaughtyAttributes.Editor +{ + [PropertyValidator(typeof(RequiredAttribute))] + public class RequiredPropertyValidator : PropertyValidator + { + public override void ValidateProperty(SerializedProperty property) + { + RequiredAttribute requiredAttribute = PropertyUtility.GetAttribute(property); + + if (property.propertyType == SerializedPropertyType.ObjectReference) + { + if (property.objectReferenceValue == null) + { + string errorMessage = property.name + " is required"; + if (!string.IsNullOrEmpty(requiredAttribute.Message)) + { + errorMessage = requiredAttribute.Message; + } + + EditorDrawUtility.DrawHelpBox(errorMessage, MessageType.Error, context: PropertyUtility.GetTargetObject(property)); + } + } + else + { + string warning = requiredAttribute.GetType().Name + " works only on reference types"; + EditorDrawUtility.DrawHelpBox(warning, MessageType.Warning, context: PropertyUtility.GetTargetObject(property)); + } + } + } +} diff --git a/LocalPackages/net.peeweek.gameplay-ingredients/NaughtyAttributes/Editor/PropertyValidators/RequiredPropertyValidator.cs.meta b/LocalPackages/net.peeweek.gameplay-ingredients/NaughtyAttributes/Editor/PropertyValidators/RequiredPropertyValidator.cs.meta new file mode 100644 index 0000000..239c36c --- /dev/null +++ b/LocalPackages/net.peeweek.gameplay-ingredients/NaughtyAttributes/Editor/PropertyValidators/RequiredPropertyValidator.cs.meta @@ -0,0 +1,13 @@ +fileFormatVersion: 2 +guid: 0675503782f800d4081737a5e41f9bf5 +timeCreated: 1508655546 +licenseType: Free +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/LocalPackages/net.peeweek.gameplay-ingredients/NaughtyAttributes/Editor/PropertyValidators/ValidateInputPropertyValidator.cs b/LocalPackages/net.peeweek.gameplay-ingredients/NaughtyAttributes/Editor/PropertyValidators/ValidateInputPropertyValidator.cs new file mode 100644 index 0000000..1113ef1 --- /dev/null +++ b/LocalPackages/net.peeweek.gameplay-ingredients/NaughtyAttributes/Editor/PropertyValidators/ValidateInputPropertyValidator.cs @@ -0,0 +1,55 @@ +using System; +using System.Reflection; +using UnityEditor; + +namespace NaughtyAttributes.Editor +{ + [PropertyValidator(typeof(ValidateInputAttribute))] + public class ValidateInputPropertyValidator : PropertyValidator + { + public override void ValidateProperty(SerializedProperty property) + { + ValidateInputAttribute validateInputAttribute = PropertyUtility.GetAttribute(property); + UnityEngine.Object target = PropertyUtility.GetTargetObject(property); + + MethodInfo validationCallback = ReflectionUtility.GetMethod(target, validateInputAttribute.CallbackName); + + if (validationCallback != null && + validationCallback.ReturnType == typeof(bool) && + validationCallback.GetParameters().Length == 1) + { + FieldInfo fieldInfo = ReflectionUtility.GetField(target, property.name); + Type fieldType = fieldInfo.FieldType; + Type parameterType = validationCallback.GetParameters()[0].ParameterType; + + if (fieldType == parameterType) + { + if (!(bool)validationCallback.Invoke(target, new object[] { fieldInfo.GetValue(target) })) + { + if (string.IsNullOrEmpty(validateInputAttribute.Message)) + { + EditorDrawUtility.DrawHelpBox(property.name + " is not valid", MessageType.Error, context: target); + } + else + { + EditorDrawUtility.DrawHelpBox(validateInputAttribute.Message, MessageType.Error, context: target); + } + } + } + else + { + string warning = "The field type is not the same as the callback's parameter type"; + EditorDrawUtility.DrawHelpBox(warning, MessageType.Warning, context: target); + } + } + else + { + string warning = + validateInputAttribute.GetType().Name + + " needs a callback with boolean return type and a single parameter of the same type as the field"; + + EditorDrawUtility.DrawHelpBox(warning, MessageType.Warning, context: target); + } + } + } +} diff --git a/LocalPackages/net.peeweek.gameplay-ingredients/NaughtyAttributes/Editor/PropertyValidators/ValidateInputPropertyValidator.cs.meta b/LocalPackages/net.peeweek.gameplay-ingredients/NaughtyAttributes/Editor/PropertyValidators/ValidateInputPropertyValidator.cs.meta new file mode 100644 index 0000000..fb4a666 --- /dev/null +++ b/LocalPackages/net.peeweek.gameplay-ingredients/NaughtyAttributes/Editor/PropertyValidators/ValidateInputPropertyValidator.cs.meta @@ -0,0 +1,13 @@ +fileFormatVersion: 2 +guid: 9b7357cef1466544aac67a1976ad9a18 +timeCreated: 1508657795 +licenseType: Free +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/LocalPackages/net.peeweek.gameplay-ingredients/NaughtyAttributes/Editor/Utility.meta b/LocalPackages/net.peeweek.gameplay-ingredients/NaughtyAttributes/Editor/Utility.meta new file mode 100644 index 0000000..ed16edd --- /dev/null +++ b/LocalPackages/net.peeweek.gameplay-ingredients/NaughtyAttributes/Editor/Utility.meta @@ -0,0 +1,10 @@ +fileFormatVersion: 2 +guid: acb4475c71a3fe947a81ced84ab89c6d +folderAsset: yes +timeCreated: 1508062761 +licenseType: Free +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/LocalPackages/net.peeweek.gameplay-ingredients/NaughtyAttributes/Editor/Utility/EditorDrawUtility.cs b/LocalPackages/net.peeweek.gameplay-ingredients/NaughtyAttributes/Editor/Utility/EditorDrawUtility.cs new file mode 100644 index 0000000..5532461 --- /dev/null +++ b/LocalPackages/net.peeweek.gameplay-ingredients/NaughtyAttributes/Editor/Utility/EditorDrawUtility.cs @@ -0,0 +1,123 @@ +using UnityEngine; +using UnityEditor; +using System; + +namespace NaughtyAttributes.Editor +{ + public static class EditorDrawUtility + { + public static void DrawHeader(string header) + { + EditorGUILayout.Space(); + EditorGUILayout.LabelField(header, EditorStyles.boldLabel); + } + + public static bool DrawHeader(SerializedProperty property) + { + HeaderAttribute headerAttr = PropertyUtility.GetAttribute(property); + if (headerAttr != null) + { + DrawHeader(headerAttr.header); + return true; + } + + return false; + } + + public static void DrawHelpBox(string message, MessageType type, UnityEngine.Object context = null, bool logToConsole = true) + { + EditorGUILayout.HelpBox(message, type); + + if (logToConsole) + { + switch (type) + { + case MessageType.None: + case MessageType.Info: + Debug.Log(message, context); + break; + case MessageType.Warning: + Debug.LogWarning(message, context); + break; + case MessageType.Error: + Debug.LogError(message, context); + break; + } + } + } + + public static void DrawPropertyField(SerializedProperty property, bool includeChildren = true) + { + EditorGUILayout.PropertyField(property, includeChildren); + } + + public static bool DrawLayoutField(object value, string label) + { + GUI.enabled = false; + + bool isDrawn = true; + Type valueType = value.GetType(); + + if (valueType == typeof(bool)) + { + EditorGUILayout.Toggle(label, (bool)value); + } + else if (valueType == typeof(int)) + { + EditorGUILayout.IntField(label, (int)value); + } + else if (valueType == typeof(long)) + { + EditorGUILayout.LongField(label, (long)value); + } + else if (valueType == typeof(float)) + { + EditorGUILayout.FloatField(label, (float)value); + } + else if (valueType == typeof(double)) + { + EditorGUILayout.DoubleField(label, (double)value); + } + else if (valueType == typeof(string)) + { + EditorGUILayout.TextField(label, (string)value); + } + else if (valueType == typeof(Vector2)) + { + EditorGUILayout.Vector2Field(label, (Vector2)value); + } + else if (valueType == typeof(Vector3)) + { + EditorGUILayout.Vector3Field(label, (Vector3)value); + } + else if (valueType == typeof(Vector4)) + { + EditorGUILayout.Vector4Field(label, (Vector4)value); + } + else if (valueType == typeof(Color)) + { + EditorGUILayout.ColorField(label, (Color)value); + } + else if (valueType == typeof(Bounds)) + { + EditorGUILayout.BoundsField(label, (Bounds)value); + } + else if (valueType == typeof(Rect)) + { + EditorGUILayout.RectField(label, (Rect)value); + } + else if (typeof(UnityEngine.Object).IsAssignableFrom(valueType)) + { + EditorGUILayout.ObjectField(label, (UnityEngine.Object)value, valueType, true); + } + else + { + isDrawn = false; + } + + GUI.enabled = true; + + return isDrawn; + } + } +} diff --git a/LocalPackages/net.peeweek.gameplay-ingredients/NaughtyAttributes/Editor/Utility/EditorDrawUtility.cs.meta b/LocalPackages/net.peeweek.gameplay-ingredients/NaughtyAttributes/Editor/Utility/EditorDrawUtility.cs.meta new file mode 100644 index 0000000..704d3e5 --- /dev/null +++ b/LocalPackages/net.peeweek.gameplay-ingredients/NaughtyAttributes/Editor/Utility/EditorDrawUtility.cs.meta @@ -0,0 +1,13 @@ +fileFormatVersion: 2 +guid: 6ff27ff7705d6064e935bb2159a1b453 +timeCreated: 1510926159 +licenseType: Free +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/LocalPackages/net.peeweek.gameplay-ingredients/NaughtyAttributes/Editor/Utility/IOUtility.cs b/LocalPackages/net.peeweek.gameplay-ingredients/NaughtyAttributes/Editor/Utility/IOUtility.cs new file mode 100644 index 0000000..9872765 --- /dev/null +++ b/LocalPackages/net.peeweek.gameplay-ingredients/NaughtyAttributes/Editor/Utility/IOUtility.cs @@ -0,0 +1,49 @@ +using UnityEngine; +using System.IO; + +namespace NaughtyAttributes.Editor +{ + public static class IOUtility + { + public static string GetPersistentDataPath() + { + return Application.persistentDataPath + "/"; + } + + public static void WriteToFile(string filePath, string content) + { + using (FileStream fileStream = new FileStream(filePath, FileMode.Create, FileAccess.Write)) + { + using (StreamWriter streamWriter = new StreamWriter(fileStream, System.Text.Encoding.ASCII)) + { + streamWriter.WriteLine(content); + } + } + } + + public static string ReadFromFile(string filePath) + { + using (FileStream fileStream = new FileStream(filePath, FileMode.Open, FileAccess.Read)) + { + using (StreamReader streamReader = new StreamReader(fileStream, System.Text.Encoding.ASCII)) + { + string content = streamReader.ReadToEnd(); + return content; + } + } + } + + public static bool FileExists(string filePath) + { + return File.Exists(filePath); + } + + public static string GetPathRelativeToProjectFolder(string fullPath) + { + int indexOfAssetsWord = fullPath.IndexOf("\\Assets"); + string relativePath = fullPath.Substring(indexOfAssetsWord + 1); + + return relativePath; + } + } +} diff --git a/LocalPackages/net.peeweek.gameplay-ingredients/NaughtyAttributes/Editor/Utility/IOUtility.cs.meta b/LocalPackages/net.peeweek.gameplay-ingredients/NaughtyAttributes/Editor/Utility/IOUtility.cs.meta new file mode 100644 index 0000000..e8ab56a --- /dev/null +++ b/LocalPackages/net.peeweek.gameplay-ingredients/NaughtyAttributes/Editor/Utility/IOUtility.cs.meta @@ -0,0 +1,13 @@ +fileFormatVersion: 2 +guid: bf376371b2951274e823154c03f066e2 +timeCreated: 1508232215 +licenseType: Free +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/LocalPackages/net.peeweek.gameplay-ingredients/NaughtyAttributes/Editor/Utility/PropertyUtility.cs b/LocalPackages/net.peeweek.gameplay-ingredients/NaughtyAttributes/Editor/Utility/PropertyUtility.cs new file mode 100644 index 0000000..fa8051c --- /dev/null +++ b/LocalPackages/net.peeweek.gameplay-ingredients/NaughtyAttributes/Editor/Utility/PropertyUtility.cs @@ -0,0 +1,27 @@ +using UnityEditor; +using System; +using System.Reflection; + +namespace NaughtyAttributes.Editor +{ + public static class PropertyUtility + { + public static T GetAttribute(SerializedProperty property) where T : Attribute + { + T[] attributes = GetAttributes(property); + return attributes.Length > 0 ? attributes[0] : null; + } + + public static T[] GetAttributes(SerializedProperty property) where T : Attribute + { + FieldInfo fieldInfo = ReflectionUtility.GetField(GetTargetObject(property), property.name); + + return (T[])fieldInfo.GetCustomAttributes(typeof(T), true); + } + + public static UnityEngine.Object GetTargetObject(SerializedProperty property) + { + return property.serializedObject.targetObject; + } + } +} diff --git a/LocalPackages/net.peeweek.gameplay-ingredients/NaughtyAttributes/Editor/Utility/PropertyUtility.cs.meta b/LocalPackages/net.peeweek.gameplay-ingredients/NaughtyAttributes/Editor/Utility/PropertyUtility.cs.meta new file mode 100644 index 0000000..fad8d5b --- /dev/null +++ b/LocalPackages/net.peeweek.gameplay-ingredients/NaughtyAttributes/Editor/Utility/PropertyUtility.cs.meta @@ -0,0 +1,13 @@ +fileFormatVersion: 2 +guid: e2d50a3c7c8a9754cb3936216494be66 +timeCreated: 1508153828 +licenseType: Free +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/LocalPackages/net.peeweek.gameplay-ingredients/NaughtyAttributes/Editor/Utility/ReflectionUtility.cs b/LocalPackages/net.peeweek.gameplay-ingredients/NaughtyAttributes/Editor/Utility/ReflectionUtility.cs new file mode 100644 index 0000000..f1df8a4 --- /dev/null +++ b/LocalPackages/net.peeweek.gameplay-ingredients/NaughtyAttributes/Editor/Utility/ReflectionUtility.cs @@ -0,0 +1,84 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Reflection; + +namespace NaughtyAttributes.Editor +{ + public static class ReflectionUtility + { + public static IEnumerable GetAllFields(object target, Func predicate) + { + List types = new List() + { + target.GetType() + }; + + while (types.Last().BaseType != null) + { + types.Add(types.Last().BaseType); + } + + for (int i = types.Count - 1; i >= 0; i--) + { + IEnumerable fieldInfos = types[i] + .GetFields(BindingFlags.Instance | BindingFlags.Static | BindingFlags.NonPublic | BindingFlags.Public | BindingFlags.DeclaredOnly) + .Where(predicate); + + foreach (var fieldInfo in fieldInfos) + { + yield return fieldInfo; + } + } + } + + public static IEnumerable GetAllProperties(object target, Func predicate) + { + List types = new List() + { + target.GetType() + }; + + while (types.Last().BaseType != null) + { + types.Add(types.Last().BaseType); + } + + for (int i = types.Count - 1; i >= 0; i--) + { + IEnumerable propertyInfos = types[i] + .GetProperties(BindingFlags.Instance | BindingFlags.Static | BindingFlags.NonPublic | BindingFlags.Public | BindingFlags.DeclaredOnly) + .Where(predicate); + + foreach (var propertyInfo in propertyInfos) + { + yield return propertyInfo; + } + } + } + + public static IEnumerable GetAllMethods(object target, Func predicate) + { + IEnumerable methodInfos = target.GetType() + .GetMethods(BindingFlags.Instance | BindingFlags.Static | BindingFlags.NonPublic | BindingFlags.Public) + .Where(predicate); + + return methodInfos; + } + + public static FieldInfo GetField(object target, string fieldName) + { + return GetAllFields(target, f => f.Name.Equals(fieldName, StringComparison.InvariantCulture)).FirstOrDefault(); + } + + public static PropertyInfo GetProperty(object target, string propertyName) + { + return GetAllProperties(target, p => p.Name.Equals(propertyName, StringComparison.InvariantCulture)).FirstOrDefault(); + } + + public static MethodInfo GetMethod(object target, string methodName) + { + return GetAllMethods(target, m => m.Name.Equals(methodName, StringComparison.InvariantCulture)).FirstOrDefault(); + } + } +} diff --git a/LocalPackages/net.peeweek.gameplay-ingredients/NaughtyAttributes/Editor/Utility/ReflectionUtility.cs.meta b/LocalPackages/net.peeweek.gameplay-ingredients/NaughtyAttributes/Editor/Utility/ReflectionUtility.cs.meta new file mode 100644 index 0000000..73b6ea9 --- /dev/null +++ b/LocalPackages/net.peeweek.gameplay-ingredients/NaughtyAttributes/Editor/Utility/ReflectionUtility.cs.meta @@ -0,0 +1,13 @@ +fileFormatVersion: 2 +guid: 1d86c581f02a55f458e36bf7e81e3084 +timeCreated: 1520258793 +licenseType: Free +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/LocalPackages/net.peeweek.gameplay-ingredients/NaughtyAttributes/LICENSE b/LocalPackages/net.peeweek.gameplay-ingredients/NaughtyAttributes/LICENSE new file mode 100644 index 0000000..65b7986 --- /dev/null +++ b/LocalPackages/net.peeweek.gameplay-ingredients/NaughtyAttributes/LICENSE @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) 2017 Denis Rizov + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/LocalPackages/net.peeweek.gameplay-ingredients/NaughtyAttributes/LICENSE.meta b/LocalPackages/net.peeweek.gameplay-ingredients/NaughtyAttributes/LICENSE.meta new file mode 100644 index 0000000..1b025d6 --- /dev/null +++ b/LocalPackages/net.peeweek.gameplay-ingredients/NaughtyAttributes/LICENSE.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: 7546e684e809e5f4a852e3cc8591f250 +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/LocalPackages/net.peeweek.gameplay-ingredients/README.md b/LocalPackages/net.peeweek.gameplay-ingredients/README.md new file mode 100644 index 0000000..abd1d20 --- /dev/null +++ b/LocalPackages/net.peeweek.gameplay-ingredients/README.md @@ -0,0 +1,43 @@ +![](https://raw.githubusercontent.com/peeweek/net.peeweek.gameplay-ingredients/master/Documentation%7E/Images/site-banner.png) + +Gameplay Ingredients for your Unity Games - A collection of scripts that ease simple tasks while making games and prototypes. + +You can read Documentation at this address : [https://peeweek.readthedocs.io/en/latest/gameplay-ingredients/](https://peeweek.readthedocs.io/en/latest/gameplay-ingredients/) + +## Requirements + +* **Unity 2019.3** (Older versions compatible with 2018.3 / 2019.1 / 2019.2) +* Package Manager UI +* (**Optional** : Command-line Git installed on your system, for example [Git For Windows](https://gitforwindows.org/)) + +## How to install + +You can use a manual, local package installation if you need to alter the code locally or update the code base regularly. + +Otherwise, you can perform a git referenced package in your `manifset.json` file : this option shall download and manage automatically the repository, with the drawback of being read-only. + +### Manual Version + +- Clone this repository somewhere of your liking +- In your project, open the `Window/Package Manager` window and use the + button to select the `Add Package from Disk...` option. +- Navigate to your repository folder and select the `package.json` file +- The package shall be added as a **local package** + +### Git reference version + +- Ensure you have a **[Command Line Git](https://gitforwindows.org/) Installed** +- With Unity 2019.3 closed, edit the `Packages/manifest.json` with a text editor +- Append the line ` "net.peeweek.gameplay-ingredients": "https://github.com/peeweek/net.peeweek.gameplay-ingredients.git#2019.3.0",` under `dependencies` + +You can check that the package was imported by looking at the project window, under Packages/ Hierarchy, there should be a `Gameplay Ingredients` hierarchy + +# Version / Tag Compatibility + +Gameplay Ingredients comes at latest version with the following compatibility: + +**Unity 2019.3** : clone and check out the `master` branch at the tag `2019.3.1` + +#### Older Versions + +* **Unity 2018.3 / 2018.4 :** choose the tag `2018.3.0` +* **Unity 2019.1 / 2019.2 :** choose the tag `2019.1.2` diff --git a/LocalPackages/net.peeweek.gameplay-ingredients/README.md.meta b/LocalPackages/net.peeweek.gameplay-ingredients/README.md.meta new file mode 100644 index 0000000..4d3b041 --- /dev/null +++ b/LocalPackages/net.peeweek.gameplay-ingredients/README.md.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: b1565dfac550b7e41a3aced8a4474ff8 +TextScriptImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/LocalPackages/net.peeweek.gameplay-ingredients/Resources.meta b/LocalPackages/net.peeweek.gameplay-ingredients/Resources.meta new file mode 100644 index 0000000..4473c15 --- /dev/null +++ b/LocalPackages/net.peeweek.gameplay-ingredients/Resources.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 8e4403a0e35a0e04fb99db890fa183d3 +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/LocalPackages/net.peeweek.gameplay-ingredients/Resources/Default_FullScreenFadeManager.prefab b/LocalPackages/net.peeweek.gameplay-ingredients/Resources/Default_FullScreenFadeManager.prefab new file mode 100644 index 0000000..19972bd --- /dev/null +++ b/LocalPackages/net.peeweek.gameplay-ingredients/Resources/Default_FullScreenFadeManager.prefab @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:a3cdf9da5d3c5dd1372ebdf8ada3a7c348d8c0ed9b095178642a95d9add3e0fd +size 6078 diff --git a/LocalPackages/net.peeweek.gameplay-ingredients/Resources/Default_FullScreenFadeManager.prefab.meta b/LocalPackages/net.peeweek.gameplay-ingredients/Resources/Default_FullScreenFadeManager.prefab.meta new file mode 100644 index 0000000..4b7ffe6 --- /dev/null +++ b/LocalPackages/net.peeweek.gameplay-ingredients/Resources/Default_FullScreenFadeManager.prefab.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: 7134ce259ccbdf048956ad46c0351336 +PrefabImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/LocalPackages/net.peeweek.gameplay-ingredients/Resources/Default_GameManager.prefab b/LocalPackages/net.peeweek.gameplay-ingredients/Resources/Default_GameManager.prefab new file mode 100644 index 0000000..5730d4d --- /dev/null +++ b/LocalPackages/net.peeweek.gameplay-ingredients/Resources/Default_GameManager.prefab @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:2924d9e2bd69831c493bd20c264b757853c7cf8556135266e41030f6b68ea5eb +size 1561 diff --git a/LocalPackages/net.peeweek.gameplay-ingredients/Resources/Default_GameManager.prefab.meta b/LocalPackages/net.peeweek.gameplay-ingredients/Resources/Default_GameManager.prefab.meta new file mode 100644 index 0000000..9d16a00 --- /dev/null +++ b/LocalPackages/net.peeweek.gameplay-ingredients/Resources/Default_GameManager.prefab.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: 93f4a0ce1f13ab746ad72f916440455b +PrefabImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/LocalPackages/net.peeweek.gameplay-ingredients/Resources/Default_GameSaveManager.prefab b/LocalPackages/net.peeweek.gameplay-ingredients/Resources/Default_GameSaveManager.prefab new file mode 100644 index 0000000..9cbdf94 --- /dev/null +++ b/LocalPackages/net.peeweek.gameplay-ingredients/Resources/Default_GameSaveManager.prefab @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:27bd64a9e702907e7f7334d9013055a3efb9284d0da93434dfb4c1638cc8955f +size 8006 diff --git a/LocalPackages/net.peeweek.gameplay-ingredients/Resources/Default_GameSaveManager.prefab.meta b/LocalPackages/net.peeweek.gameplay-ingredients/Resources/Default_GameSaveManager.prefab.meta new file mode 100644 index 0000000..27ffd31 --- /dev/null +++ b/LocalPackages/net.peeweek.gameplay-ingredients/Resources/Default_GameSaveManager.prefab.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: 5029b31b802e7244287466485f911326 +PrefabImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/LocalPackages/net.peeweek.gameplay-ingredients/Resources/Default_LevelStreamingManager.prefab b/LocalPackages/net.peeweek.gameplay-ingredients/Resources/Default_LevelStreamingManager.prefab new file mode 100644 index 0000000..a0b65e2 --- /dev/null +++ b/LocalPackages/net.peeweek.gameplay-ingredients/Resources/Default_LevelStreamingManager.prefab @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:38b590ee242b4b18d2afc6d74ec3f280149d0f2f4eb3992f013792fd6e3c5087 +size 18529 diff --git a/LocalPackages/net.peeweek.gameplay-ingredients/Resources/Default_LevelStreamingManager.prefab.meta b/LocalPackages/net.peeweek.gameplay-ingredients/Resources/Default_LevelStreamingManager.prefab.meta new file mode 100644 index 0000000..dec595e --- /dev/null +++ b/LocalPackages/net.peeweek.gameplay-ingredients/Resources/Default_LevelStreamingManager.prefab.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: 38e03acd46f707f41bea470a5525d3ee +PrefabImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/LocalPackages/net.peeweek.gameplay-ingredients/Resources/Default_ScreenshotManager.prefab b/LocalPackages/net.peeweek.gameplay-ingredients/Resources/Default_ScreenshotManager.prefab new file mode 100644 index 0000000..a1ffae8 --- /dev/null +++ b/LocalPackages/net.peeweek.gameplay-ingredients/Resources/Default_ScreenshotManager.prefab @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:f88b2698585b711e4d61b106c0c45acfcd02b3f0af5e4c4f487dc9f8de9e75b8 +size 1465 diff --git a/LocalPackages/net.peeweek.gameplay-ingredients/Resources/Default_ScreenshotManager.prefab.meta b/LocalPackages/net.peeweek.gameplay-ingredients/Resources/Default_ScreenshotManager.prefab.meta new file mode 100644 index 0000000..734554c --- /dev/null +++ b/LocalPackages/net.peeweek.gameplay-ingredients/Resources/Default_ScreenshotManager.prefab.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: d5d0f799eba3c5247b17338b1be98808 +PrefabImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/LocalPackages/net.peeweek.gameplay-ingredients/Resources/Default_UIEventManager.prefab b/LocalPackages/net.peeweek.gameplay-ingredients/Resources/Default_UIEventManager.prefab new file mode 100644 index 0000000..8d0ca01 --- /dev/null +++ b/LocalPackages/net.peeweek.gameplay-ingredients/Resources/Default_UIEventManager.prefab @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:cc32e044acc9ae1310e45c7235eb67461c1cad1d98f0568e6fa6a286f3179855 +size 2559 diff --git a/LocalPackages/net.peeweek.gameplay-ingredients/Resources/Default_UIEventManager.prefab.meta b/LocalPackages/net.peeweek.gameplay-ingredients/Resources/Default_UIEventManager.prefab.meta new file mode 100644 index 0000000..626e0b2 --- /dev/null +++ b/LocalPackages/net.peeweek.gameplay-ingredients/Resources/Default_UIEventManager.prefab.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: 9d3c44d99bbcec1438463a3abcd3ee47 +PrefabImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/LocalPackages/net.peeweek.gameplay-ingredients/Resources/Default_VirtualCameraManager.prefab b/LocalPackages/net.peeweek.gameplay-ingredients/Resources/Default_VirtualCameraManager.prefab new file mode 100644 index 0000000..abf39db --- /dev/null +++ b/LocalPackages/net.peeweek.gameplay-ingredients/Resources/Default_VirtualCameraManager.prefab @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:4502554a31b1b1751224a771bf45871318f021b61a2e3023c0c9d1b8be6b09a2 +size 6758 diff --git a/LocalPackages/net.peeweek.gameplay-ingredients/Resources/Default_VirtualCameraManager.prefab.meta b/LocalPackages/net.peeweek.gameplay-ingredients/Resources/Default_VirtualCameraManager.prefab.meta new file mode 100644 index 0000000..0a8be77 --- /dev/null +++ b/LocalPackages/net.peeweek.gameplay-ingredients/Resources/Default_VirtualCameraManager.prefab.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: cbee0477b75dc50409223c54e13e1bbe +PrefabImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/LocalPackages/net.peeweek.gameplay-ingredients/Runtime/Actions/ActionBase.cs b/LocalPackages/net.peeweek.gameplay-ingredients/Runtime/Actions/ActionBase.cs deleted file mode 100644 index 5eae139..0000000 --- a/LocalPackages/net.peeweek.gameplay-ingredients/Runtime/Actions/ActionBase.cs +++ /dev/null @@ -1,9 +0,0 @@ -using UnityEngine; - -namespace GameplayIngredients.Actions -{ - public abstract class ActionBase : MonoBehaviour - { - public abstract void Execute(); - } -} diff --git a/LocalPackages/net.peeweek.gameplay-ingredients/Runtime/Actions/EditorOnlyAction.cs b/LocalPackages/net.peeweek.gameplay-ingredients/Runtime/Actions/EditorOnlyAction.cs deleted file mode 100644 index 3affb32..0000000 --- a/LocalPackages/net.peeweek.gameplay-ingredients/Runtime/Actions/EditorOnlyAction.cs +++ /dev/null @@ -1,31 +0,0 @@ -using UnityEngine; -using UnityEngine.Events; - -namespace GameplayIngredients.Actions -{ - public class EditorOnlyAction : ActionBase - { - public enum Mode - { - EditorOnly, - PlayerOnly - } - - public Mode ExecutionPath; - - public UnityEvent OnExecute; - - public override void Execute() - { - switch(ExecutionPath) - { - case Mode.EditorOnly: - if (Application.isEditor) OnExecute.Invoke(); - break; - case Mode.PlayerOnly: - if (!Application.isEditor) OnExecute.Invoke(); - break; - } - } - } -} diff --git a/LocalPackages/net.peeweek.gameplay-ingredients/Runtime/Actions/StreamingLevelAction.cs b/LocalPackages/net.peeweek.gameplay-ingredients/Runtime/Actions/StreamingLevelAction.cs deleted file mode 100644 index 6dde518..0000000 --- a/LocalPackages/net.peeweek.gameplay-ingredients/Runtime/Actions/StreamingLevelAction.cs +++ /dev/null @@ -1,22 +0,0 @@ -using UnityEngine.Events; -using GameplayIngredients.LevelStreaming; - -namespace GameplayIngredients.Actions -{ - public class StreamingLevelAction : ActionBase - { - public string[] Scenes; - public string SceneToActivate; - public LevelStreamingManager.StreamingAction Action = LevelStreamingManager.StreamingAction.Load; - - public bool ShowUI = false; - - public UnityEvent OnLoadComplete; - - public override void Execute() - { - LevelStreamingManager.instance.LoadScenes(Action, Scenes, SceneToActivate, ShowUI, OnLoadComplete); - } - } -} - diff --git a/LocalPackages/net.peeweek.gameplay-ingredients/Runtime/Controllers.meta b/LocalPackages/net.peeweek.gameplay-ingredients/Runtime/Controllers.meta new file mode 100644 index 0000000..ae8bff8 --- /dev/null +++ b/LocalPackages/net.peeweek.gameplay-ingredients/Runtime/Controllers.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: fe3adcbe3d5bae647b14b33f26888b39 +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/LocalPackages/net.peeweek.gameplay-ingredients/Runtime/Controllers/FirstPersonController.cs b/LocalPackages/net.peeweek.gameplay-ingredients/Runtime/Controllers/FirstPersonController.cs new file mode 100644 index 0000000..b9cb088 --- /dev/null +++ b/LocalPackages/net.peeweek.gameplay-ingredients/Runtime/Controllers/FirstPersonController.cs @@ -0,0 +1,125 @@ +using System.Collections; +using System.Collections.Generic; +using UnityEngine; + +namespace GameplayIngredients.Controllers +{ + [RequireComponent(typeof(CharacterController))] + public class FirstPersonController : MonoBehaviour + { + public bool Paused = false; + + [Header("Objects")] + [NonNullCheck] + public Transform m_Camera; + [NonNullCheck] + public PlayerInput m_Input; + + [Header("Metrics")] + [Range(1.0f, 2.5f)] + public float PlayerHeight = 1.82f; + [Range(0.35f, 2.0f)] + public float PlayerRadius = 0.5f; + public float PlayerWeight = 3.0f; + + [Header("Movement")] + [Range(0.0f, 12.5f)] + public float MoveSpeed = 3.0f; + public float MaximumFallVelocity = 12f; + public float TurnSpeed = 180; + + [Header("Jump")] + public bool EnableJump = true; + public float JumpImpulse = 7.0f; + + [Header("Look")] + public float PitchSpeed = 180; + public float MaxPitch = 80; + + private CharacterController m_Controller; + private float m_Fall = 0.0f; + private float m_Pitch = 0.0f; + private bool m_Grounded = false; + + public void Start() + { + m_Controller = GetComponent(); + } + + public void Update() + { + if (m_Camera == null) return; + if (m_Input == null) return; + + if (!Paused) + { + m_Input.UpdateInput(); + UpdateRotation(); + UpdatePlayerMovement(); + } + } + + public void SetPaused(bool paused) + { + Paused = paused; + } + + public void OnValidate() + { + float realHeight = PlayerHeight + PlayerRadius; + + var controller = GetComponent(); + var center = new Vector3(0, realHeight / 2, 0); + + if (controller.center != center) + controller.center = center; + + if (controller.height != realHeight) + controller.height = realHeight; + + if(controller.radius != PlayerRadius) + controller.radius = PlayerRadius; + + if(m_Camera != null) + m_Camera.transform.localPosition = new Vector3(0, PlayerHeight, 0); + } + + public void UpdateRotation() + { + m_Pitch = Mathf.Clamp(m_Pitch - (Time.deltaTime * PitchSpeed * m_Input.Look.y), -MaxPitch, MaxPitch); + m_Camera.transform.localEulerAngles = new Vector3(m_Pitch, 0, 0); + transform.Rotate(transform.up, Time.deltaTime * TurnSpeed * m_Input.Look.x); + } + + public void UpdatePlayerMovement() + { + Vector3 move = (transform.forward * m_Input.Movement.y + transform.right * m_Input.Movement.x) * MoveSpeed; + + m_Fall += PlayerWeight * 9.80665f * Time.deltaTime; + m_Fall = Mathf.Min(m_Fall, MaximumFallVelocity); + move += m_Fall * (-transform.up); + + if (m_Grounded) + { + if (EnableJump && m_Input.Jump == PlayerInput.ButtonState.JustPressed) + { + m_Fall = -JumpImpulse; + } + } + + m_Controller.Move(move * Time.deltaTime); + m_Grounded = m_Controller.isGrounded; + } + + public void SetPlayerHeight(float value) + { + PlayerHeight = value; + OnValidate(); + } + + public void SetMoveSpeed(float value) + { + MoveSpeed = value; + } + } +} diff --git a/LocalPackages/net.peeweek.gameplay-ingredients/Runtime/Controllers/FirstPersonController.cs.meta b/LocalPackages/net.peeweek.gameplay-ingredients/Runtime/Controllers/FirstPersonController.cs.meta new file mode 100644 index 0000000..a264d72 --- /dev/null +++ b/LocalPackages/net.peeweek.gameplay-ingredients/Runtime/Controllers/FirstPersonController.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: a343570c5b9740b45b62e566abd743cc +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {fileID: 2800000, guid: fe8c9f947e3d1e445a7d3d3c5a1a18ee, type: 3} + userData: + assetBundleName: + assetBundleVariant: diff --git a/LocalPackages/net.peeweek.gameplay-ingredients/Runtime/Controllers/KeyboardGamepadPlayerInput.cs b/LocalPackages/net.peeweek.gameplay-ingredients/Runtime/Controllers/KeyboardGamepadPlayerInput.cs new file mode 100644 index 0000000..6b0fb52 --- /dev/null +++ b/LocalPackages/net.peeweek.gameplay-ingredients/Runtime/Controllers/KeyboardGamepadPlayerInput.cs @@ -0,0 +1,66 @@ +using System.Collections; +using System.Collections.Generic; +using UnityEngine; + +namespace GameplayIngredients.Controllers +{ + public class KeyboardGamepadPlayerInput : PlayerInput + { + public bool useKeyboardAndMouse { get; set; } = true; + public bool useGamepad { get; set; } = true; + + [Header("Behaviour")] + public float LookExponent = 2.0f; + [Range(0.0f, 0.7f)] + public float MovementDeadZone = 0.15f; + [Range(0.0f, 0.7f)] + public float LookDeadZone = 0.15f; + + [Header("Gamepad Axes")] + public string MovementHorizontalAxis = "Horizontal"; + public string MovementVerticalAxis = "Vertical"; + public string LookHorizontalAxis = "Look X"; + public string LookVerticalAxis = "Look Y"; + + [Header("Mouse Axes")] + public string MouseHorizontalAxis = "Mouse X"; + public string MouseVerticalAxis = "Mouse Y"; + + [Header("Buttons")] + public string JumpButton = "Jump"; + + public override Vector2 Look => m_Look; + public override Vector2 Movement => m_Movement; + + public override ButtonState Jump => m_Jump; + + Vector2 m_Movement; + Vector2 m_Look; + + ButtonState m_Jump; + + public override void UpdateInput() + { + if(useGamepad || useKeyboardAndMouse) + { + m_Movement = new Vector2(Input.GetAxisRaw(MovementHorizontalAxis), Input.GetAxisRaw(MovementVerticalAxis)); + if (m_Movement.magnitude < MovementDeadZone) + m_Movement = Vector2.zero; + } + + m_Look = Vector2.zero; + if(useGamepad) + { + Vector2 l = new Vector2(Input.GetAxisRaw(LookHorizontalAxis), Input.GetAxisRaw(LookVerticalAxis)); + Vector2 ln = l.normalized; + float lm = Mathf.Clamp01(l.magnitude); + m_Look += ln * Mathf.Pow(Mathf.Clamp01(lm - LookDeadZone) / (1.0f - LookDeadZone), LookExponent); + } + + if(useKeyboardAndMouse) + m_Look += new Vector2(Input.GetAxisRaw(MouseHorizontalAxis), Input.GetAxisRaw(MouseVerticalAxis)); + + m_Jump = GetButtonState(JumpButton); + } + } +} diff --git a/LocalPackages/net.peeweek.gameplay-ingredients/Runtime/Controllers/KeyboardGamepadPlayerInput.cs.meta b/LocalPackages/net.peeweek.gameplay-ingredients/Runtime/Controllers/KeyboardGamepadPlayerInput.cs.meta new file mode 100644 index 0000000..3c16506 --- /dev/null +++ b/LocalPackages/net.peeweek.gameplay-ingredients/Runtime/Controllers/KeyboardGamepadPlayerInput.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 0cfde70461151044393814cb1c21024b +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {fileID: 2800000, guid: e691dbed38cbd76419e26c8e74c37c18, type: 3} + userData: + assetBundleName: + assetBundleVariant: diff --git a/LocalPackages/net.peeweek.gameplay-ingredients/Runtime/Controllers/PlayerInput.cs b/LocalPackages/net.peeweek.gameplay-ingredients/Runtime/Controllers/PlayerInput.cs new file mode 100644 index 0000000..1b6b10d --- /dev/null +++ b/LocalPackages/net.peeweek.gameplay-ingredients/Runtime/Controllers/PlayerInput.cs @@ -0,0 +1,42 @@ +using System.Collections; +using System.Collections.Generic; +using UnityEngine; + +namespace GameplayIngredients.Controllers +{ + public abstract class PlayerInput : MonoBehaviour + { + public enum ButtonState + { + Released = 0, + JustPressed = 1, + Pressed = 2, + JustReleased = 3 + } + + public abstract Vector2 Look { get; } + public abstract Vector2 Movement { get; } + public abstract ButtonState Jump { get; } + + public abstract void UpdateInput(); + + protected static ButtonState GetButtonState(string Button) + { + if (Input.GetButton(Button)) + { + if (Input.GetButtonDown(Button)) + return ButtonState.JustPressed; + else + return ButtonState.Pressed; + } + else + { + if (Input.GetButtonUp(Button)) + return ButtonState.JustReleased; + else + return ButtonState.Released; + + } + } + } +} diff --git a/LocalPackages/net.peeweek.gameplay-ingredients/Runtime/Controllers/PlayerInput.cs.meta b/LocalPackages/net.peeweek.gameplay-ingredients/Runtime/Controllers/PlayerInput.cs.meta new file mode 100644 index 0000000..e286c38 --- /dev/null +++ b/LocalPackages/net.peeweek.gameplay-ingredients/Runtime/Controllers/PlayerInput.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 6baa71e0f1c63c54f9be7033f0a5b8f6 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/LocalPackages/net.peeweek.gameplay-ingredients/Runtime/Discover.meta b/LocalPackages/net.peeweek.gameplay-ingredients/Runtime/Discover.meta new file mode 100644 index 0000000..218f0f9 --- /dev/null +++ b/LocalPackages/net.peeweek.gameplay-ingredients/Runtime/Discover.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: e65b0a4c26482dd4795cef781a110a1e +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/LocalPackages/net.peeweek.gameplay-ingredients/Runtime/Discover/Discover.cs b/LocalPackages/net.peeweek.gameplay-ingredients/Runtime/Discover/Discover.cs new file mode 100644 index 0000000..080213f --- /dev/null +++ b/LocalPackages/net.peeweek.gameplay-ingredients/Runtime/Discover/Discover.cs @@ -0,0 +1,52 @@ +using NaughtyAttributes; +using System.Collections; +using System.Collections.Generic; +using UnityEngine; +using GameObjectToggle = GameplayIngredients.Actions.ToggleGameObjectAction.GameObjectToggle; + +public class Discover : MonoBehaviour +{ + public string Name = "Discover"; + public string Category = "Category"; + public bool DefaultSelected = false; + public bool AlignViewToTransform = false; + + public GameObjectToggle[] ObjectsToToggle; + [Multiline] + public string Description = "Some Description of the Component\n\nCan be set as multiple lines."; + public int Priority = 0; + public DiscoverSection[] Sections; + +#if UNITY_EDITOR + [UnityEditor.MenuItem("GameObject/Gameplay Ingredients/Discover", priority=10)] + static void CreateObject() + { + GameObject selected = UnityEditor.Selection.activeGameObject; + + var go = new GameObject("Discover"); + if (selected != null) + { + go.transform.parent = selected.transform; + go.transform.position = selected.transform.position; + } + go.AddComponent(); + UnityEditor.Selection.activeGameObject = go; + } +#endif +} + +[System.Serializable] +public struct DiscoverSection +{ + public string SectionName; + [Multiline] + public string SectionContent; + public SectionAction[] Actions; +} + +[System.Serializable] +public struct SectionAction +{ + public string Description; + public Object Target; +} diff --git a/LocalPackages/net.peeweek.gameplay-ingredients/Runtime/Discover/Discover.cs.meta b/LocalPackages/net.peeweek.gameplay-ingredients/Runtime/Discover/Discover.cs.meta new file mode 100644 index 0000000..6f3a645 --- /dev/null +++ b/LocalPackages/net.peeweek.gameplay-ingredients/Runtime/Discover/Discover.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: a952ff0a6afde7c4b95d55801086887e +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {fileID: 2800000, guid: d3aa34dcc051ec64aac5ea3204d61966, type: 3} + userData: + assetBundleName: + assetBundleVariant: diff --git a/LocalPackages/net.peeweek.gameplay-ingredients/Runtime/GameLevel.cs b/LocalPackages/net.peeweek.gameplay-ingredients/Runtime/GameLevel.cs new file mode 100644 index 0000000..9c2f77a --- /dev/null +++ b/LocalPackages/net.peeweek.gameplay-ingredients/Runtime/GameLevel.cs @@ -0,0 +1,12 @@ +using UnityEngine; +using NaughtyAttributes; + +namespace GameplayIngredients +{ + public class GameLevel : ScriptableObject + { + [ReorderableList, Scene] + public string[] StartupScenes; + } +} + diff --git a/LocalPackages/net.peeweek.gameplay-ingredients/Runtime/GameLevel.cs.meta b/LocalPackages/net.peeweek.gameplay-ingredients/Runtime/GameLevel.cs.meta new file mode 100644 index 0000000..04d061a --- /dev/null +++ b/LocalPackages/net.peeweek.gameplay-ingredients/Runtime/GameLevel.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: d0e5997dc40a2dc47afc7b9a41a9a862 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {fileID: 2800000, guid: 9921921a4e899394dbc39b4b38db93ef, type: 3} + userData: + assetBundleName: + assetBundleVariant: diff --git a/LocalPackages/net.peeweek.gameplay-ingredients/Runtime/GameObjectExtensions.cs b/LocalPackages/net.peeweek.gameplay-ingredients/Runtime/GameObjectExtensions.cs new file mode 100644 index 0000000..fb2d900 --- /dev/null +++ b/LocalPackages/net.peeweek.gameplay-ingredients/Runtime/GameObjectExtensions.cs @@ -0,0 +1,31 @@ +using System.Collections; +using System.Collections.Generic; +using UnityEngine; + +public static class GameObjectExtensions +{ + public static IEnumerable GetAllChildren(this Transform transform) + { + var stack = new Stack(); + stack.Push(transform); + while(stack.Count != 0) + { + var t = stack.Pop(); + yield return t; + + for (int i = 0; i < t.childCount; i++) + { + stack.Push(t.GetChild(i)); + } + } + } + + public static IEnumerable GetAllChildren(this GameObject gameObject) + { + var all = gameObject.transform.GetAllChildren(); + foreach(Transform t in all) + { + yield return t.gameObject; + } + } +} diff --git a/LocalPackages/net.peeweek.gameplay-ingredients/Runtime/GameObjectExtensions.cs.meta b/LocalPackages/net.peeweek.gameplay-ingredients/Runtime/GameObjectExtensions.cs.meta new file mode 100644 index 0000000..7c71082 --- /dev/null +++ b/LocalPackages/net.peeweek.gameplay-ingredients/Runtime/GameObjectExtensions.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 043df10a698bef24f85a021cc54479c2 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/LocalPackages/net.peeweek.gameplay-ingredients/Runtime/GameplayIngredients.asmdef b/LocalPackages/net.peeweek.gameplay-ingredients/Runtime/GameplayIngredients.asmdef index 693a44f..c11e4bd 100644 --- a/LocalPackages/net.peeweek.gameplay-ingredients/Runtime/GameplayIngredients.asmdef +++ b/LocalPackages/net.peeweek.gameplay-ingredients/Runtime/GameplayIngredients.asmdef @@ -1,8 +1,18 @@ { "name": "GameplayIngredients", - "references": [], - "optionalUnityReferences": [], + "references": [ + "NaughtyAttributes.Core", + "Cinemachine", + "Unity.Timeline", + "UnityEngine.UI" + ], "includePlatforms": [], "excludePlatforms": [], - "allowUnsafeCode": false + "allowUnsafeCode": false, + "overrideReferences": false, + "precompiledReferences": [], + "autoReferenced": true, + "defineConstraints": [], + "versionDefines": [], + "noEngineReferences": false } \ No newline at end of file diff --git a/LocalPackages/net.peeweek.gameplay-ingredients/Runtime/Hooks/HookBase.cs b/LocalPackages/net.peeweek.gameplay-ingredients/Runtime/Hooks/HookBase.cs deleted file mode 100644 index fd36e19..0000000 --- a/LocalPackages/net.peeweek.gameplay-ingredients/Runtime/Hooks/HookBase.cs +++ /dev/null @@ -1,11 +0,0 @@ -using UnityEngine; - -namespace GameplayIngredients.Hooks -{ - public abstract class HookBase : MonoBehaviour - { - - } -} - - diff --git a/LocalPackages/net.peeweek.gameplay-ingredients/Runtime/Hooks/OnAwakeHook.cs b/LocalPackages/net.peeweek.gameplay-ingredients/Runtime/Hooks/OnAwakeHook.cs deleted file mode 100644 index 4012db6..0000000 --- a/LocalPackages/net.peeweek.gameplay-ingredients/Runtime/Hooks/OnAwakeHook.cs +++ /dev/null @@ -1,17 +0,0 @@ -using UnityEngine; -using UnityEngine.Events; - -namespace GameplayIngredients.Hooks -{ - public class OnAwakeHook : MonoBehaviour - { - public UnityEvent onAwake; - - private void Awake() - { - onAwake.Invoke(); - } - } -} - - diff --git a/LocalPackages/net.peeweek.gameplay-ingredients/Runtime/Hooks/OnEnableDisableHook.cs b/LocalPackages/net.peeweek.gameplay-ingredients/Runtime/Hooks/OnEnableDisableHook.cs deleted file mode 100644 index 328506b..0000000 --- a/LocalPackages/net.peeweek.gameplay-ingredients/Runtime/Hooks/OnEnableDisableHook.cs +++ /dev/null @@ -1,21 +0,0 @@ -using UnityEngine.Events; - -namespace GameplayIngredients.Hooks -{ - public class OnEnableDisableHook : HookBase - { - public UnityEvent OnEnableEvent; - public UnityEvent OnDisableEvent; - - private void OnEnable() - { - OnEnableEvent.Invoke(); - } - - private void OnDisable() - { - OnDisableEvent.Invoke(); - } - } -} - diff --git a/LocalPackages/net.peeweek.gameplay-ingredients/Runtime/Hooks/OnKeyDownHook.cs b/LocalPackages/net.peeweek.gameplay-ingredients/Runtime/Hooks/OnKeyDownHook.cs deleted file mode 100644 index 8a7d7de..0000000 --- a/LocalPackages/net.peeweek.gameplay-ingredients/Runtime/Hooks/OnKeyDownHook.cs +++ /dev/null @@ -1,30 +0,0 @@ -using UnityEngine; -using UnityEngine.Events; - -namespace GameplayIngredients.Hooks -{ - public class OnKeyDownHook : HookBase - { - public enum ActionType - { - KeyDown, - KeyUp - } - - public KeyCode Key = KeyCode.F5; - - public UnityEvent OnKeyDownEvent; - public UnityEvent OnKeyUpEvent; - - void Update() - { - if (Input.GetKeyDown(Key)) - OnKeyDownEvent.Invoke(); - - if (Input.GetKeyUp(Key)) - OnKeyUpEvent.Invoke(); - } - } -} - - diff --git a/LocalPackages/net.peeweek.gameplay-ingredients/Runtime/Hooks/OnMessageHook.cs b/LocalPackages/net.peeweek.gameplay-ingredients/Runtime/Hooks/OnMessageHook.cs deleted file mode 100644 index 86cf737..0000000 --- a/LocalPackages/net.peeweek.gameplay-ingredients/Runtime/Hooks/OnMessageHook.cs +++ /dev/null @@ -1,28 +0,0 @@ -using UnityEngine.Events; - -namespace GameplayIngredients.Hooks -{ - public class OnMessageHook : HookBase - { - public string MessageName = "Message"; - - public UnityEvent Event; - - void OnEnable() - { - Messager.RegisterEvent(MessageName, Execute); - } - - void OnDisable() - { - Messager.UnregisterEvent(MessageName, Execute); - } - - void Execute() - { - Event.Invoke(); - } - - - } -} diff --git a/LocalPackages/net.peeweek.gameplay-ingredients/Runtime/Hooks/OnStartHook.cs b/LocalPackages/net.peeweek.gameplay-ingredients/Runtime/Hooks/OnStartHook.cs deleted file mode 100644 index 05cfeeb..0000000 --- a/LocalPackages/net.peeweek.gameplay-ingredients/Runtime/Hooks/OnStartHook.cs +++ /dev/null @@ -1,17 +0,0 @@ -using UnityEngine; -using UnityEngine.Events; - -namespace GameplayIngredients.Hooks -{ - public class OnStartHook : HookBase - { - public UnityEvent OnStart; - - private void Start() - { - OnStart.Invoke(); - } - } -} - - diff --git a/LocalPackages/net.peeweek.gameplay-ingredients/Runtime/Hooks/OnTriggerHook.cs b/LocalPackages/net.peeweek.gameplay-ingredients/Runtime/Hooks/OnTriggerHook.cs deleted file mode 100644 index 06e7265..0000000 --- a/LocalPackages/net.peeweek.gameplay-ingredients/Runtime/Hooks/OnTriggerHook.cs +++ /dev/null @@ -1,60 +0,0 @@ -using UnityEngine; -using UnityEngine.Events; - -namespace GameplayIngredients.Hooks -{ - public class OnTriggerHook : HookBase - { - public int EnterMaxCount = 0; - public int ExitMaxCount = 0; - - private int m_RemainingEnterCount; - private int m_RemainingExitCount; - - public UnityEvent onTriggerEnter; - public UnityEvent onTriggerExit; - - public bool OnlyInteractWithTag = true; - public string Tag = "Player"; - - void Start() - { - m_RemainingEnterCount = EnterMaxCount; - m_RemainingExitCount = ExitMaxCount; - } - - private void OnTriggerEnter(Collider other) - { - if (EnterMaxCount > 0) - { - if (m_RemainingEnterCount == 0) return; - m_RemainingEnterCount--; - } - if (OnlyInteractWithTag && other.tag == Tag ) - { - onTriggerEnter.Invoke(); - } - if (!OnlyInteractWithTag) - { - onTriggerEnter.Invoke(); - } - } - - private void OnTriggerExit(Collider other) - { - if (ExitMaxCount > 0) - { - if (m_RemainingExitCount == 0) return; - m_RemainingExitCount--; - } - if (OnlyInteractWithTag && other.tag == Tag ) - { - onTriggerExit.Invoke(); - } - if (!OnlyInteractWithTag) - { - onTriggerExit.Invoke(); - } - } - } -} diff --git a/LocalPackages/net.peeweek.gameplay-ingredients/Runtime/Ingredients.meta b/LocalPackages/net.peeweek.gameplay-ingredients/Runtime/Ingredients.meta new file mode 100644 index 0000000..7acd46e --- /dev/null +++ b/LocalPackages/net.peeweek.gameplay-ingredients/Runtime/Ingredients.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: fd8d6ebc9fcf60f4b9a59a43526496fa +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/LocalPackages/net.peeweek.gameplay-ingredients/Runtime/Ingredients/Factory.meta b/LocalPackages/net.peeweek.gameplay-ingredients/Runtime/Ingredients/Factory.meta new file mode 100644 index 0000000..698a399 --- /dev/null +++ b/LocalPackages/net.peeweek.gameplay-ingredients/Runtime/Ingredients/Factory.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: f2898aea74971ab4b87f50fb01c8dfac +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/LocalPackages/net.peeweek.gameplay-ingredients/Runtime/Ingredients/Factory/Factory.cs b/LocalPackages/net.peeweek.gameplay-ingredients/Runtime/Ingredients/Factory/Factory.cs new file mode 100644 index 0000000..87a8daa --- /dev/null +++ b/LocalPackages/net.peeweek.gameplay-ingredients/Runtime/Ingredients/Factory/Factory.cs @@ -0,0 +1,257 @@ +using NaughtyAttributes; +using System.Collections; +using System.Collections.Generic; +using System.Linq; +using UnityEngine; + +namespace GameplayIngredients +{ + public class Factory : MonoBehaviour + { + public enum BlueprintSelectionMode + { + Random, + Sequential, + Shuffle, + GameSave + } + + public enum SpawnTargetSelection + { + OneSequential, + OneRandom, + All + } + + public enum SpawnLocation + { + Default, + SameSceneAsTarget, + ChildOfTarget, + DontDestroyOnLoad + } + + [Header("Blueprint")] + [ReorderableList, NonNullCheck] + public GameObject[] FactoryBlueprints; + public BlueprintSelectionMode blueprintSelecionMode = BlueprintSelectionMode.Random; + [ShowIf("usesGameSave")] + public GameSaveManager.Location gameSaveLocation = GameSaveManager.Location.User; + [ShowIf("usesGameSave")] + public string gameSaveVariableName = "FactoryBPIndex"; + [ShowIf("usesGameSave")] + public int defaultGameSaveIndex = 0; + + [Header("Spawn Target")] + [NonNullCheck] + public GameObject SpawnTarget; + public SpawnLocation spawnLocation = SpawnLocation.SameSceneAsTarget; + [Tooltip("Sacrifices oldest instance if necessary")] + public bool SacrificeOldest = false; + + [Header("Reap and Respawn")] + public bool RespawnTarget = true; + public float RespawnDelay = 3.0f; + public bool ReapInstancesOnDestroy = true; + + [Min(1), SerializeField] + private int MaxInstances = 1; + + [ReorderableList] + public Callable[] OnSpawn; + [ReorderableList] + public Callable[] OnRespawn; + + List m_Instances; + + private void OnEnable() + { + if(m_Instances != null) + m_Instances.RemoveAll(item => item == null); + } + + private void OnDestroy() + { + if(ReapInstancesOnDestroy && m_Instances != null) + { + foreach(var instance in m_Instances) + { + if (instance != null) + Destroy(instance); + } + } + } + + bool usesGameSave() + { + return blueprintSelecionMode == BlueprintSelectionMode.GameSave; + } + + public void SetTarget(GameObject target) + { + if(target != null) + { + SpawnTarget = target; + } + } + + public GameObject GetInstance(int index) + { + if (m_Instances != null && m_Instances.Count > index) + return m_Instances[index]; + else + return null; + } + + public void Spawn() + { + if(SpawnTarget == null || FactoryBlueprints == null || FactoryBlueprints.Length == 0) + { + Debug.LogWarning(string.Format("Factory '{0}' : Cannot spawn as there are no spawn target or factory blueprints", gameObject.name)); + return; + } + + if (m_Instances == null) + m_Instances = new List(); + + if(m_Instances.Count == MaxInstances && SacrificeOldest) + { + var oldest = m_Instances[0]; + m_Instances.RemoveAt(0); + Destroy(oldest); + } + + if (m_Instances.Count < MaxInstances) + { + GameObject newInstance = Spawn(SelectBlueprint(), SpawnTarget); + + switch(spawnLocation) + { + case SpawnLocation.Default: + break; + case SpawnLocation.SameSceneAsTarget: + UnityEngine.SceneManagement.SceneManager.MoveGameObjectToScene( newInstance, SpawnTarget.scene); + break; + case SpawnLocation.ChildOfTarget: + newInstance.transform.parent = SpawnTarget.transform; + break; + case SpawnLocation.DontDestroyOnLoad: + DontDestroyOnLoad(newInstance); + break; + } + + m_Instances.Add(newInstance); + + Callable.Call(OnSpawn, newInstance); + } + + } + + private void LateUpdate() + { + if(m_Instances != null) + { + List todelete = new List(); + for(int i = 0; i < m_Instances.Count; i++) + { + if(m_Instances[i] == null) + { + todelete.Add(i); + } + } + + foreach (var index in todelete) + { + m_Instances.RemoveAt(index); + + if(RespawnTarget) + AddRespawnCoroutine(); + } + } + } + + private List m_RespawnCoroutines; + + private void AddRespawnCoroutine() + { + if (m_RespawnCoroutines == null) + m_RespawnCoroutines = new List(); + else + { + m_RespawnCoroutines.RemoveAll(o => o == null); + } + + m_RespawnCoroutines.Add(StartCoroutine(Respawn(RespawnDelay))); + } + + private IEnumerator Respawn(float time) + { + yield return new WaitForSeconds(time); + Callable.Call(OnRespawn, this.gameObject); + Spawn(); + } + + private GameObject Spawn(GameObject blueprint, GameObject target) + { + var Go = Instantiate(blueprint, target.transform.position, target.transform.rotation); + Go.name = (blueprint.name); + return Go; + } + + int currentBlueprintIndex = -1; + + private GameObject SelectBlueprint() + { + if(FactoryBlueprints == null || FactoryBlueprints.Length == 0) + { + Debug.LogError($"Factory '{gameObject.name}' could not spawn anything as there are no blueprints set up"); + return null; + } + + switch(blueprintSelecionMode) + { + default: + case BlueprintSelectionMode.Random: + currentBlueprintIndex = Random.Range(0, FactoryBlueprints.Length); + break; + case BlueprintSelectionMode.Sequential: + currentBlueprintIndex = (currentBlueprintIndex++) % FactoryBlueprints.Length; + break; + case BlueprintSelectionMode.Shuffle: + currentBlueprintIndex = Shuffle(currentBlueprintIndex); + break; + case BlueprintSelectionMode.GameSave: + currentBlueprintIndex = GetFromGameSave(); + break; + } + return FactoryBlueprints[currentBlueprintIndex]; + } + + List shuffleIndices; + + private int Shuffle(int i) + { + if(shuffleIndices == null || shuffleIndices.Count != FactoryBlueprints.Length) + { + shuffleIndices = Enumerable.Range(0, FactoryBlueprints.Length).OrderBy(x => Random.value).ToList(); + } + return shuffleIndices[(shuffleIndices.IndexOf(i) + 1) % shuffleIndices.Count]; + } + + private int GetFromGameSave() + { + var gsm = Manager.Get(); + int index = -1; + if(gsm.HasInt(gameSaveVariableName, gameSaveLocation)) + { + index = gsm.GetInt(gameSaveVariableName, gameSaveLocation); + } + else + { + index = defaultGameSaveIndex; + } + + return Mathf.Clamp(index, 0, FactoryBlueprints.Length - 1); + } + } +} diff --git a/LocalPackages/net.peeweek.gameplay-ingredients/Runtime/Ingredients/Factory/Factory.cs.meta b/LocalPackages/net.peeweek.gameplay-ingredients/Runtime/Ingredients/Factory/Factory.cs.meta new file mode 100644 index 0000000..52fbb00 --- /dev/null +++ b/LocalPackages/net.peeweek.gameplay-ingredients/Runtime/Ingredients/Factory/Factory.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: d69cd00f40343984eaf286a54b36348c +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {fileID: 2800000, guid: 86f51d6a3e4045449ad420a9150b03a5, type: 3} + userData: + assetBundleName: + assetBundleVariant: diff --git a/LocalPackages/net.peeweek.gameplay-ingredients/Runtime/Ingredients/Factory/FactorySetTargetAction.cs b/LocalPackages/net.peeweek.gameplay-ingredients/Runtime/Ingredients/Factory/FactorySetTargetAction.cs new file mode 100644 index 0000000..f0dd49b --- /dev/null +++ b/LocalPackages/net.peeweek.gameplay-ingredients/Runtime/Ingredients/Factory/FactorySetTargetAction.cs @@ -0,0 +1,24 @@ +using System.Collections; +using System.Collections.Generic; +using UnityEngine; +using NaughtyAttributes; + +namespace GameplayIngredients.Actions +{ + public class FactorySetTargetAction : ActionBase + { + [NonNullCheck] + public Factory factory; + + [NonNullCheck] + public GameObject Target; + + public override void Execute(GameObject instigator = null) + { + if (factory != null && Target != null) + { + factory.SetTarget(Target); + } + } + } +} diff --git a/LocalPackages/net.peeweek.gameplay-ingredients/Runtime/Ingredients/Factory/FactorySetTargetAction.cs.meta b/LocalPackages/net.peeweek.gameplay-ingredients/Runtime/Ingredients/Factory/FactorySetTargetAction.cs.meta new file mode 100644 index 0000000..306bb07 --- /dev/null +++ b/LocalPackages/net.peeweek.gameplay-ingredients/Runtime/Ingredients/Factory/FactorySetTargetAction.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: fb7e1520e0521a44eb1279a5f70f6050 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {fileID: 2800000, guid: 86f51d6a3e4045449ad420a9150b03a5, type: 3} + userData: + assetBundleName: + assetBundleVariant: diff --git a/LocalPackages/net.peeweek.gameplay-ingredients/Runtime/Ingredients/Factory/FactorySpawnAction.cs b/LocalPackages/net.peeweek.gameplay-ingredients/Runtime/Ingredients/Factory/FactorySpawnAction.cs new file mode 100644 index 0000000..3d70cd4 --- /dev/null +++ b/LocalPackages/net.peeweek.gameplay-ingredients/Runtime/Ingredients/Factory/FactorySpawnAction.cs @@ -0,0 +1,18 @@ +using System.Collections; +using System.Collections.Generic; +using UnityEngine; + +namespace GameplayIngredients.Actions +{ + public class FactorySpawnAction : ActionBase + { + [NonNullCheck] + public Factory factory; + + public override void Execute(GameObject instigator = null) + { + if (factory != null) + factory.Spawn(); + } + } +} diff --git a/LocalPackages/net.peeweek.gameplay-ingredients/Runtime/Ingredients/Factory/FactorySpawnAction.cs.meta b/LocalPackages/net.peeweek.gameplay-ingredients/Runtime/Ingredients/Factory/FactorySpawnAction.cs.meta new file mode 100644 index 0000000..f9447ec --- /dev/null +++ b/LocalPackages/net.peeweek.gameplay-ingredients/Runtime/Ingredients/Factory/FactorySpawnAction.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: bc5c180f8bf863b4da50cd3ac688bda3 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {fileID: 2800000, guid: 86f51d6a3e4045449ad420a9150b03a5, type: 3} + userData: + assetBundleName: + assetBundleVariant: diff --git a/LocalPackages/net.peeweek.gameplay-ingredients/Runtime/Ingredients/Folder.cs b/LocalPackages/net.peeweek.gameplay-ingredients/Runtime/Ingredients/Folder.cs new file mode 100644 index 0000000..3e37ec0 --- /dev/null +++ b/LocalPackages/net.peeweek.gameplay-ingredients/Runtime/Ingredients/Folder.cs @@ -0,0 +1,27 @@ +using UnityEngine; + +namespace GameplayIngredients +{ + [ExecuteAlways] + public class Folder : MonoBehaviour + { + public Color Color = Color.yellow; + +#if UNITY_EDITOR + private void Awake() + { + Reset(); + } + private void Reset() + { + gameObject.isStatic = true; + + if(Application.isPlaying) + { + Destroy(this); + } + } +#endif + } +} + diff --git a/LocalPackages/net.peeweek.gameplay-ingredients/Runtime/Ingredients/Folder.cs.meta b/LocalPackages/net.peeweek.gameplay-ingredients/Runtime/Ingredients/Folder.cs.meta new file mode 100644 index 0000000..5670d52 --- /dev/null +++ b/LocalPackages/net.peeweek.gameplay-ingredients/Runtime/Ingredients/Folder.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 40ebf4fc729b9924e85bf13fdbf9a6c3 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {fileID: -1463847995985908582, guid: 0000000000000000d000000000000000, type: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/LocalPackages/net.peeweek.gameplay-ingredients/Runtime/Ingredients/Interactions.meta b/LocalPackages/net.peeweek.gameplay-ingredients/Runtime/Ingredients/Interactions.meta new file mode 100644 index 0000000..d3ab1e1 --- /dev/null +++ b/LocalPackages/net.peeweek.gameplay-ingredients/Runtime/Ingredients/Interactions.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: a70103260c37cf14586e9ce8b679f0bc +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/LocalPackages/net.peeweek.gameplay-ingredients/Runtime/Ingredients/Interactions/BasicInteractive.cs b/LocalPackages/net.peeweek.gameplay-ingredients/Runtime/Ingredients/Interactions/BasicInteractive.cs new file mode 100644 index 0000000..c8b6d96 --- /dev/null +++ b/LocalPackages/net.peeweek.gameplay-ingredients/Runtime/Ingredients/Interactions/BasicInteractive.cs @@ -0,0 +1,17 @@ +using System.Collections; +using System.Collections.Generic; +using UnityEngine; + +namespace GameplayIngredients.Interactions +{ + public class BasicInteractive : Interactive + { + [Header("Settings")] + public float Distance = 1.0f; + + public override bool CanInteract(InteractiveUser user) + { + return Vector3.Distance(user.transform.position, this.transform.position) < Distance; + } + } +} diff --git a/LocalPackages/net.peeweek.gameplay-ingredients/Runtime/Ingredients/Interactions/BasicInteractive.cs.meta b/LocalPackages/net.peeweek.gameplay-ingredients/Runtime/Ingredients/Interactions/BasicInteractive.cs.meta new file mode 100644 index 0000000..213bb65 --- /dev/null +++ b/LocalPackages/net.peeweek.gameplay-ingredients/Runtime/Ingredients/Interactions/BasicInteractive.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 1a83ea03ffdc39b49ad288312ca737e3 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {fileID: 2800000, guid: 946cd4a447af28e4ebe7494670f60a83, type: 3} + userData: + assetBundleName: + assetBundleVariant: diff --git a/LocalPackages/net.peeweek.gameplay-ingredients/Runtime/Ingredients/Interactions/BasicInteractiveUser.cs b/LocalPackages/net.peeweek.gameplay-ingredients/Runtime/Ingredients/Interactions/BasicInteractiveUser.cs new file mode 100644 index 0000000..a1c0078 --- /dev/null +++ b/LocalPackages/net.peeweek.gameplay-ingredients/Runtime/Ingredients/Interactions/BasicInteractiveUser.cs @@ -0,0 +1,24 @@ +using System.Linq; +using System.Collections.Generic; +using UnityEngine; + +namespace GameplayIngredients.Interactions +{ + public class BasicInteractiveUser : InteractiveUser + { + public Camera Camera; + public float InteractionAngle = 60.0f; + + public override bool CanInteract(Interactive interactive) + { + Vector3 toInteractive = (interactive.transform.position - Camera.transform.position).normalized; + return Mathf.Acos(Vector3.Dot(toInteractive, Camera.transform.forward)) < InteractionAngle; + } + + public override Interactive[] SortCandidates(IEnumerable candidates) + { + return candidates.OrderBy(a => Vector3.Distance(a.gameObject.transform.position, this.transform.position)).ToArray(); + } + } +} + diff --git a/LocalPackages/net.peeweek.gameplay-ingredients/Runtime/Ingredients/Interactions/BasicInteractiveUser.cs.meta b/LocalPackages/net.peeweek.gameplay-ingredients/Runtime/Ingredients/Interactions/BasicInteractiveUser.cs.meta new file mode 100644 index 0000000..b49fced --- /dev/null +++ b/LocalPackages/net.peeweek.gameplay-ingredients/Runtime/Ingredients/Interactions/BasicInteractiveUser.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 10eca406278d06142953679de710a003 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {fileID: 2800000, guid: dd733e59c5ec489448302b07c319482f, type: 3} + userData: + assetBundleName: + assetBundleVariant: diff --git a/LocalPackages/net.peeweek.gameplay-ingredients/Runtime/Ingredients/Interactions/Interaction.cs b/LocalPackages/net.peeweek.gameplay-ingredients/Runtime/Ingredients/Interactions/Interaction.cs new file mode 100644 index 0000000..bb09611 --- /dev/null +++ b/LocalPackages/net.peeweek.gameplay-ingredients/Runtime/Ingredients/Interactions/Interaction.cs @@ -0,0 +1,18 @@ +using GameplayIngredients.Actions; +using System.Collections; +using System.Collections.Generic; +using UnityEngine; + +namespace GameplayIngredients.Interactions +{ + public class Interaction : ActionBase + { + public InteractiveUser InteractiveUser; + + public override void Execute(GameObject instigator = null) + { + if (InteractiveUser != null) + InteractiveUser.Interact(); + } + } +} diff --git a/LocalPackages/net.peeweek.gameplay-ingredients/Runtime/Ingredients/Interactions/Interaction.cs.meta b/LocalPackages/net.peeweek.gameplay-ingredients/Runtime/Ingredients/Interactions/Interaction.cs.meta new file mode 100644 index 0000000..cebc97f --- /dev/null +++ b/LocalPackages/net.peeweek.gameplay-ingredients/Runtime/Ingredients/Interactions/Interaction.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 4401de233d589a14cbba6dffc6dbc8d2 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {fileID: 2800000, guid: 8797d3a3e47f3224b86affe15a6aea69, type: 3} + userData: + assetBundleName: + assetBundleVariant: diff --git a/LocalPackages/net.peeweek.gameplay-ingredients/Runtime/Ingredients/Interactions/InteractionManager.cs b/LocalPackages/net.peeweek.gameplay-ingredients/Runtime/Ingredients/Interactions/InteractionManager.cs new file mode 100644 index 0000000..fbda6a4 --- /dev/null +++ b/LocalPackages/net.peeweek.gameplay-ingredients/Runtime/Ingredients/Interactions/InteractionManager.cs @@ -0,0 +1,46 @@ +using System.Collections.Generic; + +namespace GameplayIngredients.Interactions +{ + public static class InteractionManager + { + public static IEnumerable interactives { get { return s_Interactives; } } + + static List s_Interactives = new List(); + + public static void RegisterInteractive(Interactive interactive) + { + s_Interactives.Add(interactive); + } + + public static void RemoveInteractive(Interactive interactive) + { + s_Interactives.Remove(interactive); + } + + public static void Interact(InteractiveUser user) + { + foreach(var interactive in GetCandidates(user)) + { + if (interactive.Interact(user)) + break; + } + } + + public static Interactive[] GetCandidates(InteractiveUser user) + { + List candidates = new List(); + + foreach(var interactive in s_Interactives) + { + // Filter interactives at user's reach + + if (interactive.CanInteract(user)) + candidates.Add(interactive); + } + + return user.SortCandidates(candidates.ToArray()); + } + + } +} diff --git a/LocalPackages/net.peeweek.gameplay-ingredients/Runtime/Ingredients/Interactions/InteractionManager.cs.meta b/LocalPackages/net.peeweek.gameplay-ingredients/Runtime/Ingredients/Interactions/InteractionManager.cs.meta new file mode 100644 index 0000000..ccaeb0c --- /dev/null +++ b/LocalPackages/net.peeweek.gameplay-ingredients/Runtime/Ingredients/Interactions/InteractionManager.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 9cb72656fa4214148995009d906b440e +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {fileID: 2800000, guid: 63315c7c008e56843822736c05a1b375, type: 3} + userData: + assetBundleName: + assetBundleVariant: diff --git a/LocalPackages/net.peeweek.gameplay-ingredients/Runtime/Ingredients/Interactions/Interactive.cs b/LocalPackages/net.peeweek.gameplay-ingredients/Runtime/Ingredients/Interactions/Interactive.cs new file mode 100644 index 0000000..aef0554 --- /dev/null +++ b/LocalPackages/net.peeweek.gameplay-ingredients/Runtime/Ingredients/Interactions/Interactive.cs @@ -0,0 +1,39 @@ +using GameplayIngredients.Events; +using NaughtyAttributes; +using System.Collections; +using System.Collections.Generic; +using UnityEngine; + +namespace GameplayIngredients.Interactions +{ + public abstract class Interactive : EventBase + { + [Header("Events")] + [SerializeField, ReorderableList] + protected Callable[] OnInteract; + + protected virtual void OnEnable() + { + InteractionManager.RegisterInteractive(this); + } + + protected virtual void OnDisable() + { + InteractionManager.RemoveInteractive(this); + } + + public bool Interact(InteractiveUser user) + { + if (user.CanInteract(this) && CanInteract(user)) + { + Callable.Call(OnInteract, user.gameObject); + return true; + } + else + return false; + } + + public abstract bool CanInteract(InteractiveUser user); + + } +} diff --git a/LocalPackages/net.peeweek.gameplay-ingredients/Runtime/Ingredients/Interactions/Interactive.cs.meta b/LocalPackages/net.peeweek.gameplay-ingredients/Runtime/Ingredients/Interactions/Interactive.cs.meta new file mode 100644 index 0000000..3d8e7a7 --- /dev/null +++ b/LocalPackages/net.peeweek.gameplay-ingredients/Runtime/Ingredients/Interactions/Interactive.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 96a9f9a6c45dae04f8f3a9727affed8a +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/LocalPackages/net.peeweek.gameplay-ingredients/Runtime/Ingredients/Interactions/InteractiveUser.cs b/LocalPackages/net.peeweek.gameplay-ingredients/Runtime/Ingredients/Interactions/InteractiveUser.cs new file mode 100644 index 0000000..a814ea8 --- /dev/null +++ b/LocalPackages/net.peeweek.gameplay-ingredients/Runtime/Ingredients/Interactions/InteractiveUser.cs @@ -0,0 +1,18 @@ +using System.Collections; +using System.Collections.Generic; +using UnityEngine; + +namespace GameplayIngredients.Interactions +{ + public abstract class InteractiveUser : MonoBehaviour + { + public abstract bool CanInteract(Interactive interactive); + + public abstract Interactive[] SortCandidates(IEnumerable candidates); + + public void Interact() + { + InteractionManager.Interact(this); + } + } +} diff --git a/LocalPackages/net.peeweek.gameplay-ingredients/Runtime/Ingredients/Interactions/InteractiveUser.cs.meta b/LocalPackages/net.peeweek.gameplay-ingredients/Runtime/Ingredients/Interactions/InteractiveUser.cs.meta new file mode 100644 index 0000000..3942638 --- /dev/null +++ b/LocalPackages/net.peeweek.gameplay-ingredients/Runtime/Ingredients/Interactions/InteractiveUser.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 3aead24411f706b4dab50dabfcdc79d7 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/LocalPackages/net.peeweek.gameplay-ingredients/Runtime/Ingredients/Pickup.meta b/LocalPackages/net.peeweek.gameplay-ingredients/Runtime/Ingredients/Pickup.meta new file mode 100644 index 0000000..c0c1630 --- /dev/null +++ b/LocalPackages/net.peeweek.gameplay-ingredients/Runtime/Ingredients/Pickup.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: bbd0e8c072187b54aab41cb4d7ff1507 +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/LocalPackages/net.peeweek.gameplay-ingredients/Runtime/Ingredients/Pickup/PickupEffectBase.cs b/LocalPackages/net.peeweek.gameplay-ingredients/Runtime/Ingredients/Pickup/PickupEffectBase.cs new file mode 100644 index 0000000..c4fbebd --- /dev/null +++ b/LocalPackages/net.peeweek.gameplay-ingredients/Runtime/Ingredients/Pickup/PickupEffectBase.cs @@ -0,0 +1,11 @@ +using System.Collections; +using System.Collections.Generic; +using UnityEngine; + +namespace GameplayIngredients.Pickup +{ + public abstract class PickupEffectBase : MonoBehaviour + { + public abstract void ApplyPickupEffect(PickupOwnerBase owner); + } +} diff --git a/LocalPackages/net.peeweek.gameplay-ingredients/Runtime/Ingredients/Pickup/PickupEffectBase.cs.meta b/LocalPackages/net.peeweek.gameplay-ingredients/Runtime/Ingredients/Pickup/PickupEffectBase.cs.meta new file mode 100644 index 0000000..6d5ed23 --- /dev/null +++ b/LocalPackages/net.peeweek.gameplay-ingredients/Runtime/Ingredients/Pickup/PickupEffectBase.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 90a8967f9fa92d848a7409149660bd64 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/LocalPackages/net.peeweek.gameplay-ingredients/Runtime/Ingredients/Pickup/PickupItem.cs b/LocalPackages/net.peeweek.gameplay-ingredients/Runtime/Ingredients/Pickup/PickupItem.cs new file mode 100644 index 0000000..c365512 --- /dev/null +++ b/LocalPackages/net.peeweek.gameplay-ingredients/Runtime/Ingredients/Pickup/PickupItem.cs @@ -0,0 +1,30 @@ +using NaughtyAttributes; +using System.Collections; +using System.Collections.Generic; +using UnityEngine; + +namespace GameplayIngredients.Pickup +{ + [RequireComponent(typeof(Collider))] + public class PickupItem : MonoBehaviour + { + public PickupEffectBase[] effects { get { return GetComponents(); } } + + [ReorderableList] + public Callable[] OnPickup; + + private void OnTriggerEnter(Collider other) + { + var owner = other.gameObject.GetComponent(); + if(owner != null) + { + if(owner.PickUp(this)) + { + Callable.Call(OnPickup, owner.gameObject); + Destroy(this.gameObject); + } + } + } + } +} + diff --git a/LocalPackages/net.peeweek.gameplay-ingredients/Runtime/Ingredients/Pickup/PickupItem.cs.meta b/LocalPackages/net.peeweek.gameplay-ingredients/Runtime/Ingredients/Pickup/PickupItem.cs.meta new file mode 100644 index 0000000..a92ef2e --- /dev/null +++ b/LocalPackages/net.peeweek.gameplay-ingredients/Runtime/Ingredients/Pickup/PickupItem.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: cb53d9aba8538c442b9d9dd0cd192fe0 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {fileID: 2800000, guid: e3c3d9daa54f982429dbbc8134e953ea, type: 3} + userData: + assetBundleName: + assetBundleVariant: diff --git a/LocalPackages/net.peeweek.gameplay-ingredients/Runtime/Ingredients/Pickup/PickupOwnerBase.cs b/LocalPackages/net.peeweek.gameplay-ingredients/Runtime/Ingredients/Pickup/PickupOwnerBase.cs new file mode 100644 index 0000000..e012bdf --- /dev/null +++ b/LocalPackages/net.peeweek.gameplay-ingredients/Runtime/Ingredients/Pickup/PickupOwnerBase.cs @@ -0,0 +1,19 @@ +using System.Collections; +using System.Collections.Generic; +using UnityEngine; + +namespace GameplayIngredients.Pickup +{ + public abstract class PickupOwnerBase : MonoBehaviour + { + public bool PickUp(PickupItem pickup) + { + foreach (var effect in pickup.effects) + { + effect.ApplyPickupEffect(this); + } + return true; + } + } +} + diff --git a/LocalPackages/net.peeweek.gameplay-ingredients/Runtime/Ingredients/Pickup/PickupOwnerBase.cs.meta b/LocalPackages/net.peeweek.gameplay-ingredients/Runtime/Ingredients/Pickup/PickupOwnerBase.cs.meta new file mode 100644 index 0000000..220c5c5 --- /dev/null +++ b/LocalPackages/net.peeweek.gameplay-ingredients/Runtime/Ingredients/Pickup/PickupOwnerBase.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 1a1a56323be50404aa1c75fa378cfc03 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/LocalPackages/net.peeweek.gameplay-ingredients/Runtime/Ingredients/Rigs.meta b/LocalPackages/net.peeweek.gameplay-ingredients/Runtime/Ingredients/Rigs.meta new file mode 100644 index 0000000..ac6d638 --- /dev/null +++ b/LocalPackages/net.peeweek.gameplay-ingredients/Runtime/Ingredients/Rigs.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: e472dbe013811a64ca80302d176dbc90 +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/LocalPackages/net.peeweek.gameplay-ingredients/Runtime/Ingredients/Rigs/DirectorControlRig.cs b/LocalPackages/net.peeweek.gameplay-ingredients/Runtime/Ingredients/Rigs/DirectorControlRig.cs new file mode 100644 index 0000000..574a4ba --- /dev/null +++ b/LocalPackages/net.peeweek.gameplay-ingredients/Runtime/Ingredients/Rigs/DirectorControlRig.cs @@ -0,0 +1,104 @@ +using System.Collections; +using System.Collections.Generic; +using UnityEngine; +using UnityEngine.Playables; +using UnityEngine.Timeline; +using NaughtyAttributes; + +namespace GameplayIngredients.Rigs +{ + public class DirectorControlRig : MonoBehaviour + { + public enum PlayMode + { + Stop, + Play, + Reverse + } + + public enum WrapMode + { + Stop, + Loop, + PingPong + } + + [NonNullCheck] + public PlayableDirector director; + + public PlayMode InitialPlayMode = PlayMode.Play; + public float InitialTime = 0.0f; + public bool UnscaledGameTime = false; + + public WrapMode wrapMode = WrapMode.Stop; + + public PlayMode playMode { get { return m_PlayMode; } set { m_PlayMode = value; } } + public float stopTime { get { return m_StopTime; } set { m_StopTime = value; } } + [ShowNativeProperty] + public float time { get { return (float)director.time; } set { director.time = value; } } + public TimelineAsset timeline { get { return director.playableAsset as TimelineAsset; } set { director.playableAsset = value; } } + + float m_StopTime = -1.0f; + PlayMode m_PlayMode; + + private void OnEnable() + { + if (director != null) + { + m_PlayMode = InitialPlayMode; + director.timeUpdateMode = DirectorUpdateMode.Manual; + director.time = InitialTime; + } + } + + public void Update() + { + if(m_PlayMode != PlayMode.Stop) + { + float dt = UnscaledGameTime? Time.unscaledDeltaTime : Time.deltaTime; + + float prevTime = (float)director.time; + float newTime = prevTime + (m_PlayMode == PlayMode.Reverse ? -1.0f : 1.0f) * dt; + + if (m_StopTime >= 0.0f && + ( (m_PlayMode == PlayMode.Play && prevTime < m_StopTime && m_StopTime <= newTime) + || (m_PlayMode == PlayMode.Reverse && newTime <= m_StopTime && m_StopTime < prevTime) + )) + { + director.time = m_StopTime; + m_PlayMode = PlayMode.Stop; + m_StopTime = -1.0f; + } + else + director.time = newTime; + + director.Evaluate(); + + if((director.time <= 0.0f && m_PlayMode == PlayMode.Reverse) || + (director.time >= director.playableAsset.duration && m_PlayMode == PlayMode.Play)) + { + switch(wrapMode) + { + case WrapMode.Loop: + if (director.time <= 0.0f) + director.time = director.playableAsset.duration; + else + director.time = 0.0f; + break; + case WrapMode.PingPong: + if (m_PlayMode == PlayMode.Play) + m_PlayMode = PlayMode.Reverse; + else if (m_PlayMode == PlayMode.Reverse) + m_PlayMode = PlayMode.Play; + break; + case WrapMode.Stop: + m_PlayMode = PlayMode.Stop; + break; + } + } + + + } + } + } +} diff --git a/LocalPackages/net.peeweek.gameplay-ingredients/Runtime/Ingredients/Rigs/DirectorControlRig.cs.meta b/LocalPackages/net.peeweek.gameplay-ingredients/Runtime/Ingredients/Rigs/DirectorControlRig.cs.meta new file mode 100644 index 0000000..e99a14f --- /dev/null +++ b/LocalPackages/net.peeweek.gameplay-ingredients/Runtime/Ingredients/Rigs/DirectorControlRig.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 427bc2b8b7ec57044b3c989995a9bee2 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {fileID: 2800000, guid: 0389dfe32851001499f36e2af3341970, type: 3} + userData: + assetBundleName: + assetBundleVariant: diff --git a/LocalPackages/net.peeweek.gameplay-ingredients/Runtime/Ingredients/Rigs/FloatingRig.cs b/LocalPackages/net.peeweek.gameplay-ingredients/Runtime/Ingredients/Rigs/FloatingRig.cs new file mode 100644 index 0000000..7d2ec6f --- /dev/null +++ b/LocalPackages/net.peeweek.gameplay-ingredients/Runtime/Ingredients/Rigs/FloatingRig.cs @@ -0,0 +1,22 @@ +using System.Collections; +using System.Collections.Generic; +using UnityEngine; + +public class FloatingRig : MonoBehaviour +{ + public Vector3 Frequency = new Vector3(4,5,6); + public Vector3 Amplitude = new Vector3(0.0f, 0.2f, 0.0f); + + Vector3 m_InitialPosition; + + private void Awake() + { + m_InitialPosition = transform.position; + } + + private void Update() + { + float t = Time.time; + transform.position = m_InitialPosition + new Vector3(Mathf.Sin(t * Frequency.x) * Amplitude.x, Mathf.Sin(t * Frequency.y) * Amplitude.y, Mathf.Sin(t * Frequency.z) * Amplitude.z); + } +} diff --git a/LocalPackages/net.peeweek.gameplay-ingredients/Runtime/Ingredients/Rigs/FloatingRig.cs.meta b/LocalPackages/net.peeweek.gameplay-ingredients/Runtime/Ingredients/Rigs/FloatingRig.cs.meta new file mode 100644 index 0000000..aca9d0b --- /dev/null +++ b/LocalPackages/net.peeweek.gameplay-ingredients/Runtime/Ingredients/Rigs/FloatingRig.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 53b77d3bf7eadf04c9bfda6da44088b0 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {fileID: 2800000, guid: 8dadb8f0fa7dd724e9cb4437d466e85a, type: 3} + userData: + assetBundleName: + assetBundleVariant: diff --git a/LocalPackages/net.peeweek.gameplay-ingredients/Runtime/Ingredients/Rigs/FollowPathRig.cs b/LocalPackages/net.peeweek.gameplay-ingredients/Runtime/Ingredients/Rigs/FollowPathRig.cs new file mode 100644 index 0000000..0136bec --- /dev/null +++ b/LocalPackages/net.peeweek.gameplay-ingredients/Runtime/Ingredients/Rigs/FollowPathRig.cs @@ -0,0 +1,171 @@ +using NaughtyAttributes; +using System.Linq; +using System.Collections.Generic; +using UnityEngine; + +namespace GameplayIngredients.Rigs +{ + public class FollowPathRig : MonoBehaviour + { + public enum PlayMode + { + Playing, + Stopped, + Reverse + } + + public enum LoopMode + { + Hold, + Loop, + PingPong + } + + public LoopMode loopMode = LoopMode.PingPong; + public bool StopOnSteps = false; + public float Speed = 2.0f; + + [ReorderableList, SerializeField, NonNullCheck] + protected GameObject[] Path; + + public PlayMode initialPlayMode = PlayMode.Playing; + PlayMode m_PlayMode; + float m_Progress; + + public void SetProgress(float progress) + { + m_Progress = Mathf.Clamp(progress, 0, Path.Length - 1); + } + + public void Play(float progress = -1.0f) + { + if (progress >= 0.0f) + SetProgress(progress); + + m_PlayMode = PlayMode.Playing; + } + + public void Reverse(float progress = -1.0f) + { + if (progress >= 0.0f) + SetProgress(progress); + + m_PlayMode = PlayMode.Reverse; + + } + + public void Stop(float progress = -1.0f) + { + if (progress >= 0.0f) + SetProgress(progress); + + m_PlayMode = PlayMode.Stopped; + + } + + private void Start() + { + m_PlayMode = initialPlayMode; + m_Progress = 0.0f; + } + + private void LateUpdate() + { + if(m_PlayMode != PlayMode.Stopped) + { + if(Path.Where(o => o == null).Count() > 0) + { + Debug.LogWarning("Path contains null objects. Cannot Compute.", this); + } + + // Process loopMode and boundary reach + switch(loopMode) + { + case LoopMode.Hold: + if((m_PlayMode == PlayMode.Playing && m_Progress == Path.Length - 1) || (m_PlayMode == PlayMode.Reverse && m_Progress == 0.0f)) + { + m_PlayMode = PlayMode.Stopped; + return; + } + break; + case LoopMode.Loop: + if (m_PlayMode == PlayMode.Playing && m_Progress == Path.Length -1) + { + m_Progress = 0.0f; + } + else if (m_PlayMode == PlayMode.Reverse && m_Progress == 0.0f) + { + m_Progress = Path.Length -1; + } + break; + case LoopMode.PingPong: + if (m_PlayMode == PlayMode.Playing && m_Progress == Path.Length -1) + { + m_PlayMode = PlayMode.Reverse; + } + else if (m_PlayMode == PlayMode.Reverse && m_Progress == 0.0f) + { + m_PlayMode = PlayMode.Playing; + } + break; + } + + // Process move on path + + float sign = 1.0f; + + if (m_PlayMode == PlayMode.Reverse) + sign = -1.0f; + + int idx = Mathf.Clamp( sign > 0? (int)Mathf.Floor(m_Progress) : (int)Mathf.Ceil(m_Progress), 0 , Path.Length-1); + int nextidx = idx + (int)sign; + + Vector3 inPos = Path[idx].transform.position; + Vector3 outPos = Path[nextidx].transform.position; + + Vector3 dir = ( outPos - inPos ).normalized; + Vector3 pos = Vector3.Lerp( sign > 0? inPos : outPos, sign > 0? outPos : inPos, m_Progress % 1.0f); + Vector3 move = dir * Speed * Time.deltaTime; + float moveT = move.magnitude / (outPos - inPos).magnitude * sign; + + m_Progress = Mathf.Clamp(m_Progress + moveT, (sign > 0)? idx : nextidx, (sign > 0) ? nextidx : idx); + + if(m_Progress == nextidx) + transform.position = outPos; + else + transform.position = Vector3.Lerp(inPos, outPos, (sign > 0) ? m_Progress % 1.0f : 1.0f - (m_Progress % 1.0f)); + + if((m_Progress %1.0f == 0.0f) && StopOnSteps) + { + m_PlayMode = PlayMode.Stopped; + } + + } + } + + private void OnDrawGizmos() + { + Gizmos.color = new Color(1.0f, 1.0f, 1.0f, 0.1f); + DrawGizmosPath(); + } + + private void OnDrawGizmosSelected() + { + Gizmos.color = Color.red; + DrawGizmosPath(); + } + + void DrawGizmosPath() + { + if(Path != null && Path.Length > 1 && Path.Where(o => o == null).Count() == 0) + { + for(int i = 0; i < Path.Length -1; i++) + { + Gizmos.DrawLine(Path[i].transform.position, Path[i + 1].transform.position); + } + } + } + + } +} + diff --git a/LocalPackages/net.peeweek.gameplay-ingredients/Runtime/Ingredients/Rigs/FollowPathRig.cs.meta b/LocalPackages/net.peeweek.gameplay-ingredients/Runtime/Ingredients/Rigs/FollowPathRig.cs.meta new file mode 100644 index 0000000..822b566 --- /dev/null +++ b/LocalPackages/net.peeweek.gameplay-ingredients/Runtime/Ingredients/Rigs/FollowPathRig.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: fc1b3c41375bbeb46a755e765717a19d +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {fileID: 2800000, guid: b701ab6baf5c6b0439073a439e032028, type: 3} + userData: + assetBundleName: + assetBundleVariant: diff --git a/LocalPackages/net.peeweek.gameplay-ingredients/Runtime/Ingredients/Rigs/LookAtRig.cs b/LocalPackages/net.peeweek.gameplay-ingredients/Runtime/Ingredients/Rigs/LookAtRig.cs new file mode 100644 index 0000000..3316b31 --- /dev/null +++ b/LocalPackages/net.peeweek.gameplay-ingredients/Runtime/Ingredients/Rigs/LookAtRig.cs @@ -0,0 +1,19 @@ +using UnityEngine; + +namespace GameplayIngredients.Rigs +{ + public class LookAtRig : MonoBehaviour + { + public Transform LookAtTarget; + public Space UpVectorSpace = Space.World; + public Vector3 UpVector = Vector3.up; + + void Update() + { + if (LookAtTarget != null) + { + transform.LookAt(LookAtTarget, UpVectorSpace == Space.Self? transform.InverseTransformDirection(UpVector).normalized: UpVector.normalized); + } + } + } +} diff --git a/LocalPackages/net.peeweek.gameplay-ingredients/Runtime/Ingredients/Rigs/LookAtRig.cs.meta b/LocalPackages/net.peeweek.gameplay-ingredients/Runtime/Ingredients/Rigs/LookAtRig.cs.meta new file mode 100644 index 0000000..816f248 --- /dev/null +++ b/LocalPackages/net.peeweek.gameplay-ingredients/Runtime/Ingredients/Rigs/LookAtRig.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 2ba8cc0ec1267c8469eff0f4b76464e1 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {fileID: 2800000, guid: 12b9370759a3efb4788a612b8ff4b4ed, type: 3} + userData: + assetBundleName: + assetBundleVariant: diff --git a/LocalPackages/net.peeweek.gameplay-ingredients/Runtime/Ingredients/Rigs/ReachPositionRig.cs b/LocalPackages/net.peeweek.gameplay-ingredients/Runtime/Ingredients/Rigs/ReachPositionRig.cs new file mode 100644 index 0000000..70ead2e --- /dev/null +++ b/LocalPackages/net.peeweek.gameplay-ingredients/Runtime/Ingredients/Rigs/ReachPositionRig.cs @@ -0,0 +1,54 @@ +using NaughtyAttributes; +using UnityEngine; + +namespace GameplayIngredients.Rigs +{ + public class ReachPositionRig : MonoBehaviour + { + public Transform target => m_Target; + + [Header("Target")] + [SerializeField] + protected Transform m_Target; + [Header("Motion")] + public float Dampen = 1.0f; + public float MaximumVelocity = 1.0f; + + [Header("On Reach Position")] + [ReorderableList] + public Callable[] OnReachPosition; + public float ReachSnapDistance = 0.01f; + + bool m_PositionReached = false; + + void LateUpdate() + { + if(m_Target != null) + { + var transform = gameObject.transform; + if(Vector3.Distance(transform.position , m_Target.position) < ReachSnapDistance) + { + transform.position = m_Target.position; + if(!m_PositionReached) + { + Callable.Call(OnReachPosition, this.gameObject); + m_PositionReached = true; + } + } + else + { + var delta = m_Target.position - transform.position; + var speed = Time.deltaTime * Mathf.Min((Dampen * delta.magnitude), MaximumVelocity); + gameObject.transform.position += delta.normalized * speed; + m_PositionReached = false; + } + } + } + + public void SetTarget(Transform target) + { + m_Target = target; + } + + } +} diff --git a/LocalPackages/net.peeweek.gameplay-ingredients/Runtime/Ingredients/Rigs/ReachPositionRig.cs.meta b/LocalPackages/net.peeweek.gameplay-ingredients/Runtime/Ingredients/Rigs/ReachPositionRig.cs.meta new file mode 100644 index 0000000..8400014 --- /dev/null +++ b/LocalPackages/net.peeweek.gameplay-ingredients/Runtime/Ingredients/Rigs/ReachPositionRig.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 53b9918e021cd6a4bb3acd7bf43cb3d1 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {fileID: 2800000, guid: 8957eefd6c14dd24fae1bd3c7fb3309b, type: 3} + userData: + assetBundleName: + assetBundleVariant: diff --git a/LocalPackages/net.peeweek.gameplay-ingredients/Runtime/Ingredients/Rigs/RigidBodyForceRig.cs b/LocalPackages/net.peeweek.gameplay-ingredients/Runtime/Ingredients/Rigs/RigidBodyForceRig.cs new file mode 100644 index 0000000..e9c4bba --- /dev/null +++ b/LocalPackages/net.peeweek.gameplay-ingredients/Runtime/Ingredients/Rigs/RigidBodyForceRig.cs @@ -0,0 +1,128 @@ +using NaughtyAttributes; +using System.Collections; +using System.Collections.Generic; +using UnityEngine; + +namespace GameplayIngredients.Rigs +{ + [RequireComponent(typeof(Rigidbody))] + public class RigidBodyForceRig : MonoBehaviour + { + private Rigidbody m_RigidBody; + + public enum EffectorType + { + Force, + ForceAtPosition, + RelativeForce, + Torque, + RelativeTorque, + Explosion + } + + [BoxGroup("Configuration"), Tooltip("The kind of force to apply")] + public EffectorType type; + [BoxGroup("Configuration"), Tooltip("How to compute the force applied every frame")] + public ForceMode forceMode; + + [BoxGroup("Force Properties"),Tooltip("The force or torque vector"), ShowIf("isNotExplosion")] + public Vector3 vector; + [BoxGroup("Force Properties"), Tooltip("The force or explosion position"), ShowIf("needPosition")] + public Vector3 position; + [BoxGroup("Force Properties"), Tooltip("The force scale over time")] + public AnimationCurve ForceOverTime = new AnimationCurve(new Keyframe(0, 1), new Keyframe(1, 1)); + + [BoxGroup("Force Properties"), ShowIf("isExplosion")] + public float explosionForce; + [BoxGroup("Force Properties"), ShowIf("isExplosion")] + public float explosionRadius; + [BoxGroup("Force Properties"), ShowIf("isExplosion")] + public float upwardsModifier; + + [BoxGroup("Noise")] + public bool AddNoise = false; + [BoxGroup("Noise")] + public Vector3 NoiseScale = Vector3.one; + + private float m_Time; + [SerializeField] + private float m_RandomSeed; + + private void Start() + { + m_RandomSeed = Random.Range(-100, +100); + } + + bool needPosition() + { + return type == EffectorType.ForceAtPosition || type == EffectorType.Explosion; + } + + bool isExplosion() + { + return type == EffectorType.Explosion; + } + + bool isNotExplosion() + { + return !isExplosion(); + } + + private void OnEnable() + { + m_RigidBody = GetComponent(); + m_Time = 0.0f; + } + + Vector3 GetNoise() + { + var noise = new Vector3( + Mathf.PerlinNoise(m_RandomSeed - 11.42f, m_Time + m_RandomSeed + 24.71f), + Mathf.PerlinNoise(m_RandomSeed + 17.3f, m_Time + m_RandomSeed - 1.08f), + Mathf.PerlinNoise(m_RandomSeed - 0.07f, m_Time + m_RandomSeed + 43.12f) + ) * 2.0f-Vector3.one; + noise.Scale(NoiseScale); + return noise; + } + + public void Update() + { + if (m_RigidBody == null) + return; + + m_Time += Time.deltaTime; + + Vector3 force = vector; + float attenuation = ForceOverTime.Evaluate(m_Time); + if(AddNoise) + { + force += GetNoise(); + } + force *= attenuation; + + switch (type) + { + default: + case EffectorType.Force: + m_RigidBody.AddForce(force, forceMode); + break; + case EffectorType.ForceAtPosition: + m_RigidBody.AddForceAtPosition(force, position, forceMode); + break; + case EffectorType.RelativeForce: + m_RigidBody.AddRelativeForce(force, forceMode); + break; + case EffectorType.Torque: + m_RigidBody.AddTorque(force, forceMode); + break; + case EffectorType.RelativeTorque: + m_RigidBody.AddRelativeTorque(force, forceMode); + break; + case EffectorType.Explosion: + m_RigidBody.AddExplosionForce(explosionForce * attenuation, position, explosionRadius, upwardsModifier, forceMode); + break; + } + } + + } +} diff --git a/LocalPackages/net.peeweek.gameplay-ingredients/Runtime/Ingredients/Rigs/RigidBodyForceRig.cs.meta b/LocalPackages/net.peeweek.gameplay-ingredients/Runtime/Ingredients/Rigs/RigidBodyForceRig.cs.meta new file mode 100644 index 0000000..5ce2b0f --- /dev/null +++ b/LocalPackages/net.peeweek.gameplay-ingredients/Runtime/Ingredients/Rigs/RigidBodyForceRig.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 416292aabe867894e8dc3ecfbbf234a8 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {fileID: 2800000, guid: 156c6b396de456546beacc0bd53b6e07, type: 3} + userData: + assetBundleName: + assetBundleVariant: diff --git a/LocalPackages/net.peeweek.gameplay-ingredients/Runtime/Ingredients/Rigs/RotationRig.cs b/LocalPackages/net.peeweek.gameplay-ingredients/Runtime/Ingredients/Rigs/RotationRig.cs new file mode 100644 index 0000000..cbf1904 --- /dev/null +++ b/LocalPackages/net.peeweek.gameplay-ingredients/Runtime/Ingredients/Rigs/RotationRig.cs @@ -0,0 +1,16 @@ +using UnityEngine; + +namespace GameplayIngredients.Rigs +{ + public class RotationRig : MonoBehaviour + { + public Space Space = Space.World; + public Vector3 RotationAxis = Vector3.up; + public float RotationSpeed = 30.0f; + + void Update() + { + transform.Rotate(RotationAxis.normalized, RotationSpeed * Time.deltaTime, Space); + } + } +} diff --git a/LocalPackages/net.peeweek.gameplay-ingredients/Runtime/Ingredients/Rigs/RotationRig.cs.meta b/LocalPackages/net.peeweek.gameplay-ingredients/Runtime/Ingredients/Rigs/RotationRig.cs.meta new file mode 100644 index 0000000..768736f --- /dev/null +++ b/LocalPackages/net.peeweek.gameplay-ingredients/Runtime/Ingredients/Rigs/RotationRig.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 7ead6aa8f9c07e741bb74522b9da712b +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {fileID: 2800000, guid: e66ad50918d3fec48bbe63e19e4a881f, type: 3} + userData: + assetBundleName: + assetBundleVariant: diff --git a/LocalPackages/net.peeweek.gameplay-ingredients/Runtime/Ingredients/StateMachine.meta b/LocalPackages/net.peeweek.gameplay-ingredients/Runtime/Ingredients/StateMachine.meta new file mode 100644 index 0000000..a573d3d --- /dev/null +++ b/LocalPackages/net.peeweek.gameplay-ingredients/Runtime/Ingredients/StateMachine.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 2d27866eac2ee3e408bb9e7d843a1bd9 +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/LocalPackages/net.peeweek.gameplay-ingredients/Runtime/Ingredients/StateMachine/SetStateAction.cs b/LocalPackages/net.peeweek.gameplay-ingredients/Runtime/Ingredients/StateMachine/SetStateAction.cs new file mode 100644 index 0000000..20085a9 --- /dev/null +++ b/LocalPackages/net.peeweek.gameplay-ingredients/Runtime/Ingredients/StateMachine/SetStateAction.cs @@ -0,0 +1,28 @@ +using System.Collections; +using System.Collections.Generic; +using UnityEngine; +using GameplayIngredients.StateMachines; + +namespace GameplayIngredients.Actions +{ + public class SetStateAction : ActionBase + { + [NonNullCheck] + public StateMachine StateMachine; + + public string state + { + get { return m_State; } + set { m_State = value; } + } + + [SerializeField, StateMachineState("StateMachine")] + protected string m_State = "State"; + + public override void Execute(GameObject instigator = null) + { + if(StateMachine != null) + StateMachine.SetState(m_State); + } + } +} diff --git a/LocalPackages/net.peeweek.gameplay-ingredients/Runtime/Ingredients/StateMachine/SetStateAction.cs.meta b/LocalPackages/net.peeweek.gameplay-ingredients/Runtime/Ingredients/StateMachine/SetStateAction.cs.meta new file mode 100644 index 0000000..f8e6fec --- /dev/null +++ b/LocalPackages/net.peeweek.gameplay-ingredients/Runtime/Ingredients/StateMachine/SetStateAction.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 313f9593d35b2c740928abbd82069aa0 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {fileID: 2800000, guid: 7bae8630e4a1b2040b3db5d53120c9a8, type: 3} + userData: + assetBundleName: + assetBundleVariant: diff --git a/LocalPackages/net.peeweek.gameplay-ingredients/Runtime/Ingredients/StateMachine/State.cs b/LocalPackages/net.peeweek.gameplay-ingredients/Runtime/Ingredients/StateMachine/State.cs new file mode 100644 index 0000000..606f999 --- /dev/null +++ b/LocalPackages/net.peeweek.gameplay-ingredients/Runtime/Ingredients/StateMachine/State.cs @@ -0,0 +1,22 @@ +using NaughtyAttributes; +using UnityEngine; + +namespace GameplayIngredients.StateMachines +{ + public class State : MonoBehaviour + { + public string StateName { get { return gameObject.name; } } + + [ReorderableList] + public Callable[] OnStateEnter; + [ReorderableList] + public Callable[] OnStateExit; + [ReorderableList, ShowIf("AllowUpdateCalls")] + public Callable[] OnStateUpdate; + + private bool AllowUpdateCalls() + { + return GameplayIngredientsSettings.currentSettings.allowUpdateCalls; + } + } +} diff --git a/LocalPackages/net.peeweek.gameplay-ingredients/Runtime/Ingredients/StateMachine/State.cs.meta b/LocalPackages/net.peeweek.gameplay-ingredients/Runtime/Ingredients/StateMachine/State.cs.meta new file mode 100644 index 0000000..8dfb50b --- /dev/null +++ b/LocalPackages/net.peeweek.gameplay-ingredients/Runtime/Ingredients/StateMachine/State.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: bcc3d684aff0c5b4290e088e4b8a735e +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {fileID: 2800000, guid: 9a6d608cab373164f8112f6cc8ae6255, type: 3} + userData: + assetBundleName: + assetBundleVariant: diff --git a/LocalPackages/net.peeweek.gameplay-ingredients/Runtime/Ingredients/StateMachine/StateMachine.cs b/LocalPackages/net.peeweek.gameplay-ingredients/Runtime/Ingredients/StateMachine/StateMachine.cs new file mode 100644 index 0000000..94a0cbe --- /dev/null +++ b/LocalPackages/net.peeweek.gameplay-ingredients/Runtime/Ingredients/StateMachine/StateMachine.cs @@ -0,0 +1,80 @@ +using NaughtyAttributes; +using System.Linq; +using System.Collections.Generic; +using UnityEngine; + +namespace GameplayIngredients.StateMachines +{ + public class StateMachine : MonoBehaviour + { + [StateMachineState] + public string DefaultState; + + [ReorderableList, NonNullCheck] + public State[] States; + + public State CurrentState { get { return m_CurrentState; } } + + State m_CurrentState; + + [ContextMenu("Reset State Objects")] + private void UpdateFromState() + { + foreach(var state in States) + { + state.gameObject.SetActive(state == States.FirstOrDefault(o => o.StateName == DefaultState)); + } + } + + void Start() + { + foreach (var state in States) + { + if(state.gameObject.activeSelf) + state.gameObject.SetActive(false); + } + + SetState(DefaultState); + } + + public void SetState(string stateName) + { + State newState = States.FirstOrDefault(o => o.StateName == stateName); + + if(newState != null) + { + if (m_CurrentState != null) + { + // Call Exit Actions + Callable.Call(m_CurrentState.OnStateExit, gameObject); + // Then finally disable old state + m_CurrentState.gameObject.SetActive(false); + } + + // Switch Active new state + newState.gameObject.SetActive(true); + + // Then Set new current state + m_CurrentState = newState; + + // Finally, call State enter + Callable.Call(m_CurrentState.OnStateEnter, gameObject); + } + else + Debug.LogWarning(string.Format("{0} : Trying to set unknown state {1}", gameObject.name, stateName), gameObject); + } + + void Update() + { + if (GameplayIngredientsSettings.currentSettings.allowUpdateCalls + && m_CurrentState != null + && m_CurrentState.OnStateUpdate != null + && m_CurrentState.OnStateUpdate.Length > 0) + { + Callable.Call(m_CurrentState.OnStateUpdate, this.gameObject); + } + } + + } +} + diff --git a/LocalPackages/net.peeweek.gameplay-ingredients/Runtime/Ingredients/StateMachine/StateMachine.cs.meta b/LocalPackages/net.peeweek.gameplay-ingredients/Runtime/Ingredients/StateMachine/StateMachine.cs.meta new file mode 100644 index 0000000..d826b96 --- /dev/null +++ b/LocalPackages/net.peeweek.gameplay-ingredients/Runtime/Ingredients/StateMachine/StateMachine.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 0219af91f351df2429e921b320124912 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {fileID: 2800000, guid: 67330c23d0e574745a580a19a9fa187c, type: 3} + userData: + assetBundleName: + assetBundleVariant: diff --git a/LocalPackages/net.peeweek.gameplay-ingredients/Runtime/Ingredients/Timer.meta b/LocalPackages/net.peeweek.gameplay-ingredients/Runtime/Ingredients/Timer.meta new file mode 100644 index 0000000..47543b0 --- /dev/null +++ b/LocalPackages/net.peeweek.gameplay-ingredients/Runtime/Ingredients/Timer.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 1ebdbde62aaa7554e927640949440236 +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/LocalPackages/net.peeweek.gameplay-ingredients/Runtime/Ingredients/Timer/Timer.cs b/LocalPackages/net.peeweek.gameplay-ingredients/Runtime/Ingredients/Timer/Timer.cs new file mode 100644 index 0000000..7809cf5 --- /dev/null +++ b/LocalPackages/net.peeweek.gameplay-ingredients/Runtime/Ingredients/Timer/Timer.cs @@ -0,0 +1,74 @@ +using NaughtyAttributes; +using System.Collections; +using System.Collections.Generic; +using UnityEngine; + +namespace GameplayIngredients +{ + public class Timer : MonoBehaviour + { + public bool StartOnEnable = false; + + public uint Hours = 0; + [Range(0,59)] + public uint Minutes = 1; + [Range(0,59)] + public uint Seconds = 30; + [Range(0,999)] + public uint Milliseconds = 0; + + public uint CurrentHours { get { return (uint)Mathf.Floor(m_TTL / 3600); } } + public uint CurrentMinutes { get { return (uint)Mathf.Floor(m_TTL / 60) % 60; } } + public uint CurrentSeconds { get { return (uint)Mathf.Floor(m_TTL) % 60; } } + public uint CurrentMilliseconds { get { return (uint)((m_TTL % 1.0f) * 1000); } } + + + [ReorderableList] + public Callable[] OnTimerFinished; + [ReorderableList] + public Callable[] OnTimerInterrupt; + [ReorderableList] + public Callable[] OnTimerStart; + + float m_TTL = 0.0f; + + public bool isRunning => m_TTL > 0.0f; + + public void OnEnable() + { + if (StartOnEnable) + Restart(); + else + m_TTL = 0.0f; + } + + + public void Restart(GameObject instigator = null) + { + m_TTL = Hours * 3600 + Minutes * 60 + Seconds + Milliseconds * 0.001f; + Callable.Call(OnTimerStart, instigator); + } + + public void Update() + { + if(m_TTL > 0.0f) + { + m_TTL -= Time.deltaTime; + if (m_TTL <= 0.0f) + { + m_TTL = 0.0f; + Callable.Call(OnTimerFinished); + } + } + } + + public void Interrupt(GameObject instigator = null) + { + if(m_TTL > 0.0f) + { + m_TTL = 0.0f; + Callable.Call(OnTimerInterrupt, instigator); + } + } + } +} diff --git a/LocalPackages/net.peeweek.gameplay-ingredients/Runtime/Ingredients/Timer/Timer.cs.meta b/LocalPackages/net.peeweek.gameplay-ingredients/Runtime/Ingredients/Timer/Timer.cs.meta new file mode 100644 index 0000000..2e2721f --- /dev/null +++ b/LocalPackages/net.peeweek.gameplay-ingredients/Runtime/Ingredients/Timer/Timer.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 3c7830caa27694f488f509f2dff31323 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {fileID: 2800000, guid: 4ad9148371bb28f44a21256b05f6ecae, type: 3} + userData: + assetBundleName: + assetBundleVariant: diff --git a/LocalPackages/net.peeweek.gameplay-ingredients/Runtime/Ingredients/Timer/TimerAction.cs b/LocalPackages/net.peeweek.gameplay-ingredients/Runtime/Ingredients/Timer/TimerAction.cs new file mode 100644 index 0000000..fb66663 --- /dev/null +++ b/LocalPackages/net.peeweek.gameplay-ingredients/Runtime/Ingredients/Timer/TimerAction.cs @@ -0,0 +1,69 @@ +using NaughtyAttributes; +using System.Collections; +using System.Collections.Generic; +using UnityEngine; + +namespace GameplayIngredients.Actions +{ + public class TimerAction : ActionBase + { + public enum Action + { + Start, + SetTime, + Interrupt + } + + [NonNullCheck] + public Timer timer; + public Action action = Action.Start; + + [ShowIf("isSetTime")] + public uint Hours = 0; + [ShowIf("isSetTime"), Range(0,59)] + public uint Minutes = 1; + [ShowIf("isSetTime"), Range(0,59)] + public uint Seconds = 30; + [ShowIf("isSetTime"), Range(0, 999)] + public uint Milliseconds = 0; + [ShowIf("isSetTime")] + public bool Restart = false; + + + public override void Execute(GameObject instigator = null) + { + if(timer == null) + { + Debug.LogWarning($"{this.gameObject.name}:{this.name} : Null Timer"); + } + else + { + switch (action) + { + default: + case Action.Start: + timer.Restart(instigator); + break; + case Action.SetTime: + if (timer.isRunning) + timer.Interrupt(instigator); + + timer.Hours = Hours; + timer.Minutes = Minutes; + timer.Seconds = Seconds; + timer.Milliseconds = Milliseconds; + + if (Restart) + timer.Restart(instigator); + break; + case Action.Interrupt: + timer.Interrupt(instigator); + break; + } + } + } + + bool isSetTime() { return action == Action.SetTime; } + } +} + diff --git a/LocalPackages/net.peeweek.gameplay-ingredients/Runtime/Ingredients/Timer/TimerAction.cs.meta b/LocalPackages/net.peeweek.gameplay-ingredients/Runtime/Ingredients/Timer/TimerAction.cs.meta new file mode 100644 index 0000000..dca76ca --- /dev/null +++ b/LocalPackages/net.peeweek.gameplay-ingredients/Runtime/Ingredients/Timer/TimerAction.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 198dc0c7b790e2240b7322b532cbdf83 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {fileID: 2800000, guid: 4ad9148371bb28f44a21256b05f6ecae, type: 3} + userData: + assetBundleName: + assetBundleVariant: diff --git a/LocalPackages/net.peeweek.gameplay-ingredients/Runtime/Ingredients/Timer/TimerDisplayRig.cs b/LocalPackages/net.peeweek.gameplay-ingredients/Runtime/Ingredients/Timer/TimerDisplayRig.cs new file mode 100644 index 0000000..3af35bb --- /dev/null +++ b/LocalPackages/net.peeweek.gameplay-ingredients/Runtime/Ingredients/Timer/TimerDisplayRig.cs @@ -0,0 +1,63 @@ +using System.Collections; +using System.Collections.Generic; +using UnityEngine; +using UnityEngine.UI; +using NaughtyAttributes; + +namespace GameplayIngredients +{ + public class TimerDisplayRig : MonoBehaviour + { + [NonNullCheck] + public Text text; + [NonNullCheck] + public TextMesh textMesh; + + + [NonNullCheck] + public Timer timer; + + [InfoBox("Use the following wildcards:\n - %h : hours\n - %m : minutes\n - %s : seconds\n - %x : milliseconds", InfoBoxType.Normal)] + public string format = "%h:%m:%s:%x"; + + private void OnValidate() + { + UpdateText(); + } + + private void Reset() + { + UpdateText(); + } + + private void Update() + { + if (timer == null || (text == null && textMesh == null)) + return; + + UpdateText(); + } + + void UpdateText() + { + var value = format; + + uint hours = timer != null ? timer.CurrentHours: 0; + uint minutes = timer != null ? timer.CurrentMinutes : 0; + uint seconds = timer != null ? timer.CurrentSeconds : 0; + uint milliseconds = timer != null ? timer.CurrentMilliseconds : 0; + + value = value.Replace("%h", hours.ToString("D2")); + value = value.Replace("%m", minutes.ToString("D2")); + value = value.Replace("%s", seconds.ToString("D2")); + value = value.Replace("%x", milliseconds.ToString("D3")); + + if (text != null) + text.text = value; + + if (textMesh != null) + textMesh.text = value; + } + } +} + diff --git a/LocalPackages/net.peeweek.gameplay-ingredients/Runtime/Ingredients/Timer/TimerDisplayRig.cs.meta b/LocalPackages/net.peeweek.gameplay-ingredients/Runtime/Ingredients/Timer/TimerDisplayRig.cs.meta new file mode 100644 index 0000000..68b780c --- /dev/null +++ b/LocalPackages/net.peeweek.gameplay-ingredients/Runtime/Ingredients/Timer/TimerDisplayRig.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: e2522200da7627a458c971072a53bf5b +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {fileID: 2800000, guid: 4ad9148371bb28f44a21256b05f6ecae, type: 3} + userData: + assetBundleName: + assetBundleVariant: diff --git a/LocalPackages/net.peeweek.gameplay-ingredients/Runtime/LevelScripting.meta b/LocalPackages/net.peeweek.gameplay-ingredients/Runtime/LevelScripting.meta new file mode 100644 index 0000000..35953bf --- /dev/null +++ b/LocalPackages/net.peeweek.gameplay-ingredients/Runtime/LevelScripting.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 4cdce803110994d49874b4c1ebc1c108 +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/LocalPackages/net.peeweek.gameplay-ingredients/Runtime/Actions.meta b/LocalPackages/net.peeweek.gameplay-ingredients/Runtime/LevelScripting/Actions.meta similarity index 100% rename from LocalPackages/net.peeweek.gameplay-ingredients/Runtime/Actions.meta rename to LocalPackages/net.peeweek.gameplay-ingredients/Runtime/LevelScripting/Actions.meta diff --git a/LocalPackages/net.peeweek.gameplay-ingredients/Runtime/LevelScripting/Actions/ActionBase.cs b/LocalPackages/net.peeweek.gameplay-ingredients/Runtime/LevelScripting/Actions/ActionBase.cs new file mode 100644 index 0000000..3ddeeb9 --- /dev/null +++ b/LocalPackages/net.peeweek.gameplay-ingredients/Runtime/LevelScripting/Actions/ActionBase.cs @@ -0,0 +1,12 @@ +using UnityEngine; + +namespace GameplayIngredients.Actions +{ + public abstract class ActionBase : Callable + { + public override sealed string ToString() + { + return "Action : " + Name; + } + } +} diff --git a/LocalPackages/net.peeweek.gameplay-ingredients/Runtime/LevelScripting/Actions/ActionBase.cs.meta b/LocalPackages/net.peeweek.gameplay-ingredients/Runtime/LevelScripting/Actions/ActionBase.cs.meta new file mode 100644 index 0000000..252f964 --- /dev/null +++ b/LocalPackages/net.peeweek.gameplay-ingredients/Runtime/LevelScripting/Actions/ActionBase.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 446b3e7e2cf55584fa1555b54658d4ab +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {fileID: 2800000, guid: 87355f4718c07b542b49dd0fe0abe447, type: 3} + userData: + assetBundleName: + assetBundleVariant: diff --git a/LocalPackages/net.peeweek.gameplay-ingredients/Runtime/Actions/ApplicationExitAction.cs b/LocalPackages/net.peeweek.gameplay-ingredients/Runtime/LevelScripting/Actions/ApplicationExitAction.cs similarity index 53% rename from LocalPackages/net.peeweek.gameplay-ingredients/Runtime/Actions/ApplicationExitAction.cs rename to LocalPackages/net.peeweek.gameplay-ingredients/Runtime/LevelScripting/Actions/ApplicationExitAction.cs index 01be258..043a83a 100644 --- a/LocalPackages/net.peeweek.gameplay-ingredients/Runtime/Actions/ApplicationExitAction.cs +++ b/LocalPackages/net.peeweek.gameplay-ingredients/Runtime/LevelScripting/Actions/ApplicationExitAction.cs @@ -4,9 +4,13 @@ namespace GameplayIngredients.Actions { public class ApplicationExitAction : ActionBase { - public override void Execute() + public override void Execute(GameObject instigator = null) { +#if UNITY_EDITOR + UnityEditor.EditorApplication.ExitPlaymode(); +#else Application.Quit(); +#endif } } } diff --git a/LocalPackages/net.peeweek.gameplay-ingredients/Runtime/LevelScripting/Actions/ApplicationExitAction.cs.meta b/LocalPackages/net.peeweek.gameplay-ingredients/Runtime/LevelScripting/Actions/ApplicationExitAction.cs.meta new file mode 100644 index 0000000..53b0466 --- /dev/null +++ b/LocalPackages/net.peeweek.gameplay-ingredients/Runtime/LevelScripting/Actions/ApplicationExitAction.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: ec5c4aa8c38a45743b935b39eceb9b44 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {fileID: 2800000, guid: d8d829f83095c314fa81326a7695d5df, type: 3} + userData: + assetBundleName: + assetBundleVariant: diff --git a/LocalPackages/net.peeweek.gameplay-ingredients/Runtime/LevelScripting/Actions/AttachToObjectAction.cs b/LocalPackages/net.peeweek.gameplay-ingredients/Runtime/LevelScripting/Actions/AttachToObjectAction.cs new file mode 100644 index 0000000..0ef67ca --- /dev/null +++ b/LocalPackages/net.peeweek.gameplay-ingredients/Runtime/LevelScripting/Actions/AttachToObjectAction.cs @@ -0,0 +1,54 @@ +using NaughtyAttributes; +using System.Collections; +using System.Collections.Generic; +using UnityEngine; + +namespace GameplayIngredients.Actions +{ + public class AttachToObjectAction : ActionBase + { + public enum Action + { + Attach, + Detach, + ToggleAttachment + } + + public Action action = Action.Attach; + + [ReorderableList] + public GameObject[] objectsToAttach; + public bool AttachInstigator = false; + public GameObject parentObject; + public bool KeepScale; + + public override void Execute(GameObject instigator = null) + { + if (parentObject == null) + { + Debug.LogWarning("No Object to attach to."); + return; + } + if (objectsToAttach != null) + { + foreach (var obj in objectsToAttach) + DoAttach(obj, parentObject, action, KeepScale); + } + if (AttachInstigator && instigator != null) + DoAttach(instigator, parentObject, action, KeepScale); + + } + + static void DoAttach(GameObject attachment, GameObject parent, Action action, bool keepScale) + { + if(action == Action.Attach || (action == Action.ToggleAttachment && attachment.transform.parent != parent.transform)) + { + attachment.transform.parent = parent.transform; + } + else if(action == Action.Detach || (action == Action.ToggleAttachment && attachment.transform.parent == parent.transform)) + { + attachment.transform.parent = null; + } + } + } +} diff --git a/LocalPackages/net.peeweek.gameplay-ingredients/Runtime/LevelScripting/Actions/AttachToObjectAction.cs.meta b/LocalPackages/net.peeweek.gameplay-ingredients/Runtime/LevelScripting/Actions/AttachToObjectAction.cs.meta new file mode 100644 index 0000000..db6f99b --- /dev/null +++ b/LocalPackages/net.peeweek.gameplay-ingredients/Runtime/LevelScripting/Actions/AttachToObjectAction.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: aed55c2329e1acb4f9941668ae341432 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {fileID: 2800000, guid: e957d738ff2156b45854b449d363494b, type: 3} + userData: + assetBundleName: + assetBundleVariant: diff --git a/LocalPackages/net.peeweek.gameplay-ingredients/Runtime/Actions/AudioMixParameterAction.cs b/LocalPackages/net.peeweek.gameplay-ingredients/Runtime/LevelScripting/Actions/AudioMixParameterAction.cs similarity index 96% rename from LocalPackages/net.peeweek.gameplay-ingredients/Runtime/Actions/AudioMixParameterAction.cs rename to LocalPackages/net.peeweek.gameplay-ingredients/Runtime/LevelScripting/Actions/AudioMixParameterAction.cs index 1c7c1f4..9bfd3d4 100644 --- a/LocalPackages/net.peeweek.gameplay-ingredients/Runtime/Actions/AudioMixParameterAction.cs +++ b/LocalPackages/net.peeweek.gameplay-ingredients/Runtime/LevelScripting/Actions/AudioMixParameterAction.cs @@ -17,7 +17,7 @@ namespace GameplayIngredients.Actions public UnityEvent OnInterpComplete; Coroutine m_Coroutine; - public override void Execute() + public override void Execute(GameObject instigator = null) { if (InterpDuration <= 0.0f) { diff --git a/LocalPackages/net.peeweek.gameplay-ingredients/Runtime/LevelScripting/Actions/AudioMixParameterAction.cs.meta b/LocalPackages/net.peeweek.gameplay-ingredients/Runtime/LevelScripting/Actions/AudioMixParameterAction.cs.meta new file mode 100644 index 0000000..04a8193 --- /dev/null +++ b/LocalPackages/net.peeweek.gameplay-ingredients/Runtime/LevelScripting/Actions/AudioMixParameterAction.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 3e93b674f69eb054c8514bd7c501f0e3 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {fileID: 2800000, guid: bdcc63f36a8ac6643bbfb90bb398716a, type: 3} + userData: + assetBundleName: + assetBundleVariant: diff --git a/LocalPackages/net.peeweek.gameplay-ingredients/Runtime/Actions/AudioMixParameterCurveAction.cs b/LocalPackages/net.peeweek.gameplay-ingredients/Runtime/LevelScripting/Actions/AudioMixParameterCurveAction.cs similarity index 94% rename from LocalPackages/net.peeweek.gameplay-ingredients/Runtime/Actions/AudioMixParameterCurveAction.cs rename to LocalPackages/net.peeweek.gameplay-ingredients/Runtime/LevelScripting/Actions/AudioMixParameterCurveAction.cs index 2ea511a..ee7fc37 100644 --- a/LocalPackages/net.peeweek.gameplay-ingredients/Runtime/Actions/AudioMixParameterCurveAction.cs +++ b/LocalPackages/net.peeweek.gameplay-ingredients/Runtime/LevelScripting/Actions/AudioMixParameterCurveAction.cs @@ -16,7 +16,7 @@ namespace GameplayIngredients.Actions public UnityEvent OnInterpComplete; Coroutine m_Coroutine; - public override void Execute() + public override void Execute(GameObject instigator = null) { if (m_Coroutine != null) diff --git a/LocalPackages/net.peeweek.gameplay-ingredients/Runtime/LevelScripting/Actions/AudioMixParameterCurveAction.cs.meta b/LocalPackages/net.peeweek.gameplay-ingredients/Runtime/LevelScripting/Actions/AudioMixParameterCurveAction.cs.meta new file mode 100644 index 0000000..58fb353 --- /dev/null +++ b/LocalPackages/net.peeweek.gameplay-ingredients/Runtime/LevelScripting/Actions/AudioMixParameterCurveAction.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 483b9101733f40747b8c858a4e30c737 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {fileID: 2800000, guid: bdcc63f36a8ac6643bbfb90bb398716a, type: 3} + userData: + assetBundleName: + assetBundleVariant: diff --git a/LocalPackages/net.peeweek.gameplay-ingredients/Runtime/LevelScripting/Actions/AudioMixSnapshotAction.cs b/LocalPackages/net.peeweek.gameplay-ingredients/Runtime/LevelScripting/Actions/AudioMixSnapshotAction.cs new file mode 100644 index 0000000..bd83921 --- /dev/null +++ b/LocalPackages/net.peeweek.gameplay-ingredients/Runtime/LevelScripting/Actions/AudioMixSnapshotAction.cs @@ -0,0 +1,20 @@ +using System.Collections; +using System.Collections.Generic; +using UnityEngine; +using GameplayIngredients; +using GameplayIngredients.Actions; +using UnityEngine.Audio; + +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); + } +} diff --git a/LocalPackages/net.peeweek.gameplay-ingredients/Runtime/LevelScripting/Actions/AudioMixSnapshotAction.cs.meta b/LocalPackages/net.peeweek.gameplay-ingredients/Runtime/LevelScripting/Actions/AudioMixSnapshotAction.cs.meta new file mode 100644 index 0000000..a1a77d2 --- /dev/null +++ b/LocalPackages/net.peeweek.gameplay-ingredients/Runtime/LevelScripting/Actions/AudioMixSnapshotAction.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 0b9f0f69fcd64a844806009285029727 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {fileID: 2800000, guid: bdcc63f36a8ac6643bbfb90bb398716a, type: 3} + userData: + assetBundleName: + assetBundleVariant: diff --git a/LocalPackages/net.peeweek.gameplay-ingredients/Runtime/LevelScripting/Actions/AudioPlayClipAction.cs b/LocalPackages/net.peeweek.gameplay-ingredients/Runtime/LevelScripting/Actions/AudioPlayClipAction.cs new file mode 100644 index 0000000..fd88c4d --- /dev/null +++ b/LocalPackages/net.peeweek.gameplay-ingredients/Runtime/LevelScripting/Actions/AudioPlayClipAction.cs @@ -0,0 +1,28 @@ +using System.Collections; +using System; +using UnityEngine; +using UnityEngine.Audio; +using UnityEngine.Events; + +namespace GameplayIngredients.Actions +{ + public class AudioPlayClipAction : ActionBase + { + public AudioClip Clip; + public AudioSource Source; + + public override void Execute(GameObject instigator = null) + { + if (Source != null) + { + Source.Stop(); + + if (Clip != null) + Source.clip = Clip; + + Source.Play(); + } + } + + } +} diff --git a/LocalPackages/net.peeweek.gameplay-ingredients/Runtime/LevelScripting/Actions/AudioPlayClipAction.cs.meta b/LocalPackages/net.peeweek.gameplay-ingredients/Runtime/LevelScripting/Actions/AudioPlayClipAction.cs.meta new file mode 100644 index 0000000..673bec2 --- /dev/null +++ b/LocalPackages/net.peeweek.gameplay-ingredients/Runtime/LevelScripting/Actions/AudioPlayClipAction.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 28a2beba7cb33a243b449d62cbe62962 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {fileID: 2800000, guid: bdcc63f36a8ac6643bbfb90bb398716a, type: 3} + userData: + assetBundleName: + assetBundleVariant: diff --git a/LocalPackages/net.peeweek.gameplay-ingredients/Runtime/Actions/CursorAction.cs b/LocalPackages/net.peeweek.gameplay-ingredients/Runtime/LevelScripting/Actions/CursorAction.cs similarity index 83% rename from LocalPackages/net.peeweek.gameplay-ingredients/Runtime/Actions/CursorAction.cs rename to LocalPackages/net.peeweek.gameplay-ingredients/Runtime/LevelScripting/Actions/CursorAction.cs index 1683fe4..02724ca 100644 --- a/LocalPackages/net.peeweek.gameplay-ingredients/Runtime/Actions/CursorAction.cs +++ b/LocalPackages/net.peeweek.gameplay-ingredients/Runtime/LevelScripting/Actions/CursorAction.cs @@ -7,7 +7,7 @@ namespace GameplayIngredients.Actions public CursorLockMode LockState = CursorLockMode.None; public bool CursorVisible = true; - public override void Execute() + public override void Execute(GameObject instigator = null) { Cursor.lockState = LockState; Cursor.visible = CursorVisible; diff --git a/LocalPackages/net.peeweek.gameplay-ingredients/Runtime/Actions/CursorAction.cs.meta b/LocalPackages/net.peeweek.gameplay-ingredients/Runtime/LevelScripting/Actions/CursorAction.cs.meta similarity index 74% rename from LocalPackages/net.peeweek.gameplay-ingredients/Runtime/Actions/CursorAction.cs.meta rename to LocalPackages/net.peeweek.gameplay-ingredients/Runtime/LevelScripting/Actions/CursorAction.cs.meta index 3575a6b..c5421da 100644 --- a/LocalPackages/net.peeweek.gameplay-ingredients/Runtime/Actions/CursorAction.cs.meta +++ b/LocalPackages/net.peeweek.gameplay-ingredients/Runtime/LevelScripting/Actions/CursorAction.cs.meta @@ -5,7 +5,7 @@ MonoImporter: serializedVersion: 2 defaultReferences: [] executionOrder: 0 - icon: {instanceID: 0} + icon: {fileID: 2800000, guid: ba45de1ff09adbf459f4db4bf50a8c14, type: 3} userData: assetBundleName: assetBundleVariant: diff --git a/LocalPackages/net.peeweek.gameplay-ingredients/Runtime/Actions/CycleResolutionsAction.cs b/LocalPackages/net.peeweek.gameplay-ingredients/Runtime/LevelScripting/Actions/CycleResolutionsAction.cs similarity index 96% rename from LocalPackages/net.peeweek.gameplay-ingredients/Runtime/Actions/CycleResolutionsAction.cs rename to LocalPackages/net.peeweek.gameplay-ingredients/Runtime/LevelScripting/Actions/CycleResolutionsAction.cs index 16e0129..4daa3fd 100644 --- a/LocalPackages/net.peeweek.gameplay-ingredients/Runtime/Actions/CycleResolutionsAction.cs +++ b/LocalPackages/net.peeweek.gameplay-ingredients/Runtime/LevelScripting/Actions/CycleResolutionsAction.cs @@ -23,9 +23,7 @@ namespace GameplayIngredients.Actions string getText(Resolution currentResolution) { - #if UNITY_EDITOR - return "No resolution switch in the editor"; - #endif + #if !UNITY_EDITOR if (currentResolution.width == 0 || currentResolution.height == 0) { @@ -34,6 +32,9 @@ namespace GameplayIngredients.Actions } return string.Format("Resolution: {0}X{1}", currentResolution.width, currentResolution.height); + #else + return "No resolution switch in the editor"; + #endif } Resolution[] availableResolutions; @@ -67,7 +68,7 @@ namespace GameplayIngredients.Actions ButtonLabel.text = getText(selectedResolution); } - public override void Execute() + public override void Execute(GameObject instigator = null) { // When we are in the editor we don't have any available resolutions if (availableResolutions.Length == 0) diff --git a/LocalPackages/net.peeweek.gameplay-ingredients/Runtime/Actions/CycleResolutionsAction.cs.meta b/LocalPackages/net.peeweek.gameplay-ingredients/Runtime/LevelScripting/Actions/CycleResolutionsAction.cs.meta similarity index 74% rename from LocalPackages/net.peeweek.gameplay-ingredients/Runtime/Actions/CycleResolutionsAction.cs.meta rename to LocalPackages/net.peeweek.gameplay-ingredients/Runtime/LevelScripting/Actions/CycleResolutionsAction.cs.meta index e4e8596..01eb70c 100644 --- a/LocalPackages/net.peeweek.gameplay-ingredients/Runtime/Actions/CycleResolutionsAction.cs.meta +++ b/LocalPackages/net.peeweek.gameplay-ingredients/Runtime/LevelScripting/Actions/CycleResolutionsAction.cs.meta @@ -5,7 +5,7 @@ MonoImporter: serializedVersion: 2 defaultReferences: [] executionOrder: 0 - icon: {instanceID: 0} + icon: {fileID: 2800000, guid: 4112ad68bb67a9646acd12615491fc97, type: 3} userData: assetBundleName: assetBundleVariant: diff --git a/LocalPackages/net.peeweek.gameplay-ingredients/Runtime/Actions/CycleWindowModeAction.cs b/LocalPackages/net.peeweek.gameplay-ingredients/Runtime/LevelScripting/Actions/CycleWindowModeAction.cs similarity index 92% rename from LocalPackages/net.peeweek.gameplay-ingredients/Runtime/Actions/CycleWindowModeAction.cs rename to LocalPackages/net.peeweek.gameplay-ingredients/Runtime/LevelScripting/Actions/CycleWindowModeAction.cs index 22126e8..1ad39a0 100644 --- a/LocalPackages/net.peeweek.gameplay-ingredients/Runtime/Actions/CycleWindowModeAction.cs +++ b/LocalPackages/net.peeweek.gameplay-ingredients/Runtime/LevelScripting/Actions/CycleWindowModeAction.cs @@ -25,7 +25,7 @@ namespace GameplayIngredients.Actions ButtonLabel.text = getText(Screen.fullScreen); } - public override void Execute() + public override void Execute(GameObject instigator = null) { Screen.fullScreen = !Screen.fullScreen; } diff --git a/LocalPackages/net.peeweek.gameplay-ingredients/Runtime/Actions/CycleWindowModeAction.cs.meta b/LocalPackages/net.peeweek.gameplay-ingredients/Runtime/LevelScripting/Actions/CycleWindowModeAction.cs.meta similarity index 74% rename from LocalPackages/net.peeweek.gameplay-ingredients/Runtime/Actions/CycleWindowModeAction.cs.meta rename to LocalPackages/net.peeweek.gameplay-ingredients/Runtime/LevelScripting/Actions/CycleWindowModeAction.cs.meta index b2419b8..1f464d5 100644 --- a/LocalPackages/net.peeweek.gameplay-ingredients/Runtime/Actions/CycleWindowModeAction.cs.meta +++ b/LocalPackages/net.peeweek.gameplay-ingredients/Runtime/LevelScripting/Actions/CycleWindowModeAction.cs.meta @@ -5,7 +5,7 @@ MonoImporter: serializedVersion: 2 defaultReferences: [] executionOrder: 0 - icon: {instanceID: 0} + icon: {fileID: 2800000, guid: 4112ad68bb67a9646acd12615491fc97, type: 3} userData: assetBundleName: assetBundleVariant: diff --git a/LocalPackages/net.peeweek.gameplay-ingredients/Runtime/LevelScripting/Actions/DestroyObjectAction.cs b/LocalPackages/net.peeweek.gameplay-ingredients/Runtime/LevelScripting/Actions/DestroyObjectAction.cs new file mode 100644 index 0000000..3f5d986 --- /dev/null +++ b/LocalPackages/net.peeweek.gameplay-ingredients/Runtime/LevelScripting/Actions/DestroyObjectAction.cs @@ -0,0 +1,24 @@ +using NaughtyAttributes; +using UnityEngine; + +namespace GameplayIngredients.Actions +{ + public class DestroyObjectAction : ActionBase + { + [ReorderableList] + public GameObject[] ObjectsToDestroy; + public bool DestroyInstigator = false; + + public override void Execute(GameObject instigator = null) + { + if (ObjectsToDestroy != null ) + { + foreach(var obj in ObjectsToDestroy) + Destroy(obj); + } + + if(DestroyInstigator && instigator != null) + Destroy(instigator); + } + } +} diff --git a/LocalPackages/net.peeweek.gameplay-ingredients/Runtime/LevelScripting/Actions/DestroyObjectAction.cs.meta b/LocalPackages/net.peeweek.gameplay-ingredients/Runtime/LevelScripting/Actions/DestroyObjectAction.cs.meta new file mode 100644 index 0000000..633e88e --- /dev/null +++ b/LocalPackages/net.peeweek.gameplay-ingredients/Runtime/LevelScripting/Actions/DestroyObjectAction.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 5e0d20f2fb594be42acf7e05001c2932 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {fileID: 2800000, guid: 4bf1ec536deee044a8648d196855a79a, type: 3} + userData: + assetBundleName: + assetBundleVariant: diff --git a/LocalPackages/net.peeweek.gameplay-ingredients/Runtime/LevelScripting/Actions/DirectorControlRigAction.cs b/LocalPackages/net.peeweek.gameplay-ingredients/Runtime/LevelScripting/Actions/DirectorControlRigAction.cs new file mode 100644 index 0000000..8143df2 --- /dev/null +++ b/LocalPackages/net.peeweek.gameplay-ingredients/Runtime/LevelScripting/Actions/DirectorControlRigAction.cs @@ -0,0 +1,58 @@ +using System.Collections; +using System.Collections.Generic; +using UnityEngine; +using UnityEngine.Timeline; +using GameplayIngredients.Rigs; + +namespace GameplayIngredients.Actions +{ + public class DirectorControlRigAction : ActionBase + { + [NonNullCheck] + public DirectorControlRig directorControlRig; + + [Header("Play Mode")] + public bool SetPlayMode = true; + public DirectorControlRig.PlayMode PlayMode = DirectorControlRig.PlayMode.Play; + + [Header("Wrap Mode")] + public bool SetWrapMode = false; + public DirectorControlRig.WrapMode WrapMode = DirectorControlRig.WrapMode.Loop; + + [Header("Time")] + public bool SetTime = false; + public float Time = 0.0f; + + public bool SetStopTime = false; + public float StopTime = 1.0f; + + [Header("Timeline Asset")] + public bool SetTimeline = false; + public TimelineAsset TimelineAsset; + + public override void Execute(GameObject instigator = null) + { + if (directorControlRig == null) + { + Debug.LogWarning("No DirectorControlRig set, ignoring Call", this.gameObject); + return; + } + + if (SetTime) + directorControlRig.time = Time; + + if (SetPlayMode) + directorControlRig.playMode = PlayMode; + + if (SetWrapMode) + directorControlRig.wrapMode = WrapMode; + + if (SetStopTime) + directorControlRig.stopTime = StopTime; + + if (SetTimeline) + directorControlRig.timeline = TimelineAsset; + + } + } +} diff --git a/LocalPackages/net.peeweek.gameplay-ingredients/Runtime/LevelScripting/Actions/DirectorControlRigAction.cs.meta b/LocalPackages/net.peeweek.gameplay-ingredients/Runtime/LevelScripting/Actions/DirectorControlRigAction.cs.meta new file mode 100644 index 0000000..ba1bfd6 --- /dev/null +++ b/LocalPackages/net.peeweek.gameplay-ingredients/Runtime/LevelScripting/Actions/DirectorControlRigAction.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 46a9752b2a3792a46b8a16cf93bafdd5 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {fileID: 2800000, guid: 159806d978e00114cb2b1e43dff3d48c, type: 3} + userData: + assetBundleName: + assetBundleVariant: diff --git a/LocalPackages/net.peeweek.gameplay-ingredients/Runtime/Actions/FocusUIAction.cs b/LocalPackages/net.peeweek.gameplay-ingredients/Runtime/LevelScripting/Actions/FocusUIAction.cs similarity index 70% rename from LocalPackages/net.peeweek.gameplay-ingredients/Runtime/Actions/FocusUIAction.cs rename to LocalPackages/net.peeweek.gameplay-ingredients/Runtime/LevelScripting/Actions/FocusUIAction.cs index 28e6935..9a11b11 100644 --- a/LocalPackages/net.peeweek.gameplay-ingredients/Runtime/Actions/FocusUIAction.cs +++ b/LocalPackages/net.peeweek.gameplay-ingredients/Runtime/LevelScripting/Actions/FocusUIAction.cs @@ -1,3 +1,4 @@ +using UnityEngine; using UnityEngine.UI; namespace GameplayIngredients.Actions @@ -6,10 +7,12 @@ namespace GameplayIngredients.Actions { public Selectable UIObjectToFocus; - public override void Execute() + public override void Execute(GameObject instigator = null) { if (UIObjectToFocus != null) + { UIObjectToFocus.Select(); + } } } } diff --git a/LocalPackages/net.peeweek.gameplay-ingredients/Runtime/Actions/FocusUIAction.cs.meta b/LocalPackages/net.peeweek.gameplay-ingredients/Runtime/LevelScripting/Actions/FocusUIAction.cs.meta similarity index 74% rename from LocalPackages/net.peeweek.gameplay-ingredients/Runtime/Actions/FocusUIAction.cs.meta rename to LocalPackages/net.peeweek.gameplay-ingredients/Runtime/LevelScripting/Actions/FocusUIAction.cs.meta index 84ecc70..b1bdc48 100644 --- a/LocalPackages/net.peeweek.gameplay-ingredients/Runtime/Actions/FocusUIAction.cs.meta +++ b/LocalPackages/net.peeweek.gameplay-ingredients/Runtime/LevelScripting/Actions/FocusUIAction.cs.meta @@ -5,7 +5,7 @@ MonoImporter: serializedVersion: 2 defaultReferences: [] executionOrder: 0 - icon: {instanceID: 0} + icon: {fileID: 2800000, guid: eccd73d046a00214f8eee58ce0e2b16e, type: 3} userData: assetBundleName: assetBundleVariant: diff --git a/LocalPackages/net.peeweek.gameplay-ingredients/Runtime/LevelScripting/Actions/FullScreenFadeAction.cs b/LocalPackages/net.peeweek.gameplay-ingredients/Runtime/LevelScripting/Actions/FullScreenFadeAction.cs new file mode 100644 index 0000000..d55baf0 --- /dev/null +++ b/LocalPackages/net.peeweek.gameplay-ingredients/Runtime/LevelScripting/Actions/FullScreenFadeAction.cs @@ -0,0 +1,25 @@ +using System; +using System.Collections; +using System.Collections.Generic; +using UnityEngine; +using UnityEngine.Events; +using NaughtyAttributes; + +namespace GameplayIngredients.Actions +{ + + public class FullScreenFadeAction : ActionBase + { + public FullScreenFadeManager.FadeMode Fading = FullScreenFadeManager.FadeMode.ToBlack; + public float Duration = 2.0f; + + [ReorderableList] + public Callable[] OnComplete; + + public override void Execute(GameObject instigator = null) + { + Manager.Get().Fade(Duration, Fading, OnComplete, instigator); + } + } + +} diff --git a/LocalPackages/net.peeweek.gameplay-ingredients/Runtime/LevelScripting/Actions/FullScreenFadeAction.cs.meta b/LocalPackages/net.peeweek.gameplay-ingredients/Runtime/LevelScripting/Actions/FullScreenFadeAction.cs.meta new file mode 100644 index 0000000..5e4f77a --- /dev/null +++ b/LocalPackages/net.peeweek.gameplay-ingredients/Runtime/LevelScripting/Actions/FullScreenFadeAction.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 5d6566ceaa073c944b7d03f43819b2a0 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {fileID: 2800000, guid: 4112ad68bb67a9646acd12615491fc97, type: 3} + userData: + assetBundleName: + assetBundleVariant: diff --git a/LocalPackages/net.peeweek.gameplay-ingredients/Runtime/LevelScripting/Actions/GameLevelLoadAction.cs b/LocalPackages/net.peeweek.gameplay-ingredients/Runtime/LevelScripting/Actions/GameLevelLoadAction.cs new file mode 100644 index 0000000..721d0d1 --- /dev/null +++ b/LocalPackages/net.peeweek.gameplay-ingredients/Runtime/LevelScripting/Actions/GameLevelLoadAction.cs @@ -0,0 +1,62 @@ +using System.Linq; +using UnityEngine; +using NaughtyAttributes; + +namespace GameplayIngredients.Actions +{ + public class GameLevelLoadAction : ActionBase + { + public enum Target + { + MainMenu, + First, + Previous, + Current, + Next, + Last, + SpecifiedLevel, + FromGameSave, + } + public bool ShowUI = true; + public Target level = Target.First; + [NonNullCheck, ShowIf("isSpecified"), Tooltip("Which Level to Load/Unload, when selected 'Specified' level")] + public GameLevel specifiedLevel; + + [ShowIf("isGameSave")] + public int UserSaveIndex = 0; + [ShowIf("isGameSave")] + public string UserSaveName = "Progress"; + + public bool SaveProgress = false; + + [ReorderableList] + public Callable[] OnComplete; + + private bool isSpecified() { return level == Target.SpecifiedLevel; } + private bool isGameSave() { return level == Target.FromGameSave; } + + public override void Execute(GameObject instigator = null) + { + int index = -2; + var manager = Manager.Get(); + + switch (level) + { + case Target.MainMenu: index = -1; break; + case Target.First: index = 0; break; + case Target.Last: index = manager.MainGameLevels.Length - 1; break; + case Target.Current: index = manager.currentLevel; break; + case Target.Previous: index = Mathf.Max(0, manager.currentLevel - 1); break; + case Target.Next: index = Mathf.Min(manager.MainGameLevels.Length - 1, manager.currentLevel + 1); break; + case Target.SpecifiedLevel: + if (specifiedLevel != null && manager.MainGameLevels.Contains(specifiedLevel)) + { + index = manager.MainGameLevels.ToList().IndexOf(specifiedLevel); + } + break; + case Target.FromGameSave: index = manager.currentSaveProgress; break; + } + manager.SwitchLevel(index, ShowUI, OnComplete, SaveProgress); + } + } +} diff --git a/LocalPackages/net.peeweek.gameplay-ingredients/Runtime/LevelScripting/Actions/GameLevelLoadAction.cs.meta b/LocalPackages/net.peeweek.gameplay-ingredients/Runtime/LevelScripting/Actions/GameLevelLoadAction.cs.meta new file mode 100644 index 0000000..9ae11a0 --- /dev/null +++ b/LocalPackages/net.peeweek.gameplay-ingredients/Runtime/LevelScripting/Actions/GameLevelLoadAction.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 3aabe1ebc59bfa94499c44333106efec +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {fileID: 2800000, guid: af9148c7de0fc6444b7e4e050f116dd0, type: 3} + userData: + assetBundleName: + assetBundleVariant: diff --git a/LocalPackages/net.peeweek.gameplay-ingredients/Runtime/LevelScripting/Actions/GameManagerSendStartupMessageAction.cs b/LocalPackages/net.peeweek.gameplay-ingredients/Runtime/LevelScripting/Actions/GameManagerSendStartupMessageAction.cs new file mode 100644 index 0000000..0ef1c16 --- /dev/null +++ b/LocalPackages/net.peeweek.gameplay-ingredients/Runtime/LevelScripting/Actions/GameManagerSendStartupMessageAction.cs @@ -0,0 +1,30 @@ +using System.Collections; +using System.Collections.Generic; +using UnityEngine; + +namespace GameplayIngredients.Actions +{ + public class GameManagerSendStartupMessageAction : ActionBase + { + public enum MessageType + { + MainMenuStart, + GameLevelStart, + } + + public MessageType messageType; + + public override void Execute(GameObject instigator = null) + { + switch(messageType) + { + case MessageType.GameLevelStart: + Messager.Send(GameManager.GameLevelStartMessage); + break; + case MessageType.MainMenuStart: + Messager.Send(GameManager.MainMenuStartMessage); + break; + } + } + } +} diff --git a/LocalPackages/net.peeweek.gameplay-ingredients/Runtime/LevelScripting/Actions/GameManagerSendStartupMessageAction.cs.meta b/LocalPackages/net.peeweek.gameplay-ingredients/Runtime/LevelScripting/Actions/GameManagerSendStartupMessageAction.cs.meta new file mode 100644 index 0000000..5877d8b --- /dev/null +++ b/LocalPackages/net.peeweek.gameplay-ingredients/Runtime/LevelScripting/Actions/GameManagerSendStartupMessageAction.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 15ae69d69e7aeaf4fbfb02e7175ed5f5 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {fileID: 2800000, guid: af9148c7de0fc6444b7e4e050f116dd0, type: 3} + userData: + assetBundleName: + assetBundleVariant: diff --git a/LocalPackages/net.peeweek.gameplay-ingredients/Runtime/LevelScripting/Actions/GameSaveLoadSaveAction.cs b/LocalPackages/net.peeweek.gameplay-ingredients/Runtime/LevelScripting/Actions/GameSaveLoadSaveAction.cs new file mode 100644 index 0000000..a414caa --- /dev/null +++ b/LocalPackages/net.peeweek.gameplay-ingredients/Runtime/LevelScripting/Actions/GameSaveLoadSaveAction.cs @@ -0,0 +1,37 @@ +using System.Collections; +using System.Collections.Generic; +using UnityEngine; + +namespace GameplayIngredients.Actions +{ + public class GameSaveLoadSaveAction : ActionBase + { + public enum Action + { + Load, + Save, + } + + public GameSaveManager.Location saveLocation = GameSaveManager.Location.System; + public Action action = Action.Load; + public byte UserSaveIndex = 0; + + public override void Execute(GameObject instigator = null) + { + if(action == Action.Load) + { + if (saveLocation == GameSaveManager.Location.System) + Manager.Get().LoadSystemSave(); + else + Manager.Get().LoadUserSave(UserSaveIndex); + } + else + { + if (saveLocation == GameSaveManager.Location.System) + Manager.Get().SaveSystemSave(); + else + Manager.Get().SaveUserSave(UserSaveIndex); + } + } + } +} diff --git a/LocalPackages/net.peeweek.gameplay-ingredients/Runtime/LevelScripting/Actions/GameSaveLoadSaveAction.cs.meta b/LocalPackages/net.peeweek.gameplay-ingredients/Runtime/LevelScripting/Actions/GameSaveLoadSaveAction.cs.meta new file mode 100644 index 0000000..fe43a60 --- /dev/null +++ b/LocalPackages/net.peeweek.gameplay-ingredients/Runtime/LevelScripting/Actions/GameSaveLoadSaveAction.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: b961b0f0b44c73940bdbe58fb10266af +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {fileID: 2800000, guid: 02a5b6174ed64e24ea35c86a99568fcf, type: 3} + userData: + assetBundleName: + assetBundleVariant: diff --git a/LocalPackages/net.peeweek.gameplay-ingredients/Runtime/LevelScripting/Actions/GameSaveSetValueAction.cs b/LocalPackages/net.peeweek.gameplay-ingredients/Runtime/LevelScripting/Actions/GameSaveSetValueAction.cs new file mode 100644 index 0000000..1c4d85a --- /dev/null +++ b/LocalPackages/net.peeweek.gameplay-ingredients/Runtime/LevelScripting/Actions/GameSaveSetValueAction.cs @@ -0,0 +1,40 @@ +using NaughtyAttributes; +using System.Collections; +using System.Collections.Generic; +using UnityEngine; + +namespace GameplayIngredients.Actions +{ + public class GameSaveSetValueAction : ActionBase + { + public string Key = "SomeKey"; + public GameSaveManager.Location saveLocation = GameSaveManager.Location.System; + public GameSaveManager.ValueType valueType = GameSaveManager.ValueType.String; + + [ShowIf("isString")] + public string StringValue; + [ShowIf("isInt")] + public int IntValue; + [ShowIf("isBool")] + public bool BoolValue; + [ShowIf("isFloat")] + public float FloatValue; + + public override void Execute(GameObject instigator = null) + { + var gsm = Manager.Get(); + switch(valueType) + { + case GameSaveManager.ValueType.Bool: gsm.SetBool(Key, saveLocation, BoolValue); break; + case GameSaveManager.ValueType.Int: gsm.SetInt(Key, saveLocation, IntValue); break; + case GameSaveManager.ValueType.Float: gsm.SetFloat(Key, saveLocation, FloatValue); break; + case GameSaveManager.ValueType.String: gsm.SetString(Key, saveLocation, StringValue); break; + } + } + + bool isString() { return valueType == GameSaveManager.ValueType.String; } + bool isBool() { return valueType == GameSaveManager.ValueType.Bool; } + bool isInt() { return valueType == GameSaveManager.ValueType.Int; } + bool isFloat() { return valueType == GameSaveManager.ValueType.Float; } + } +} diff --git a/LocalPackages/net.peeweek.gameplay-ingredients/Runtime/LevelScripting/Actions/GameSaveSetValueAction.cs.meta b/LocalPackages/net.peeweek.gameplay-ingredients/Runtime/LevelScripting/Actions/GameSaveSetValueAction.cs.meta new file mode 100644 index 0000000..f73452b --- /dev/null +++ b/LocalPackages/net.peeweek.gameplay-ingredients/Runtime/LevelScripting/Actions/GameSaveSetValueAction.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 418629731ee76d94981950d2da411d63 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {fileID: 2800000, guid: 02a5b6174ed64e24ea35c86a99568fcf, type: 3} + userData: + assetBundleName: + assetBundleVariant: diff --git a/LocalPackages/net.peeweek.gameplay-ingredients/Runtime/LevelScripting/Actions/LogAction.cs b/LocalPackages/net.peeweek.gameplay-ingredients/Runtime/LevelScripting/Actions/LogAction.cs new file mode 100644 index 0000000..a86eb65 --- /dev/null +++ b/LocalPackages/net.peeweek.gameplay-ingredients/Runtime/LevelScripting/Actions/LogAction.cs @@ -0,0 +1,39 @@ +using System.Collections; +using System.Collections.Generic; +using UnityEngine; +using NaughtyAttributes; + +namespace GameplayIngredients.Actions +{ + public class LogAction : ActionBase + { + const string kHelpText = @"Wildcards: +%INSTIGATOR% : Instigator Name +%TIME% : Time (since startup) +"; + + [Multiline, InfoBox(kHelpText, InfoBoxType.Normal)] + public string LogText = "Instigator = %INSTIGATOR%"; + public LogType type = LogType.Log; + + public override void Execute(GameObject instigator = null) + { + Debug.unityLogger.Log(type, FormatString(instigator)); + } + + string FormatString(GameObject instigator) + { + string text = LogText; + if(text.Contains("%INSTIGATOR%")) + { + text = text.Replace("%INSTIGATOR%", instigator == null ? "NULL" : instigator.name); + } + if(text.Contains("%TIME%")) + { + text = text.Replace("%TIME%", Time.time.ToString()); + } + + return text; + } + } +} diff --git a/LocalPackages/net.peeweek.gameplay-ingredients/Runtime/LevelScripting/Actions/LogAction.cs.meta b/LocalPackages/net.peeweek.gameplay-ingredients/Runtime/LevelScripting/Actions/LogAction.cs.meta new file mode 100644 index 0000000..7bc0d10 --- /dev/null +++ b/LocalPackages/net.peeweek.gameplay-ingredients/Runtime/LevelScripting/Actions/LogAction.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: a0cf6cf5b077c50499599ee38c30aae8 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {fileID: 2800000, guid: 995bed5518fc03b4189519d1762eed5b, type: 3} + userData: + assetBundleName: + assetBundleVariant: diff --git a/LocalPackages/net.peeweek.gameplay-ingredients/Runtime/LevelScripting/Actions/RandomToggleGameObjectAction.cs b/LocalPackages/net.peeweek.gameplay-ingredients/Runtime/LevelScripting/Actions/RandomToggleGameObjectAction.cs new file mode 100644 index 0000000..046e25d --- /dev/null +++ b/LocalPackages/net.peeweek.gameplay-ingredients/Runtime/LevelScripting/Actions/RandomToggleGameObjectAction.cs @@ -0,0 +1,34 @@ +using NaughtyAttributes; +using UnityEngine; + +namespace GameplayIngredients.Actions +{ + public class RandomToggleGameObjectAction : ActionBase + { + [ReorderableList] + public GameObject[] Targets; + + public override void Execute(GameObject instigator = null) + { + var random = Targets[Random.Range(0,Targets.Length)]; + + foreach (var target in Targets) + { + if (target != null) + target.SetActive(random == target); + + } + } + + [ContextMenu("Populate From Children")] + void PopulateFromChildren() + { + int count = transform.childCount; + Targets = new GameObject[count]; + for(int i = 0; i < count; i++) + { + Targets[i] = transform.GetChild(i).gameObject; + } + } + } +} diff --git a/LocalPackages/net.peeweek.gameplay-ingredients/Runtime/LevelScripting/Actions/RandomToggleGameObjectAction.cs.meta b/LocalPackages/net.peeweek.gameplay-ingredients/Runtime/LevelScripting/Actions/RandomToggleGameObjectAction.cs.meta new file mode 100644 index 0000000..c59f5ea --- /dev/null +++ b/LocalPackages/net.peeweek.gameplay-ingredients/Runtime/LevelScripting/Actions/RandomToggleGameObjectAction.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: d9bef84f4fdabbc4a90c708db50f8df0 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {fileID: 2800000, guid: 225c53326635b1748868c470ea1bccce, type: 3} + userData: + assetBundleName: + assetBundleVariant: diff --git a/LocalPackages/net.peeweek.gameplay-ingredients/Runtime/LevelScripting/Actions/RigidbodyAction.cs b/LocalPackages/net.peeweek.gameplay-ingredients/Runtime/LevelScripting/Actions/RigidbodyAction.cs new file mode 100644 index 0000000..d0a1635 --- /dev/null +++ b/LocalPackages/net.peeweek.gameplay-ingredients/Runtime/LevelScripting/Actions/RigidbodyAction.cs @@ -0,0 +1,84 @@ +using NaughtyAttributes; +using UnityEngine; + +namespace GameplayIngredients.Actions +{ + public enum RigidbodyActionType { Force, Torque, ExplosionForce, Sleep }; + public enum ActionSpace { Local, World }; + + [ExecuteAlways] + public class RigidbodyAction : ActionBase + { + public bool ApplyOnInstigator = false; + [HideIf("ApplyOnInstigator")] + public Rigidbody m_Rigidbody; + [OnValueChanged("OnParameterTypeChanged")] + public RigidbodyActionType actionType; + + bool force = true; + bool explosion; + + [ShowIf("force")] + public ActionSpace actionSpace; + [ShowIf("force")] + public ForceMode forceMode; + [ShowIf("force")] + public Vector3 direction; + [ShowIf("explosion")] + public float explosionForce; + [ShowIf("explosion")] + public Vector3 explositonPosition; + [ShowIf("explosion")] + public float explosionRadius; + + public override void Execute(GameObject instigator = null) + { + Rigidbody target = m_Rigidbody; + + if (ApplyOnInstigator) + target = instigator.GetComponent(); + + if (target == null) + { + Debug.LogWarning("Could not apply RigidbodyAction to null Rigidbody"); + return; + } + + switch (actionType) + { + case RigidbodyActionType.Force: + if(actionSpace == ActionSpace.World) + { + target.AddForce(direction, forceMode); + } + if(actionSpace == ActionSpace.Local) + { + target.AddRelativeForce(direction, forceMode); + } + break; + case RigidbodyActionType.Torque: + if (actionSpace == ActionSpace.World) + { + target.AddTorque(direction, forceMode); + } + if (actionSpace == ActionSpace.Local) + { + target.AddRelativeTorque(direction, forceMode); + } + break; + case RigidbodyActionType.ExplosionForce: + target.AddExplosionForce(explosionForce, explositonPosition, explosionRadius, 0, forceMode); + break; + case RigidbodyActionType.Sleep: + target.Sleep(); + break; + } + } + + private void OnParameterTypeChanged() + { + force = (actionType == RigidbodyActionType.Force || actionType == RigidbodyActionType.Torque); + explosion = (actionType == RigidbodyActionType.ExplosionForce); + } + } +} diff --git a/LocalPackages/net.peeweek.gameplay-ingredients/Runtime/LevelScripting/Actions/RigidbodyAction.cs.meta b/LocalPackages/net.peeweek.gameplay-ingredients/Runtime/LevelScripting/Actions/RigidbodyAction.cs.meta new file mode 100644 index 0000000..f9ae0b1 --- /dev/null +++ b/LocalPackages/net.peeweek.gameplay-ingredients/Runtime/LevelScripting/Actions/RigidbodyAction.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: d3490d67f14565045b8de2af2380b379 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {fileID: 2800000, guid: 156c6b396de456546beacc0bd53b6e07, type: 3} + userData: + assetBundleName: + assetBundleVariant: diff --git a/LocalPackages/net.peeweek.gameplay-ingredients/Runtime/Actions/SendMessageAction.cs b/LocalPackages/net.peeweek.gameplay-ingredients/Runtime/LevelScripting/Actions/SendMessageAction.cs similarity index 55% rename from LocalPackages/net.peeweek.gameplay-ingredients/Runtime/Actions/SendMessageAction.cs rename to LocalPackages/net.peeweek.gameplay-ingredients/Runtime/LevelScripting/Actions/SendMessageAction.cs index b74a20e..515209d 100644 --- a/LocalPackages/net.peeweek.gameplay-ingredients/Runtime/Actions/SendMessageAction.cs +++ b/LocalPackages/net.peeweek.gameplay-ingredients/Runtime/LevelScripting/Actions/SendMessageAction.cs @@ -1,12 +1,14 @@ +using UnityEngine; + namespace GameplayIngredients.Actions { public class SendMessageAction : ActionBase { public string MessageToSend = "Message"; - public override void Execute() + public override void Execute(GameObject instigator = null) { - Messager.Send(MessageToSend); + Messager.Send(MessageToSend, instigator); } } } diff --git a/LocalPackages/net.peeweek.gameplay-ingredients/Runtime/Actions/SendMessageAction.cs.meta b/LocalPackages/net.peeweek.gameplay-ingredients/Runtime/LevelScripting/Actions/SendMessageAction.cs.meta similarity index 74% rename from LocalPackages/net.peeweek.gameplay-ingredients/Runtime/Actions/SendMessageAction.cs.meta rename to LocalPackages/net.peeweek.gameplay-ingredients/Runtime/LevelScripting/Actions/SendMessageAction.cs.meta index e5194cc..2d0d45b 100644 --- a/LocalPackages/net.peeweek.gameplay-ingredients/Runtime/Actions/SendMessageAction.cs.meta +++ b/LocalPackages/net.peeweek.gameplay-ingredients/Runtime/LevelScripting/Actions/SendMessageAction.cs.meta @@ -5,7 +5,7 @@ MonoImporter: serializedVersion: 2 defaultReferences: [] executionOrder: 0 - icon: {instanceID: 0} + icon: {fileID: 2800000, guid: 60943dcd3a3663942942cf1f0dce3c11, type: 3} userData: assetBundleName: assetBundleVariant: diff --git a/LocalPackages/net.peeweek.gameplay-ingredients/Runtime/LevelScripting/Actions/SetAnimatorParameterAction.cs b/LocalPackages/net.peeweek.gameplay-ingredients/Runtime/LevelScripting/Actions/SetAnimatorParameterAction.cs new file mode 100644 index 0000000..eccfa81 --- /dev/null +++ b/LocalPackages/net.peeweek.gameplay-ingredients/Runtime/LevelScripting/Actions/SetAnimatorParameterAction.cs @@ -0,0 +1,55 @@ +using UnityEngine; +using NaughtyAttributes; + + +namespace GameplayIngredients.Actions +{ + public enum AnimatorParameterType { Bool, Float, Int, Trigger }; + + public class SetAnimatorParameterAction : ActionBase + { + public Animator animator; + public string parameterName; + [OnValueChanged("OnParameterTypeChanged")] + public AnimatorParameterType parameterType = AnimatorParameterType.Bool; + + bool showFloat; + bool showInt; + bool showBool = true; + [ShowIf("showFloat")] + public float floatValue; + [ShowIf("showInt")] + public int intValue; + [ShowIf("showBool")] + public bool boolValue; + + public override void Execute(GameObject instigator = null) + { + if (animator == null) + return; + + switch (parameterType) + { + case AnimatorParameterType.Bool: + animator.SetBool(parameterName, boolValue); + break; + case AnimatorParameterType.Float: + animator.SetFloat(parameterName, floatValue); + break; + case AnimatorParameterType.Int: + animator.SetInteger(parameterName, intValue); + break; + case AnimatorParameterType.Trigger: + animator.SetTrigger(parameterName); + break; + } + } + + private void OnParameterTypeChanged() + { + showBool = (parameterType == AnimatorParameterType.Bool); + showFloat = (parameterType == AnimatorParameterType.Float); + showInt = (parameterType == AnimatorParameterType.Int); + } + } +} \ No newline at end of file diff --git a/LocalPackages/net.peeweek.gameplay-ingredients/Runtime/LevelScripting/Actions/SetAnimatorParameterAction.cs.meta b/LocalPackages/net.peeweek.gameplay-ingredients/Runtime/LevelScripting/Actions/SetAnimatorParameterAction.cs.meta new file mode 100644 index 0000000..f94fb46 --- /dev/null +++ b/LocalPackages/net.peeweek.gameplay-ingredients/Runtime/LevelScripting/Actions/SetAnimatorParameterAction.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: e5f9a6ca2faa0514095c2a061d47807e +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/LocalPackages/net.peeweek.gameplay-ingredients/Runtime/Actions/SetTimeScaleAction.cs b/LocalPackages/net.peeweek.gameplay-ingredients/Runtime/LevelScripting/Actions/SetTimeScaleAction.cs similarity index 83% rename from LocalPackages/net.peeweek.gameplay-ingredients/Runtime/Actions/SetTimeScaleAction.cs rename to LocalPackages/net.peeweek.gameplay-ingredients/Runtime/LevelScripting/Actions/SetTimeScaleAction.cs index 46801a6..049fb32 100644 --- a/LocalPackages/net.peeweek.gameplay-ingredients/Runtime/Actions/SetTimeScaleAction.cs +++ b/LocalPackages/net.peeweek.gameplay-ingredients/Runtime/LevelScripting/Actions/SetTimeScaleAction.cs @@ -6,7 +6,7 @@ namespace GameplayIngredients.Actions { public float TimeScale = 1.0f; - public override void Execute() + public override void Execute(GameObject instigator = null) { Time.timeScale = TimeScale; } diff --git a/LocalPackages/net.peeweek.gameplay-ingredients/Runtime/Actions/SetTimeScaleAction.cs.meta b/LocalPackages/net.peeweek.gameplay-ingredients/Runtime/LevelScripting/Actions/SetTimeScaleAction.cs.meta similarity index 74% rename from LocalPackages/net.peeweek.gameplay-ingredients/Runtime/Actions/SetTimeScaleAction.cs.meta rename to LocalPackages/net.peeweek.gameplay-ingredients/Runtime/LevelScripting/Actions/SetTimeScaleAction.cs.meta index e8cbc8e..b6be978 100644 --- a/LocalPackages/net.peeweek.gameplay-ingredients/Runtime/Actions/SetTimeScaleAction.cs.meta +++ b/LocalPackages/net.peeweek.gameplay-ingredients/Runtime/LevelScripting/Actions/SetTimeScaleAction.cs.meta @@ -5,7 +5,7 @@ MonoImporter: serializedVersion: 2 defaultReferences: [] executionOrder: 0 - icon: {instanceID: 0} + icon: {fileID: 2800000, guid: 119b1440af22d6247a08df45aa367754, type: 3} userData: assetBundleName: assetBundleVariant: diff --git a/LocalPackages/net.peeweek.gameplay-ingredients/Runtime/LevelScripting/Actions/SpawnPrefabAction.cs b/LocalPackages/net.peeweek.gameplay-ingredients/Runtime/LevelScripting/Actions/SpawnPrefabAction.cs new file mode 100644 index 0000000..2514602 --- /dev/null +++ b/LocalPackages/net.peeweek.gameplay-ingredients/Runtime/LevelScripting/Actions/SpawnPrefabAction.cs @@ -0,0 +1,53 @@ +using NaughtyAttributes; +using UnityEngine; + +namespace GameplayIngredients.Actions +{ + public class SpawnPrefabAction : ActionBase + { + [ReorderableList] + public GameObject[] Prefabs; + + public Transform TargetTransform; + + public bool TargetInstigator = false; + public bool AttachToTarget = false; + public bool DontDestroyPrefabsOnLoad = false; + + public override void Execute(GameObject instigator = null) + { + foreach (var prefab in Prefabs) + { + string name = prefab.name; + + Vector3 position = gameObject.transform.position; + Quaternion rotation = gameObject.transform.rotation; + + if(TargetInstigator && instigator != null) + { + position = instigator.transform.position; + rotation = instigator.transform.rotation; + } + else if (TargetTransform != null) + { + position = TargetTransform.position; + rotation = TargetTransform.rotation; + } + + var obj = Instantiate(prefab, position, rotation); + obj.name = name; + + if (AttachToTarget) + { + if (TargetInstigator && instigator != null) + obj.transform.parent = instigator.transform; + else + obj.transform.parent = TargetTransform; + } + + if (DontDestroyPrefabsOnLoad) + DontDestroyOnLoad(obj); + } + } + } +} diff --git a/LocalPackages/net.peeweek.gameplay-ingredients/Runtime/LevelScripting/Actions/SpawnPrefabAction.cs.meta b/LocalPackages/net.peeweek.gameplay-ingredients/Runtime/LevelScripting/Actions/SpawnPrefabAction.cs.meta new file mode 100644 index 0000000..effc1fd --- /dev/null +++ b/LocalPackages/net.peeweek.gameplay-ingredients/Runtime/LevelScripting/Actions/SpawnPrefabAction.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: f2875c0d65452a845831d16b89e97547 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {fileID: 2800000, guid: 1570e273fe0366a4aa86c010b052a9b9, type: 3} + userData: + assetBundleName: + assetBundleVariant: diff --git a/LocalPackages/net.peeweek.gameplay-ingredients/Runtime/LevelScripting/Actions/StreamingLevelAction.cs b/LocalPackages/net.peeweek.gameplay-ingredients/Runtime/LevelScripting/Actions/StreamingLevelAction.cs new file mode 100644 index 0000000..48988a9 --- /dev/null +++ b/LocalPackages/net.peeweek.gameplay-ingredients/Runtime/LevelScripting/Actions/StreamingLevelAction.cs @@ -0,0 +1,30 @@ +using System.Collections.Generic; +using UnityEngine; +using UnityEngine.SceneManagement; +using GameplayIngredients.LevelStreaming; +using NaughtyAttributes; + +namespace GameplayIngredients.Actions +{ + public class StreamingLevelAction : ActionBase + { + [ReorderableList, Scene] + public string[] Scenes; + public string SceneToActivate; + public LevelStreamingManager.StreamingAction Action = LevelStreamingManager.StreamingAction.Load; + + public bool ShowUI = false; + + [ReorderableList] + public Callable[] OnLoadComplete; + + public override void Execute(GameObject instigator = null) + { + List sceneNames = new List(); + foreach (var scene in Scenes) + sceneNames.Add(scene); + Manager.Get().LoadScenes(Action, sceneNames.ToArray(), SceneToActivate, ShowUI, OnLoadComplete); + } + } +} + diff --git a/LocalPackages/net.peeweek.gameplay-ingredients/Runtime/Actions/StreamingLevelAction.cs.meta b/LocalPackages/net.peeweek.gameplay-ingredients/Runtime/LevelScripting/Actions/StreamingLevelAction.cs.meta similarity index 74% rename from LocalPackages/net.peeweek.gameplay-ingredients/Runtime/Actions/StreamingLevelAction.cs.meta rename to LocalPackages/net.peeweek.gameplay-ingredients/Runtime/LevelScripting/Actions/StreamingLevelAction.cs.meta index 8e0c16a..49c55f6 100644 --- a/LocalPackages/net.peeweek.gameplay-ingredients/Runtime/Actions/StreamingLevelAction.cs.meta +++ b/LocalPackages/net.peeweek.gameplay-ingredients/Runtime/LevelScripting/Actions/StreamingLevelAction.cs.meta @@ -5,7 +5,7 @@ MonoImporter: serializedVersion: 2 defaultReferences: [] executionOrder: 0 - icon: {instanceID: 0} + icon: {fileID: 2800000, guid: 225c53326635b1748868c470ea1bccce, type: 3} userData: assetBundleName: assetBundleVariant: diff --git a/LocalPackages/net.peeweek.gameplay-ingredients/Runtime/Actions/SwitcherAction.cs b/LocalPackages/net.peeweek.gameplay-ingredients/Runtime/LevelScripting/Actions/SwitcherAction.cs similarity index 100% rename from LocalPackages/net.peeweek.gameplay-ingredients/Runtime/Actions/SwitcherAction.cs rename to LocalPackages/net.peeweek.gameplay-ingredients/Runtime/LevelScripting/Actions/SwitcherAction.cs diff --git a/LocalPackages/net.peeweek.gameplay-ingredients/Runtime/Actions/SwitcherAction.cs.meta b/LocalPackages/net.peeweek.gameplay-ingredients/Runtime/LevelScripting/Actions/SwitcherAction.cs.meta similarity index 74% rename from LocalPackages/net.peeweek.gameplay-ingredients/Runtime/Actions/SwitcherAction.cs.meta rename to LocalPackages/net.peeweek.gameplay-ingredients/Runtime/LevelScripting/Actions/SwitcherAction.cs.meta index 5cd9115..61098b2 100644 --- a/LocalPackages/net.peeweek.gameplay-ingredients/Runtime/Actions/SwitcherAction.cs.meta +++ b/LocalPackages/net.peeweek.gameplay-ingredients/Runtime/LevelScripting/Actions/SwitcherAction.cs.meta @@ -5,7 +5,7 @@ MonoImporter: serializedVersion: 2 defaultReferences: [] executionOrder: 0 - icon: {instanceID: 0} + icon: {fileID: 2800000, guid: 225c53326635b1748868c470ea1bccce, type: 3} userData: assetBundleName: assetBundleVariant: diff --git a/LocalPackages/net.peeweek.gameplay-ingredients/Runtime/Actions/TakeScreenshotAction.cs b/LocalPackages/net.peeweek.gameplay-ingredients/Runtime/LevelScripting/Actions/TakeScreenshotAction.cs similarity index 87% rename from LocalPackages/net.peeweek.gameplay-ingredients/Runtime/Actions/TakeScreenshotAction.cs rename to LocalPackages/net.peeweek.gameplay-ingredients/Runtime/LevelScripting/Actions/TakeScreenshotAction.cs index 7d16a89..0fdd83b 100644 --- a/LocalPackages/net.peeweek.gameplay-ingredients/Runtime/Actions/TakeScreenshotAction.cs +++ b/LocalPackages/net.peeweek.gameplay-ingredients/Runtime/LevelScripting/Actions/TakeScreenshotAction.cs @@ -9,7 +9,7 @@ namespace GameplayIngredients.Actions public int figureCount = 2; private int screenshotNumber = 0; - public override void Execute() + public override void Execute(GameObject instigator = null) { ScreenCapture.CaptureScreenshot(name + screenshotNumber.ToString().PadLeft(figureCount, '0') + ".png", supersampleRate); screenshotNumber += 1; diff --git a/LocalPackages/net.peeweek.gameplay-ingredients/Runtime/Actions/TakeScreenshotAction.cs.meta b/LocalPackages/net.peeweek.gameplay-ingredients/Runtime/LevelScripting/Actions/TakeScreenshotAction.cs.meta similarity index 74% rename from LocalPackages/net.peeweek.gameplay-ingredients/Runtime/Actions/TakeScreenshotAction.cs.meta rename to LocalPackages/net.peeweek.gameplay-ingredients/Runtime/LevelScripting/Actions/TakeScreenshotAction.cs.meta index ce2c915..0639089 100644 --- a/LocalPackages/net.peeweek.gameplay-ingredients/Runtime/Actions/TakeScreenshotAction.cs.meta +++ b/LocalPackages/net.peeweek.gameplay-ingredients/Runtime/LevelScripting/Actions/TakeScreenshotAction.cs.meta @@ -5,7 +5,7 @@ MonoImporter: serializedVersion: 2 defaultReferences: [] executionOrder: 0 - icon: {instanceID: 0} + icon: {fileID: 2800000, guid: 4112ad68bb67a9646acd12615491fc97, type: 3} userData: assetBundleName: assetBundleVariant: diff --git a/LocalPackages/net.peeweek.gameplay-ingredients/Runtime/LevelScripting/Actions/TeleportGameObjectAction.cs b/LocalPackages/net.peeweek.gameplay-ingredients/Runtime/LevelScripting/Actions/TeleportGameObjectAction.cs new file mode 100644 index 0000000..257cb20 --- /dev/null +++ b/LocalPackages/net.peeweek.gameplay-ingredients/Runtime/LevelScripting/Actions/TeleportGameObjectAction.cs @@ -0,0 +1,40 @@ +using NaughtyAttributes; +using System.Collections; +using System.Collections.Generic; +using UnityEngine; + +namespace GameplayIngredients.Actions +{ + public class TeleportGameObjectAction : ActionBase + { + [ReorderableList] + public GameObject[] ObjectsToTeleport; + public bool TeleportInstigator = false; + + public Transform TeleportTarget; + + public override void Execute(GameObject instigator = null) + { + if(TeleportTarget == null) + { + Debug.LogWarning("No Teleport Target"); + return; + } + if(ObjectsToTeleport != null) + { + foreach(var obj in ObjectsToTeleport) + { + Teleport(obj, TeleportTarget.position, TeleportTarget.rotation); + } + } + if (TeleportInstigator && instigator != null) + Teleport(instigator, TeleportTarget.position, TeleportTarget.rotation); + } + + static void Teleport(GameObject obj, Vector3 worldPosition, Quaternion rotation) + { + obj.transform.position = worldPosition; + obj.transform.rotation = rotation; + } + } +} diff --git a/LocalPackages/net.peeweek.gameplay-ingredients/Runtime/LevelScripting/Actions/TeleportGameObjectAction.cs.meta b/LocalPackages/net.peeweek.gameplay-ingredients/Runtime/LevelScripting/Actions/TeleportGameObjectAction.cs.meta new file mode 100644 index 0000000..d74feed --- /dev/null +++ b/LocalPackages/net.peeweek.gameplay-ingredients/Runtime/LevelScripting/Actions/TeleportGameObjectAction.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 274fbc4743bc0694e92a40c10f7961aa +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {fileID: 2800000, guid: 8bd1987424b3c64449f50dbdca21db20, type: 3} + userData: + assetBundleName: + assetBundleVariant: diff --git a/LocalPackages/net.peeweek.gameplay-ingredients/Runtime/LevelScripting/Actions/TimelineControlAction.cs b/LocalPackages/net.peeweek.gameplay-ingredients/Runtime/LevelScripting/Actions/TimelineControlAction.cs new file mode 100644 index 0000000..b15fa50 --- /dev/null +++ b/LocalPackages/net.peeweek.gameplay-ingredients/Runtime/LevelScripting/Actions/TimelineControlAction.cs @@ -0,0 +1,36 @@ +using System.Collections; +using System.Collections.Generic; +using UnityEngine; +using UnityEngine.Playables; + +namespace GameplayIngredients.Actions +{ + public class TimelineControlAction : ActionBase + { + public enum TimelineControlMode + { + Play, + Stop, + Pause, + Loop, + Hold + } + + public PlayableDirector director; + public TimelineControlMode mode = TimelineControlMode.Play; + + public override void Execute(GameObject instigator = null) + { + switch(mode) + { + case TimelineControlMode.Play: director.Play(); break; + case TimelineControlMode.Stop: director.Stop(); break; + case TimelineControlMode.Pause: director.Pause(); break; + case TimelineControlMode.Loop: director.extrapolationMode = DirectorWrapMode.Loop; break; + case TimelineControlMode.Hold: director.extrapolationMode = DirectorWrapMode.Hold; break; + } + } + } +} + + diff --git a/LocalPackages/net.peeweek.gameplay-ingredients/Runtime/LevelScripting/Actions/TimelineControlAction.cs.meta b/LocalPackages/net.peeweek.gameplay-ingredients/Runtime/LevelScripting/Actions/TimelineControlAction.cs.meta new file mode 100644 index 0000000..1aa6d0e --- /dev/null +++ b/LocalPackages/net.peeweek.gameplay-ingredients/Runtime/LevelScripting/Actions/TimelineControlAction.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 4f06b970d3ee59945985c11cd9e66868 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {fileID: 2800000, guid: 31fbcdeb88015d34e93da597e32c8f07, type: 3} + userData: + assetBundleName: + assetBundleVariant: diff --git a/LocalPackages/net.peeweek.gameplay-ingredients/Runtime/LevelScripting/Actions/ToggleBehaviourAction.cs b/LocalPackages/net.peeweek.gameplay-ingredients/Runtime/LevelScripting/Actions/ToggleBehaviourAction.cs new file mode 100644 index 0000000..3e2a235 --- /dev/null +++ b/LocalPackages/net.peeweek.gameplay-ingredients/Runtime/LevelScripting/Actions/ToggleBehaviourAction.cs @@ -0,0 +1,52 @@ +using NaughtyAttributes; +using UnityEngine; + +namespace GameplayIngredients.Actions +{ + public class ToggleBehaviourAction : ActionBase + { + + [ReorderableList] + public BehaviourToggle[] Targets; + + public override void Execute(GameObject instigator = null) + { + foreach (var target in Targets) + { + if (target.Behaviour == null) + { + Debug.Log("Target is null, ignoring"); + } + else + { + switch (target.State) + { + case BehaviourToggle.BehaviourToggleState.Disable: + target.Behaviour.enabled = false; + break; + case BehaviourToggle.BehaviourToggleState.Enable: + target.Behaviour.enabled = true; + break; + case BehaviourToggle.BehaviourToggleState.Toggle: + target.Behaviour.enabled = !target.Behaviour.enabled; + break; + } + } + } + } + + [System.Serializable] + public struct BehaviourToggle + { + [System.Serializable] + public enum BehaviourToggleState + { + Disable = 0, + Enable = 1, + Toggle = 2 + } + public Behaviour Behaviour; + public BehaviourToggleState State; + } + } +} diff --git a/LocalPackages/net.peeweek.gameplay-ingredients/Runtime/LevelScripting/Actions/ToggleBehaviourAction.cs.meta b/LocalPackages/net.peeweek.gameplay-ingredients/Runtime/LevelScripting/Actions/ToggleBehaviourAction.cs.meta new file mode 100644 index 0000000..7541693 --- /dev/null +++ b/LocalPackages/net.peeweek.gameplay-ingredients/Runtime/LevelScripting/Actions/ToggleBehaviourAction.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 756d008da58a19e4dbc02fa1e3c84852 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {fileID: 2800000, guid: 225c53326635b1748868c470ea1bccce, type: 3} + userData: + assetBundleName: + assetBundleVariant: diff --git a/LocalPackages/net.peeweek.gameplay-ingredients/Runtime/Actions/ToggleGameObjectAction.cs b/LocalPackages/net.peeweek.gameplay-ingredients/Runtime/LevelScripting/Actions/ToggleGameObjectAction.cs similarity index 70% rename from LocalPackages/net.peeweek.gameplay-ingredients/Runtime/Actions/ToggleGameObjectAction.cs rename to LocalPackages/net.peeweek.gameplay-ingredients/Runtime/LevelScripting/Actions/ToggleGameObjectAction.cs index 8a86b2c..07e58ba 100644 --- a/LocalPackages/net.peeweek.gameplay-ingredients/Runtime/Actions/ToggleGameObjectAction.cs +++ b/LocalPackages/net.peeweek.gameplay-ingredients/Runtime/LevelScripting/Actions/ToggleGameObjectAction.cs @@ -1,11 +1,27 @@ +using NaughtyAttributes; using UnityEngine; namespace GameplayIngredients.Actions { public class ToggleGameObjectAction : ActionBase { + [ContextMenu("Update Toggles from Current State")] + void UpdateFromCurrentState() + { + for (int i = 0; i < Targets.Length; i++) + { + if (Targets[i].GameObject == null) + continue; + + Targets[i].State = Targets[i].GameObject.activeSelf ? GameObjectToggle.GameObjectToggleState.Enable : GameObjectToggle.GameObjectToggleState.Disable; + + } + } + + [ReorderableList] public GameObjectToggle[] Targets; - public override void Execute() + + public override void Execute(GameObject instigator = null) { foreach(var target in Targets) { @@ -31,6 +47,7 @@ namespace GameplayIngredients.Actions } } + [System.Serializable] public struct GameObjectToggle { [System.Serializable] diff --git a/LocalPackages/net.peeweek.gameplay-ingredients/Runtime/Actions/ToggleGameObjectAction.cs.meta b/LocalPackages/net.peeweek.gameplay-ingredients/Runtime/LevelScripting/Actions/ToggleGameObjectAction.cs.meta similarity index 74% rename from LocalPackages/net.peeweek.gameplay-ingredients/Runtime/Actions/ToggleGameObjectAction.cs.meta rename to LocalPackages/net.peeweek.gameplay-ingredients/Runtime/LevelScripting/Actions/ToggleGameObjectAction.cs.meta index 1f52cae..9d3a45c 100644 --- a/LocalPackages/net.peeweek.gameplay-ingredients/Runtime/Actions/ToggleGameObjectAction.cs.meta +++ b/LocalPackages/net.peeweek.gameplay-ingredients/Runtime/LevelScripting/Actions/ToggleGameObjectAction.cs.meta @@ -5,7 +5,7 @@ MonoImporter: serializedVersion: 2 defaultReferences: [] executionOrder: 0 - icon: {instanceID: 0} + icon: {fileID: 2800000, guid: 225c53326635b1748868c470ea1bccce, type: 3} userData: assetBundleName: assetBundleVariant: diff --git a/LocalPackages/net.peeweek.gameplay-ingredients/Runtime/LevelScripting/Actions/ToggleUIAction.cs b/LocalPackages/net.peeweek.gameplay-ingredients/Runtime/LevelScripting/Actions/ToggleUIAction.cs new file mode 100644 index 0000000..705589d --- /dev/null +++ b/LocalPackages/net.peeweek.gameplay-ingredients/Runtime/LevelScripting/Actions/ToggleUIAction.cs @@ -0,0 +1,53 @@ +using NaughtyAttributes; +using UnityEngine; +using UnityEngine.UI; + +namespace GameplayIngredients.Actions +{ + public class ToggleUIAction : ActionBase + { + [ReorderableList] + public UIToggle[] Targets; + + public override void Execute(GameObject instigator = null) + { + foreach (var target in Targets) + { + if (target.Selectable == null) + { + Debug.Log("Target is null, ignoring"); + } + else + { + switch (target.State) + { + case UIToggle.UIToggleState.Disable: + target.Selectable.interactable = false; + break; + case UIToggle.UIToggleState.Enable: + target.Selectable.interactable = true; + break; + case UIToggle.UIToggleState.Toggle: + target.Selectable.interactable = !target.Selectable.interactable; + break; + } + } + } + } + + [System.Serializable] + public struct UIToggle + { + [System.Serializable] + public enum UIToggleState + { + Disable = 0, + Enable = 1, + Toggle = 2 + } + + public Selectable Selectable; + public UIToggleState State; + } + } +} diff --git a/LocalPackages/net.peeweek.gameplay-ingredients/Runtime/LevelScripting/Actions/ToggleUIAction.cs.meta b/LocalPackages/net.peeweek.gameplay-ingredients/Runtime/LevelScripting/Actions/ToggleUIAction.cs.meta new file mode 100644 index 0000000..457aac0 --- /dev/null +++ b/LocalPackages/net.peeweek.gameplay-ingredients/Runtime/LevelScripting/Actions/ToggleUIAction.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 3d984678c21b1754da3b073c268f8304 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {fileID: 2800000, guid: eccd73d046a00214f8eee58ce0e2b16e, type: 3} + userData: + assetBundleName: + assetBundleVariant: diff --git a/LocalPackages/net.peeweek.gameplay-ingredients/Runtime/Actions/SimpleAction.cs b/LocalPackages/net.peeweek.gameplay-ingredients/Runtime/LevelScripting/Actions/UnityEventAction.cs similarity index 56% rename from LocalPackages/net.peeweek.gameplay-ingredients/Runtime/Actions/SimpleAction.cs rename to LocalPackages/net.peeweek.gameplay-ingredients/Runtime/LevelScripting/Actions/UnityEventAction.cs index e6ec340..66f9460 100644 --- a/LocalPackages/net.peeweek.gameplay-ingredients/Runtime/Actions/SimpleAction.cs +++ b/LocalPackages/net.peeweek.gameplay-ingredients/Runtime/LevelScripting/Actions/UnityEventAction.cs @@ -1,12 +1,13 @@ +using UnityEngine; using UnityEngine.Events; namespace GameplayIngredients.Actions { - public class SimpleAction : ActionBase + public class UnityEventAction : ActionBase { public UnityEvent OnExecute; - public override void Execute() + public override void Execute(GameObject instigator = null) { OnExecute.Invoke(); } diff --git a/LocalPackages/net.peeweek.gameplay-ingredients/Runtime/Actions/SimpleAction.cs.meta b/LocalPackages/net.peeweek.gameplay-ingredients/Runtime/LevelScripting/Actions/UnityEventAction.cs.meta similarity index 74% rename from LocalPackages/net.peeweek.gameplay-ingredients/Runtime/Actions/SimpleAction.cs.meta rename to LocalPackages/net.peeweek.gameplay-ingredients/Runtime/LevelScripting/Actions/UnityEventAction.cs.meta index 0cf1464..0814846 100644 --- a/LocalPackages/net.peeweek.gameplay-ingredients/Runtime/Actions/SimpleAction.cs.meta +++ b/LocalPackages/net.peeweek.gameplay-ingredients/Runtime/LevelScripting/Actions/UnityEventAction.cs.meta @@ -5,7 +5,7 @@ MonoImporter: serializedVersion: 2 defaultReferences: [] executionOrder: 0 - icon: {instanceID: 0} + icon: {fileID: 2800000, guid: 5c4fb08bfbc3da848b42e663f823b47e, type: 3} userData: assetBundleName: assetBundleVariant: diff --git a/LocalPackages/net.peeweek.gameplay-ingredients/Runtime/LevelScripting/Actions/VFXSendEventAction.cs b/LocalPackages/net.peeweek.gameplay-ingredients/Runtime/LevelScripting/Actions/VFXSendEventAction.cs new file mode 100644 index 0000000..dde55b6 --- /dev/null +++ b/LocalPackages/net.peeweek.gameplay-ingredients/Runtime/LevelScripting/Actions/VFXSendEventAction.cs @@ -0,0 +1,17 @@ +using GameplayIngredients.Actions; +using UnityEngine; +using UnityEngine.VFX; + +public class VFXSendEventAction : ActionBase +{ + public VisualEffect visualEffect; + + public string eventName = "Event"; + + public override void Execute(GameObject instigator = null) + { + int id = Shader.PropertyToID(eventName); + var attrib = visualEffect.CreateVFXEventAttribute(); + visualEffect.SendEvent(eventName, attrib); + } +} diff --git a/LocalPackages/net.peeweek.gameplay-ingredients/Runtime/LevelScripting/Actions/VFXSendEventAction.cs.meta b/LocalPackages/net.peeweek.gameplay-ingredients/Runtime/LevelScripting/Actions/VFXSendEventAction.cs.meta new file mode 100644 index 0000000..8ed8a33 --- /dev/null +++ b/LocalPackages/net.peeweek.gameplay-ingredients/Runtime/LevelScripting/Actions/VFXSendEventAction.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 4845d67d1445f99478775602bba410c6 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/LocalPackages/net.peeweek.gameplay-ingredients/Runtime/LevelScripting/Actions/VFXSetPropertyAction.cs b/LocalPackages/net.peeweek.gameplay-ingredients/Runtime/LevelScripting/Actions/VFXSetPropertyAction.cs new file mode 100644 index 0000000..1f8a971 --- /dev/null +++ b/LocalPackages/net.peeweek.gameplay-ingredients/Runtime/LevelScripting/Actions/VFXSetPropertyAction.cs @@ -0,0 +1,126 @@ +using GameplayIngredients.Actions; +using UnityEngine; +using UnityEngine.VFX; +using NaughtyAttributes; +using UnityEngine.Serialization; + +public class VFXSetPropertyAction : ActionBase +{ + public enum DataType + { + Bool, + Float, + Vector2, + Vector3, + Vector4, + Texture2D, + Texture3D, + UInt, + Int + } + + public VisualEffect visualEffect; + + [FormerlySerializedAs("parameter")] + public string property = "Property"; + public bool Override = true; + + [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; + + public override void Execute(GameObject instigator = null) + { + int id = Shader.PropertyToID(property); + + if(HasParameter(id)) + { + if (!Override) + visualEffect.ResetOverride(id); + else + { + 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) + { + 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; + } + + public override string GetDefaultName() + { + if (!Override) + return $"Reset VFX override for parameter :'{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 parameter :'{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; } +} diff --git a/LocalPackages/net.peeweek.gameplay-ingredients/Runtime/LevelScripting/Actions/VFXSetPropertyAction.cs.meta b/LocalPackages/net.peeweek.gameplay-ingredients/Runtime/LevelScripting/Actions/VFXSetPropertyAction.cs.meta new file mode 100644 index 0000000..b2ab11f --- /dev/null +++ b/LocalPackages/net.peeweek.gameplay-ingredients/Runtime/LevelScripting/Actions/VFXSetPropertyAction.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: f78535f6bcf4e134fba8e5bdaadcf1da +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/LocalPackages/net.peeweek.gameplay-ingredients/Runtime/LevelScripting/Callable.cs b/LocalPackages/net.peeweek.gameplay-ingredients/Runtime/LevelScripting/Callable.cs new file mode 100644 index 0000000..d96af97 --- /dev/null +++ b/LocalPackages/net.peeweek.gameplay-ingredients/Runtime/LevelScripting/Callable.cs @@ -0,0 +1,60 @@ +using System.Collections; +using System.Collections.Generic; +using UnityEngine; + +namespace GameplayIngredients +{ + public abstract class Callable : MonoBehaviour, ICallable + { + public string Name; + + public void Reset() + { + if(Name == string.Empty || Name == null) + Name = GetDefaultName(); + } + + public abstract void Execute(GameObject instigator = null); + public abstract new string ToString(); + + public static void Call(Callable[] calls, GameObject instigator = null) + { + if (calls == null) + { + Debug.LogError("Cannot execute callable list: Null or Missing"); + return; + } + + foreach (var call in calls) + { + if (GameplayIngredientsSettings.currentSettings.verboseCalls) + Debug.Log($"[CALL] : {call.gameObject.scene.name} : {call.gameObject.name} :> {call.GetType().Name} ({call.Name})"); + + if(call != null) + call.Execute(instigator); + else + Debug.LogError($"Cannot execute Call: Null or Missing"); + } + } + + public static void Call(Callable call, GameObject instigator = null) + { + if (call != null) + call.Execute(instigator); + else + Debug.LogError("Cannot execute call: Null or Missing"); + } + + [ContextMenu("Reset Callable Name")] + private void MenuSetDefaultName() + { + Name = GetDefaultName(); + } + + public virtual string GetDefaultName() + { + return GetType().Name; + } + } +} + diff --git a/LocalPackages/net.peeweek.gameplay-ingredients/Runtime/LevelScripting/Callable.cs.meta b/LocalPackages/net.peeweek.gameplay-ingredients/Runtime/LevelScripting/Callable.cs.meta new file mode 100644 index 0000000..73401b9 --- /dev/null +++ b/LocalPackages/net.peeweek.gameplay-ingredients/Runtime/LevelScripting/Callable.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 431c1fa7f2528b3479c2499997d85d8b +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/LocalPackages/net.peeweek.gameplay-ingredients/Runtime/Hooks.meta b/LocalPackages/net.peeweek.gameplay-ingredients/Runtime/LevelScripting/Events.meta similarity index 100% rename from LocalPackages/net.peeweek.gameplay-ingredients/Runtime/Hooks.meta rename to LocalPackages/net.peeweek.gameplay-ingredients/Runtime/LevelScripting/Events.meta diff --git a/LocalPackages/net.peeweek.gameplay-ingredients/Runtime/LevelScripting/Events/EventBase.cs b/LocalPackages/net.peeweek.gameplay-ingredients/Runtime/LevelScripting/Events/EventBase.cs new file mode 100644 index 0000000..585aff1 --- /dev/null +++ b/LocalPackages/net.peeweek.gameplay-ingredients/Runtime/LevelScripting/Events/EventBase.cs @@ -0,0 +1,18 @@ +using UnityEngine; + +namespace GameplayIngredients.Events +{ + public abstract class EventBase : MonoBehaviour + { + protected bool AllowUpdateCalls() + { + return GameplayIngredientsSettings.currentSettings.allowUpdateCalls; + } + protected bool ForbidUpdateCalls() + { + return !GameplayIngredientsSettings.currentSettings.allowUpdateCalls; + } + } +} + + diff --git a/LocalPackages/net.peeweek.gameplay-ingredients/Runtime/Hooks/HookBase.cs.meta b/LocalPackages/net.peeweek.gameplay-ingredients/Runtime/LevelScripting/Events/EventBase.cs.meta similarity index 100% rename from LocalPackages/net.peeweek.gameplay-ingredients/Runtime/Hooks/HookBase.cs.meta rename to LocalPackages/net.peeweek.gameplay-ingredients/Runtime/LevelScripting/Events/EventBase.cs.meta diff --git a/LocalPackages/net.peeweek.gameplay-ingredients/Runtime/LevelScripting/Events/OnAwakeEvent.cs b/LocalPackages/net.peeweek.gameplay-ingredients/Runtime/LevelScripting/Events/OnAwakeEvent.cs new file mode 100644 index 0000000..cf2c752 --- /dev/null +++ b/LocalPackages/net.peeweek.gameplay-ingredients/Runtime/LevelScripting/Events/OnAwakeEvent.cs @@ -0,0 +1,18 @@ +using NaughtyAttributes; +using UnityEngine; + +namespace GameplayIngredients.Events +{ + public class OnAwakeEvent : MonoBehaviour + { + [ReorderableList] + public Callable[] onAwake; + + private void Awake() + { + Callable.Call(onAwake, gameObject); + } + } +} + + diff --git a/LocalPackages/net.peeweek.gameplay-ingredients/Runtime/LevelScripting/Events/OnAwakeEvent.cs.meta b/LocalPackages/net.peeweek.gameplay-ingredients/Runtime/LevelScripting/Events/OnAwakeEvent.cs.meta new file mode 100644 index 0000000..36e5485 --- /dev/null +++ b/LocalPackages/net.peeweek.gameplay-ingredients/Runtime/LevelScripting/Events/OnAwakeEvent.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 3bfe7209b5cff4f49b13217ed25f16dd +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {fileID: 2800000, guid: ed060522d893168479e97f3ebf7ca0b8, type: 3} + userData: + assetBundleName: + assetBundleVariant: diff --git a/LocalPackages/net.peeweek.gameplay-ingredients/Runtime/LevelScripting/Events/OnButtonDownEvent.cs b/LocalPackages/net.peeweek.gameplay-ingredients/Runtime/LevelScripting/Events/OnButtonDownEvent.cs new file mode 100644 index 0000000..92b9b2b --- /dev/null +++ b/LocalPackages/net.peeweek.gameplay-ingredients/Runtime/LevelScripting/Events/OnButtonDownEvent.cs @@ -0,0 +1,27 @@ +using NaughtyAttributes; +using UnityEngine; + +namespace GameplayIngredients.Events +{ + public class OnButtonDownEvent : EventBase + { + public string Button = "Fire1"; + + [ReorderableList] + public Callable[] OnButtonDown; + + [ReorderableList] + public Callable[] OnButtonUp; + + void Update() + { + if (Input.GetButtonDown(Button)) + Callable.Call(OnButtonDown, gameObject); + + if (Input.GetButtonUp(Button)) + Callable.Call(OnButtonUp, gameObject); + } + } +} + + diff --git a/LocalPackages/net.peeweek.gameplay-ingredients/Runtime/LevelScripting/Events/OnButtonDownEvent.cs.meta b/LocalPackages/net.peeweek.gameplay-ingredients/Runtime/LevelScripting/Events/OnButtonDownEvent.cs.meta new file mode 100644 index 0000000..b7d25ad --- /dev/null +++ b/LocalPackages/net.peeweek.gameplay-ingredients/Runtime/LevelScripting/Events/OnButtonDownEvent.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 05f246f96cd54614b8232876837d4746 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {fileID: 2800000, guid: c912dd6c3d709974b8973f6e19c10e08, type: 3} + userData: + assetBundleName: + assetBundleVariant: diff --git a/LocalPackages/net.peeweek.gameplay-ingredients/Runtime/LevelScripting/Events/OnColliderEvent.cs b/LocalPackages/net.peeweek.gameplay-ingredients/Runtime/LevelScripting/Events/OnColliderEvent.cs new file mode 100644 index 0000000..b81c209 --- /dev/null +++ b/LocalPackages/net.peeweek.gameplay-ingredients/Runtime/LevelScripting/Events/OnColliderEvent.cs @@ -0,0 +1,43 @@ +using NaughtyAttributes; +using UnityEngine; + +namespace GameplayIngredients.Events +{ + [RequireComponent(typeof(Collider))] + public class OnColliderEvent : EventBase + { + [ReorderableList] + public Callable[] onCollisionEnter; + + [ReorderableList] + public Callable[] onCollisionExit; + + public bool OnlyInteractWithTag = false; + [EnableIf("OnlyInteractWithTag")] + public string Tag = "Player"; + + private void OnCollisionEnter(Collision other) + { + if (OnlyInteractWithTag && other.collider.tag == Tag) + { + Callable.Call(onCollisionEnter, other.collider.gameObject); + } + if (!OnlyInteractWithTag) + { + Callable.Call(onCollisionEnter, other.collider.gameObject); + } + } + + private void OnCollisionExit(Collision other) + { + if (OnlyInteractWithTag && other.collider.tag == Tag) + { + Callable.Call(onCollisionExit, other.collider.gameObject); + } + if (!OnlyInteractWithTag) + { + Callable.Call(onCollisionExit, other.collider.gameObject); + } + } + } +} diff --git a/LocalPackages/net.peeweek.gameplay-ingredients/Runtime/LevelScripting/Events/OnColliderEvent.cs.meta b/LocalPackages/net.peeweek.gameplay-ingredients/Runtime/LevelScripting/Events/OnColliderEvent.cs.meta new file mode 100644 index 0000000..9eba744 --- /dev/null +++ b/LocalPackages/net.peeweek.gameplay-ingredients/Runtime/LevelScripting/Events/OnColliderEvent.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 086b61f209a45d64aa1dae4267461fc5 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/LocalPackages/net.peeweek.gameplay-ingredients/Runtime/LevelScripting/Events/OnDestroyEvent.cs b/LocalPackages/net.peeweek.gameplay-ingredients/Runtime/LevelScripting/Events/OnDestroyEvent.cs new file mode 100644 index 0000000..a9ba18b --- /dev/null +++ b/LocalPackages/net.peeweek.gameplay-ingredients/Runtime/LevelScripting/Events/OnDestroyEvent.cs @@ -0,0 +1,19 @@ +using NaughtyAttributes; +using UnityEngine; + +namespace GameplayIngredients.Events +{ + public class OnDestroyEvent : EventBase + { + [ReorderableList] + public Callable[] onDestroy; + + private void OnDestroy() + { + Callable.Call(onDestroy, gameObject); + } + + } +} + + diff --git a/LocalPackages/net.peeweek.gameplay-ingredients/Runtime/LevelScripting/Events/OnDestroyEvent.cs.meta b/LocalPackages/net.peeweek.gameplay-ingredients/Runtime/LevelScripting/Events/OnDestroyEvent.cs.meta new file mode 100644 index 0000000..3f72144 --- /dev/null +++ b/LocalPackages/net.peeweek.gameplay-ingredients/Runtime/LevelScripting/Events/OnDestroyEvent.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 8d68e1777abe66842b9beb0678f7bdd1 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {fileID: 2800000, guid: 471146a7551176e43bedaba283a78ec5, type: 3} + userData: + assetBundleName: + assetBundleVariant: diff --git a/LocalPackages/net.peeweek.gameplay-ingredients/Runtime/LevelScripting/Events/OnEnableDisableEvent.cs b/LocalPackages/net.peeweek.gameplay-ingredients/Runtime/LevelScripting/Events/OnEnableDisableEvent.cs new file mode 100644 index 0000000..60a45a3 --- /dev/null +++ b/LocalPackages/net.peeweek.gameplay-ingredients/Runtime/LevelScripting/Events/OnEnableDisableEvent.cs @@ -0,0 +1,24 @@ +using NaughtyAttributes; +using UnityEngine.Events; + +namespace GameplayIngredients.Events +{ + public class OnEnableDisableEvent : EventBase + { + [ReorderableList] + public Callable[] OnEnableEvent; + [ReorderableList] + public Callable[] OnDisableEvent; + + private void OnEnable() + { + Callable.Call(OnEnableEvent, gameObject); + } + + private void OnDisable() + { + Callable.Call(OnDisableEvent, gameObject); + } + } +} + diff --git a/LocalPackages/net.peeweek.gameplay-ingredients/Runtime/Hooks/OnEnableDisableHook.cs.meta b/LocalPackages/net.peeweek.gameplay-ingredients/Runtime/LevelScripting/Events/OnEnableDisableEvent.cs.meta similarity index 74% rename from LocalPackages/net.peeweek.gameplay-ingredients/Runtime/Hooks/OnEnableDisableHook.cs.meta rename to LocalPackages/net.peeweek.gameplay-ingredients/Runtime/LevelScripting/Events/OnEnableDisableEvent.cs.meta index 10366ab..dbfa2d9 100644 --- a/LocalPackages/net.peeweek.gameplay-ingredients/Runtime/Hooks/OnEnableDisableHook.cs.meta +++ b/LocalPackages/net.peeweek.gameplay-ingredients/Runtime/LevelScripting/Events/OnEnableDisableEvent.cs.meta @@ -5,7 +5,7 @@ MonoImporter: serializedVersion: 2 defaultReferences: [] executionOrder: 0 - icon: {instanceID: 0} + icon: {fileID: 2800000, guid: aaf61d8ba7c39604a90345b0217bae35, type: 3} userData: assetBundleName: assetBundleVariant: diff --git a/LocalPackages/net.peeweek.gameplay-ingredients/Runtime/LevelScripting/Events/OnGameManagerLevelStart.cs b/LocalPackages/net.peeweek.gameplay-ingredients/Runtime/LevelScripting/Events/OnGameManagerLevelStart.cs new file mode 100644 index 0000000..eebabac --- /dev/null +++ b/LocalPackages/net.peeweek.gameplay-ingredients/Runtime/LevelScripting/Events/OnGameManagerLevelStart.cs @@ -0,0 +1,64 @@ +using NaughtyAttributes; +using System.Collections; +using System.Collections.Generic; +using UnityEngine; + +namespace GameplayIngredients.Events +{ + public class OnGameManagerLevelStart : EventBase + { + public enum GameManagerLevelType + { + MainMenu, + GameLevel + } + + public GameManagerLevelType levelType { get { return m_LevelType; } } + + [SerializeField] + protected GameManagerLevelType m_LevelType = GameManagerLevelType.GameLevel; + + string m_Message; + + [ReorderableList] + public Callable[] OnMessageRecieved; + + void OnEnable() + { + m_Message = GetMessage(m_LevelType); + Messager.RegisterMessage(m_Message, Execute); + } + + void OnDisable() + { + Messager.RemoveMessage(m_Message, Execute); + } + + static string GetMessage(GameManagerLevelType type) + { + switch(type) + { + case GameManagerLevelType.MainMenu: return GameManager.MainMenuStartMessage; + default: + case GameManagerLevelType.GameLevel: return GameManager.GameLevelStartMessage; + } + } + + void Execute(GameObject instigator = null) + { + try + { + Callable.Call(OnMessageRecieved, instigator); + } + catch (System.Exception e) + { + UnityEngine.Debug.LogError(string.Format("OnMessageEvent : Exception Caught while catching message '{0}' on Object '{1}'", m_Message, gameObject.name)); + UnityEngine.Debug.LogException(e); + } + } + + + } +} + + diff --git a/LocalPackages/net.peeweek.gameplay-ingredients/Runtime/LevelScripting/Events/OnGameManagerLevelStart.cs.meta b/LocalPackages/net.peeweek.gameplay-ingredients/Runtime/LevelScripting/Events/OnGameManagerLevelStart.cs.meta new file mode 100644 index 0000000..1675468 --- /dev/null +++ b/LocalPackages/net.peeweek.gameplay-ingredients/Runtime/LevelScripting/Events/OnGameManagerLevelStart.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 2089a4bf3f6e46d40be6510a3989744d +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {fileID: 2800000, guid: af9148c7de0fc6444b7e4e050f116dd0, type: 3} + userData: + assetBundleName: + assetBundleVariant: diff --git a/LocalPackages/net.peeweek.gameplay-ingredients/Runtime/LevelScripting/Events/OnJointBreakEvent.cs b/LocalPackages/net.peeweek.gameplay-ingredients/Runtime/LevelScripting/Events/OnJointBreakEvent.cs new file mode 100644 index 0000000..4bdd63e --- /dev/null +++ b/LocalPackages/net.peeweek.gameplay-ingredients/Runtime/LevelScripting/Events/OnJointBreakEvent.cs @@ -0,0 +1,17 @@ +using NaughtyAttributes; +using UnityEngine; + +namespace GameplayIngredients.Events +{ + [RequireComponent(typeof(Joint))] + public class OnJointBreakEvent : EventBase + { + [ReorderableList] + public Callable[] onJointBreak; + + private void OnJointBreak(float breakForce) + { + Callable.Call(onJointBreak, gameObject); + } + } +} \ No newline at end of file diff --git a/LocalPackages/net.peeweek.gameplay-ingredients/Runtime/LevelScripting/Events/OnJointBreakEvent.cs.meta b/LocalPackages/net.peeweek.gameplay-ingredients/Runtime/LevelScripting/Events/OnJointBreakEvent.cs.meta new file mode 100644 index 0000000..15b8610 --- /dev/null +++ b/LocalPackages/net.peeweek.gameplay-ingredients/Runtime/LevelScripting/Events/OnJointBreakEvent.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 86d3be9dd9f73fa4a9a9e0576d5c7cf0 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/LocalPackages/net.peeweek.gameplay-ingredients/Runtime/LevelScripting/Events/OnKeyDownEvent.cs b/LocalPackages/net.peeweek.gameplay-ingredients/Runtime/LevelScripting/Events/OnKeyDownEvent.cs new file mode 100644 index 0000000..4f62691 --- /dev/null +++ b/LocalPackages/net.peeweek.gameplay-ingredients/Runtime/LevelScripting/Events/OnKeyDownEvent.cs @@ -0,0 +1,27 @@ +using NaughtyAttributes; +using UnityEngine; + +namespace GameplayIngredients.Events +{ + public class OnKeyDownEvent : EventBase + { + public KeyCode Key = KeyCode.F5; + + [ReorderableList] + public Callable[] OnKeyDown; + + [ReorderableList] + public Callable[] OnKeyUp; + + void Update() + { + if (Input.GetKeyDown(Key)) + Callable.Call(OnKeyDown, gameObject); + + if (Input.GetKeyUp(Key)) + Callable.Call(OnKeyUp, gameObject); + } + } +} + + diff --git a/LocalPackages/net.peeweek.gameplay-ingredients/Runtime/Hooks/OnKeyDownHook.cs.meta b/LocalPackages/net.peeweek.gameplay-ingredients/Runtime/LevelScripting/Events/OnKeyDownEvent.cs.meta similarity index 74% rename from LocalPackages/net.peeweek.gameplay-ingredients/Runtime/Hooks/OnKeyDownHook.cs.meta rename to LocalPackages/net.peeweek.gameplay-ingredients/Runtime/LevelScripting/Events/OnKeyDownEvent.cs.meta index c1a60a6..9eb8ce8 100644 --- a/LocalPackages/net.peeweek.gameplay-ingredients/Runtime/Hooks/OnKeyDownHook.cs.meta +++ b/LocalPackages/net.peeweek.gameplay-ingredients/Runtime/LevelScripting/Events/OnKeyDownEvent.cs.meta @@ -5,7 +5,7 @@ MonoImporter: serializedVersion: 2 defaultReferences: [] executionOrder: 0 - icon: {instanceID: 0} + icon: {fileID: 2800000, guid: c912dd6c3d709974b8973f6e19c10e08, type: 3} userData: assetBundleName: assetBundleVariant: diff --git a/LocalPackages/net.peeweek.gameplay-ingredients/Runtime/LevelScripting/Events/OnMessageEvent.cs b/LocalPackages/net.peeweek.gameplay-ingredients/Runtime/LevelScripting/Events/OnMessageEvent.cs new file mode 100644 index 0000000..8cba880 --- /dev/null +++ b/LocalPackages/net.peeweek.gameplay-ingredients/Runtime/LevelScripting/Events/OnMessageEvent.cs @@ -0,0 +1,38 @@ +using NaughtyAttributes; +using UnityEngine; + +namespace GameplayIngredients.Events +{ + public class OnMessageEvent : EventBase + { + public string MessageName = "Message"; + + [ReorderableList] + public Callable[] OnMessageRecieved; + + void OnEnable() + { + Messager.RegisterMessage(MessageName, Execute); + } + + void OnDisable() + { + Messager.RemoveMessage(MessageName, Execute); + } + + void Execute(GameObject instigator) + { + try + { + Callable.Call(OnMessageRecieved, instigator); + } + catch(System.Exception e) + { + UnityEngine.Debug.LogError(string.Format("OnMessageEvent : Exception Caught while catching message '{0}' on Object '{1}'", MessageName, gameObject.name)); + UnityEngine.Debug.LogException(e); + } + } + + + } +} diff --git a/LocalPackages/net.peeweek.gameplay-ingredients/Runtime/Hooks/OnMessageHook.cs.meta b/LocalPackages/net.peeweek.gameplay-ingredients/Runtime/LevelScripting/Events/OnMessageEvent.cs.meta similarity index 74% rename from LocalPackages/net.peeweek.gameplay-ingredients/Runtime/Hooks/OnMessageHook.cs.meta rename to LocalPackages/net.peeweek.gameplay-ingredients/Runtime/LevelScripting/Events/OnMessageEvent.cs.meta index 18f89af..c9e4e0d 100644 --- a/LocalPackages/net.peeweek.gameplay-ingredients/Runtime/Hooks/OnMessageHook.cs.meta +++ b/LocalPackages/net.peeweek.gameplay-ingredients/Runtime/LevelScripting/Events/OnMessageEvent.cs.meta @@ -5,7 +5,7 @@ MonoImporter: serializedVersion: 2 defaultReferences: [] executionOrder: 0 - icon: {instanceID: 0} + icon: {fileID: 2800000, guid: e6ec4d94329af0a41a3604eb20f8c691, type: 3} userData: assetBundleName: assetBundleVariant: diff --git a/LocalPackages/net.peeweek.gameplay-ingredients/Runtime/LevelScripting/Events/OnMouseDownEvent.cs b/LocalPackages/net.peeweek.gameplay-ingredients/Runtime/LevelScripting/Events/OnMouseDownEvent.cs new file mode 100644 index 0000000..2714568 --- /dev/null +++ b/LocalPackages/net.peeweek.gameplay-ingredients/Runtime/LevelScripting/Events/OnMouseDownEvent.cs @@ -0,0 +1,19 @@ +using NaughtyAttributes; +using UnityEngine; + +namespace GameplayIngredients.Events +{ + [RequireComponent(typeof(Collider))] + public class OnMouseDownEvent : EventBase + { + [ReorderableList] + public Callable[] MouseDown; + + private void OnMouseDown() + { + Callable.Call(MouseDown, this.gameObject); + } + } +} + + diff --git a/LocalPackages/net.peeweek.gameplay-ingredients/Runtime/LevelScripting/Events/OnMouseDownEvent.cs.meta b/LocalPackages/net.peeweek.gameplay-ingredients/Runtime/LevelScripting/Events/OnMouseDownEvent.cs.meta new file mode 100644 index 0000000..c818308 --- /dev/null +++ b/LocalPackages/net.peeweek.gameplay-ingredients/Runtime/LevelScripting/Events/OnMouseDownEvent.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: cf5a82a085a6cb14fb0e2cd1fb1faf15 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {fileID: 2800000, guid: ba45de1ff09adbf459f4db4bf50a8c14, type: 3} + userData: + assetBundleName: + assetBundleVariant: diff --git a/LocalPackages/net.peeweek.gameplay-ingredients/Runtime/LevelScripting/Events/OnMouseHoverEvent.cs b/LocalPackages/net.peeweek.gameplay-ingredients/Runtime/LevelScripting/Events/OnMouseHoverEvent.cs new file mode 100644 index 0000000..6f31375 --- /dev/null +++ b/LocalPackages/net.peeweek.gameplay-ingredients/Runtime/LevelScripting/Events/OnMouseHoverEvent.cs @@ -0,0 +1,27 @@ +using NaughtyAttributes; +using UnityEngine; + +namespace GameplayIngredients.Events +{ + [RequireComponent(typeof(Collider))] + public class OnMouseHoverEvent : EventBase + { + [ReorderableList] + public Callable[] OnHoverIn; + [ReorderableList] + public Callable[] OnHoverOut; + + + private void OnMouseEnter() + { + Callable.Call(OnHoverIn, this.gameObject); + } + + private void OnMouseExit() + { + Callable.Call(OnHoverOut, this.gameObject); + } + } +} + + diff --git a/LocalPackages/net.peeweek.gameplay-ingredients/Runtime/LevelScripting/Events/OnMouseHoverEvent.cs.meta b/LocalPackages/net.peeweek.gameplay-ingredients/Runtime/LevelScripting/Events/OnMouseHoverEvent.cs.meta new file mode 100644 index 0000000..ee9faa6 --- /dev/null +++ b/LocalPackages/net.peeweek.gameplay-ingredients/Runtime/LevelScripting/Events/OnMouseHoverEvent.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 5870adaa301ade240bf1d3f8a18a7617 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {fileID: 2800000, guid: ba45de1ff09adbf459f4db4bf50a8c14, type: 3} + userData: + assetBundleName: + assetBundleVariant: diff --git a/LocalPackages/net.peeweek.gameplay-ingredients/Runtime/LevelScripting/Events/OnStartEvent.cs b/LocalPackages/net.peeweek.gameplay-ingredients/Runtime/LevelScripting/Events/OnStartEvent.cs new file mode 100644 index 0000000..791bb67 --- /dev/null +++ b/LocalPackages/net.peeweek.gameplay-ingredients/Runtime/LevelScripting/Events/OnStartEvent.cs @@ -0,0 +1,17 @@ +using NaughtyAttributes; + +namespace GameplayIngredients.Events +{ + public class OnStartEvent : EventBase + { + [ReorderableList] + public Callable[] OnStart; + + private void Start() + { + Callable.Call(OnStart, gameObject); + } + } +} + + diff --git a/LocalPackages/net.peeweek.gameplay-ingredients/Runtime/LevelScripting/Events/OnStartEvent.cs.meta b/LocalPackages/net.peeweek.gameplay-ingredients/Runtime/LevelScripting/Events/OnStartEvent.cs.meta new file mode 100644 index 0000000..170ae3a --- /dev/null +++ b/LocalPackages/net.peeweek.gameplay-ingredients/Runtime/LevelScripting/Events/OnStartEvent.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 718c1945292acbd4497cd28bcaa94f8d +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {fileID: 2800000, guid: bfd8018fed1fdd84ea969e58a0cb01b8, type: 3} + userData: + assetBundleName: + assetBundleVariant: diff --git a/LocalPackages/net.peeweek.gameplay-ingredients/Runtime/LevelScripting/Events/OnTriggerEvent.cs b/LocalPackages/net.peeweek.gameplay-ingredients/Runtime/LevelScripting/Events/OnTriggerEvent.cs new file mode 100644 index 0000000..3bb8eb0 --- /dev/null +++ b/LocalPackages/net.peeweek.gameplay-ingredients/Runtime/LevelScripting/Events/OnTriggerEvent.cs @@ -0,0 +1,42 @@ +using NaughtyAttributes; +using UnityEngine; + +namespace GameplayIngredients.Events +{ + public class OnTriggerEvent : EventBase + { + [ReorderableList] + public Callable[] onTriggerEnter; + + [ReorderableList] + public Callable[] onTriggerExit; + + public bool OnlyInteractWithTag = true; + [EnableIf("OnlyInteractWithTag")] + public string Tag = "Player"; + + private void OnTriggerEnter(Collider other) + { + if (OnlyInteractWithTag && other.tag == Tag ) + { + Callable.Call(onTriggerEnter, other.gameObject); + } + if (!OnlyInteractWithTag) + { + Callable.Call(onTriggerEnter, other.gameObject); + } + } + + private void OnTriggerExit(Collider other) + { + if (OnlyInteractWithTag && other.tag == Tag ) + { + Callable.Call(onTriggerExit, other.gameObject); + } + if (!OnlyInteractWithTag) + { + Callable.Call(onTriggerExit, other.gameObject); + } + } + } +} diff --git a/LocalPackages/net.peeweek.gameplay-ingredients/Runtime/Hooks/OnTriggerHook.cs.meta b/LocalPackages/net.peeweek.gameplay-ingredients/Runtime/LevelScripting/Events/OnTriggerEvent.cs.meta similarity index 78% rename from LocalPackages/net.peeweek.gameplay-ingredients/Runtime/Hooks/OnTriggerHook.cs.meta rename to LocalPackages/net.peeweek.gameplay-ingredients/Runtime/LevelScripting/Events/OnTriggerEvent.cs.meta index b04509d..34511e2 100644 --- a/LocalPackages/net.peeweek.gameplay-ingredients/Runtime/Hooks/OnTriggerHook.cs.meta +++ b/LocalPackages/net.peeweek.gameplay-ingredients/Runtime/LevelScripting/Events/OnTriggerEvent.cs.meta @@ -5,7 +5,7 @@ MonoImporter: serializedVersion: 2 defaultReferences: [] executionOrder: 0 - icon: {fileID: 2800000, guid: 72c736bbabc19884988f7d3f5376ee26, type: 3} + icon: {fileID: 2800000, guid: 6059a3dad39232d428c4045188ba78a7, type: 3} userData: assetBundleName: assetBundleVariant: diff --git a/LocalPackages/net.peeweek.gameplay-ingredients/Runtime/LevelScripting/Events/OnUpdateEvent.cs b/LocalPackages/net.peeweek.gameplay-ingredients/Runtime/LevelScripting/Events/OnUpdateEvent.cs new file mode 100644 index 0000000..76cedf5 --- /dev/null +++ b/LocalPackages/net.peeweek.gameplay-ingredients/Runtime/LevelScripting/Events/OnUpdateEvent.cs @@ -0,0 +1,27 @@ +using NaughtyAttributes; + +namespace GameplayIngredients.Events +{ + public class OnUpdateEvent : EventBase + { + [ReorderableList, ShowIf("AllowUpdateCalls"), InfoBox("Update Calls are disabled on this project. Check your GameplayIngredientsSettings asset if you want to allow them.", InfoBoxType.Warning, "ForbidUpdateCalls")] + public Callable[] OnUpdate; + + private void OnEnable() + { + + } + + private void OnDisable() + { + + } + + private void Update() + { + Callable.Call(OnUpdate, gameObject); + } + } +} + + diff --git a/LocalPackages/net.peeweek.gameplay-ingredients/Runtime/LevelScripting/Events/OnUpdateEvent.cs.meta b/LocalPackages/net.peeweek.gameplay-ingredients/Runtime/LevelScripting/Events/OnUpdateEvent.cs.meta new file mode 100644 index 0000000..560bee2 --- /dev/null +++ b/LocalPackages/net.peeweek.gameplay-ingredients/Runtime/LevelScripting/Events/OnUpdateEvent.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 9a5a3967c24bae54bb6c0fad57a1216c +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {fileID: 2800000, guid: bfd8018fed1fdd84ea969e58a0cb01b8, type: 3} + userData: + assetBundleName: + assetBundleVariant: diff --git a/LocalPackages/net.peeweek.gameplay-ingredients/Runtime/LevelScripting/Events/OnVisibilityEvent.cs b/LocalPackages/net.peeweek.gameplay-ingredients/Runtime/LevelScripting/Events/OnVisibilityEvent.cs new file mode 100644 index 0000000..e13db9d --- /dev/null +++ b/LocalPackages/net.peeweek.gameplay-ingredients/Runtime/LevelScripting/Events/OnVisibilityEvent.cs @@ -0,0 +1,26 @@ +using NaughtyAttributes; +using UnityEngine; + +namespace GameplayIngredients.Events +{ + [RequireComponent(typeof(Renderer))] + public class OnVisibilityEvent : EventBase + { + [ReorderableList] + public Callable[] OnVisible; + [ReorderableList] + public Callable[] OnInvisible; + + private void OnBecameVisible() + { + Callable.Call(OnVisible, this.gameObject); + } + + private void OnBecameInvisible() + { + Callable.Call(OnInvisible, this.gameObject); + } + } +} + + diff --git a/LocalPackages/net.peeweek.gameplay-ingredients/Runtime/LevelScripting/Events/OnVisibilityEvent.cs.meta b/LocalPackages/net.peeweek.gameplay-ingredients/Runtime/LevelScripting/Events/OnVisibilityEvent.cs.meta new file mode 100644 index 0000000..a0ba567 --- /dev/null +++ b/LocalPackages/net.peeweek.gameplay-ingredients/Runtime/LevelScripting/Events/OnVisibilityEvent.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 8a3e4099ce5c9524782709429b929104 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {fileID: 2800000, guid: aaf61d8ba7c39604a90345b0217bae35, type: 3} + userData: + assetBundleName: + assetBundleVariant: diff --git a/LocalPackages/net.peeweek.gameplay-ingredients/Runtime/LevelScripting/ICallable.cs b/LocalPackages/net.peeweek.gameplay-ingredients/Runtime/LevelScripting/ICallable.cs new file mode 100644 index 0000000..f95ee6e --- /dev/null +++ b/LocalPackages/net.peeweek.gameplay-ingredients/Runtime/LevelScripting/ICallable.cs @@ -0,0 +1,12 @@ +using System.Collections; +using System.Collections.Generic; +using UnityEngine; + +namespace GameplayIngredients +{ + public interface ICallable + { + void Execute(GameObject instigator = null); + } + +} diff --git a/LocalPackages/net.peeweek.gameplay-ingredients/Runtime/LevelScripting/ICallable.cs.meta b/LocalPackages/net.peeweek.gameplay-ingredients/Runtime/LevelScripting/ICallable.cs.meta new file mode 100644 index 0000000..b34e240 --- /dev/null +++ b/LocalPackages/net.peeweek.gameplay-ingredients/Runtime/LevelScripting/ICallable.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 833e7b346ee69444a8fb1dec758945ad +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/LocalPackages/net.peeweek.gameplay-ingredients/Runtime/Logic.meta b/LocalPackages/net.peeweek.gameplay-ingredients/Runtime/LevelScripting/Logic.meta similarity index 100% rename from LocalPackages/net.peeweek.gameplay-ingredients/Runtime/Logic.meta rename to LocalPackages/net.peeweek.gameplay-ingredients/Runtime/LevelScripting/Logic.meta diff --git a/LocalPackages/net.peeweek.gameplay-ingredients/Runtime/Logic/ConditionalLogic.cs b/LocalPackages/net.peeweek.gameplay-ingredients/Runtime/LevelScripting/Logic/ConditionalLogic.cs similarity index 73% rename from LocalPackages/net.peeweek.gameplay-ingredients/Runtime/Logic/ConditionalLogic.cs rename to LocalPackages/net.peeweek.gameplay-ingredients/Runtime/LevelScripting/Logic/ConditionalLogic.cs index c33a185..c3278f0 100644 --- a/LocalPackages/net.peeweek.gameplay-ingredients/Runtime/Logic/ConditionalLogic.cs +++ b/LocalPackages/net.peeweek.gameplay-ingredients/Runtime/LevelScripting/Logic/ConditionalLogic.cs @@ -1,19 +1,24 @@ +using NaughtyAttributes; using System; +using UnityEngine; using UnityEngine.Events; namespace GameplayIngredients.Logic { public abstract class ConditionalLogic : LogicBase { - public UnityEvent OnConditionValid; - public UnityEvent OnConditionInvalid; + [ReorderableList] + public Callable[] OnConditionValid; - public override void Execute() + [ReorderableList] + public Callable[] OnConditionInvalid; + + public override void Execute(GameObject instigator = null) { if (GetCondition()) - OnConditionValid.Invoke(); + Callable.Call(OnConditionValid, instigator); else - OnConditionInvalid.Invoke(); + Callable.Call(OnConditionInvalid, instigator); } public abstract bool GetCondition(); diff --git a/LocalPackages/net.peeweek.gameplay-ingredients/Runtime/Logic/ConditionalLogic.cs.meta b/LocalPackages/net.peeweek.gameplay-ingredients/Runtime/LevelScripting/Logic/ConditionalLogic.cs.meta similarity index 74% rename from LocalPackages/net.peeweek.gameplay-ingredients/Runtime/Logic/ConditionalLogic.cs.meta rename to LocalPackages/net.peeweek.gameplay-ingredients/Runtime/LevelScripting/Logic/ConditionalLogic.cs.meta index edb70d6..ff09535 100644 --- a/LocalPackages/net.peeweek.gameplay-ingredients/Runtime/Logic/ConditionalLogic.cs.meta +++ b/LocalPackages/net.peeweek.gameplay-ingredients/Runtime/LevelScripting/Logic/ConditionalLogic.cs.meta @@ -5,7 +5,7 @@ MonoImporter: serializedVersion: 2 defaultReferences: [] executionOrder: 0 - icon: {instanceID: 0} + icon: {fileID: 2800000, guid: 6d0a734cdedf48d478f3fcc7612af66f, type: 3} userData: assetBundleName: assetBundleVariant: diff --git a/LocalPackages/net.peeweek.gameplay-ingredients/Runtime/Logic/DelayedLogic.cs b/LocalPackages/net.peeweek.gameplay-ingredients/Runtime/LevelScripting/Logic/DelayedLogic.cs similarity index 54% rename from LocalPackages/net.peeweek.gameplay-ingredients/Runtime/Logic/DelayedLogic.cs rename to LocalPackages/net.peeweek.gameplay-ingredients/Runtime/LevelScripting/Logic/DelayedLogic.cs index d765bb7..d68cc3f 100644 --- a/LocalPackages/net.peeweek.gameplay-ingredients/Runtime/Logic/DelayedLogic.cs +++ b/LocalPackages/net.peeweek.gameplay-ingredients/Runtime/LevelScripting/Logic/DelayedLogic.cs @@ -1,3 +1,4 @@ +using NaughtyAttributes; using System.Collections; using UnityEngine; using UnityEngine.Events; @@ -7,33 +8,37 @@ namespace GameplayIngredients.Logic public class DelayedLogic : LogicBase { public float Delay = 1.0f; - public UnityEvent OnDelayComplete; - public UnityEvent OnCanceled; + + [ReorderableList] + public Callable[] OnDelayComplete; + + [ReorderableList] + public Callable[] OnCanceled; IEnumerator m_Coroutine; - public void Cancel() + public void Cancel(GameObject instigator = null) { if(m_Coroutine != null) { StopCoroutine(m_Coroutine); - OnCanceled.Invoke(); + Callable.Call(OnCanceled, instigator); m_Coroutine = null; } } - public override void Execute() + public override void Execute(GameObject instigator = null) { if (m_Coroutine != null) Cancel(); - m_Coroutine = RunDelay(Delay); + m_Coroutine = RunDelay(Delay, instigator); StartCoroutine(m_Coroutine); } - IEnumerator RunDelay(float Seconds) + IEnumerator RunDelay(float Seconds, GameObject instigator = null) { yield return new WaitForSeconds(Seconds); - OnDelayComplete.Invoke(); + Callable.Call(OnDelayComplete, instigator); m_Coroutine = null; } } diff --git a/LocalPackages/net.peeweek.gameplay-ingredients/Runtime/Logic/DelayedLogic.cs.meta b/LocalPackages/net.peeweek.gameplay-ingredients/Runtime/LevelScripting/Logic/DelayedLogic.cs.meta similarity index 74% rename from LocalPackages/net.peeweek.gameplay-ingredients/Runtime/Logic/DelayedLogic.cs.meta rename to LocalPackages/net.peeweek.gameplay-ingredients/Runtime/LevelScripting/Logic/DelayedLogic.cs.meta index dde7838..72d4ade 100644 --- a/LocalPackages/net.peeweek.gameplay-ingredients/Runtime/Logic/DelayedLogic.cs.meta +++ b/LocalPackages/net.peeweek.gameplay-ingredients/Runtime/LevelScripting/Logic/DelayedLogic.cs.meta @@ -5,7 +5,7 @@ MonoImporter: serializedVersion: 2 defaultReferences: [] executionOrder: 0 - icon: {instanceID: 0} + icon: {fileID: 2800000, guid: 6d0a734cdedf48d478f3fcc7612af66f, type: 3} userData: assetBundleName: assetBundleVariant: diff --git a/LocalPackages/net.peeweek.gameplay-ingredients/Runtime/LevelScripting/Logic/EditorOnlyLogic.cs b/LocalPackages/net.peeweek.gameplay-ingredients/Runtime/LevelScripting/Logic/EditorOnlyLogic.cs new file mode 100644 index 0000000..bc5599c --- /dev/null +++ b/LocalPackages/net.peeweek.gameplay-ingredients/Runtime/LevelScripting/Logic/EditorOnlyLogic.cs @@ -0,0 +1,51 @@ +using UnityEngine; +using UnityEngine.Events; +using NaughtyAttributes; + +namespace GameplayIngredients.Logic +{ + public class EditorOnlyLogic : LogicBase + { + public enum Mode + { + PlayerAndEditor, + EditorOnly, + PlayerOnly + } + + [Tooltip("Disables when using Play From Here")] + public bool DisableOnPlayFromHere = false; + + public Mode ExecutionPath = Mode.PlayerAndEditor; + + [ReorderableList] + public Callable[] OnExecute; + + public override void Execute(GameObject instigator = null) + { + bool acceptPlayFromHere = !(DisableOnPlayFromHere && (PlayerPrefs.GetInt("PlayFromHere") == 1)); + + switch(ExecutionPath) + { + case Mode.PlayerAndEditor: + if (acceptPlayFromHere) + Callable.Call(OnExecute, instigator); + break; + case Mode.EditorOnly: + if (Application.isEditor && acceptPlayFromHere) + Callable.Call(OnExecute, instigator); + break; + + case Mode.PlayerOnly: + if (!Application.isEditor && acceptPlayFromHere) + Callable.Call(OnExecute, instigator); + break; + } + } + + public override string GetDefaultName() + { + return $"If {ExecutionPath} {(DisableOnPlayFromHere? "(Not Play From Here)":"")}" ; + } + } +} diff --git a/LocalPackages/net.peeweek.gameplay-ingredients/Runtime/Actions/EditorOnlyAction.cs.meta b/LocalPackages/net.peeweek.gameplay-ingredients/Runtime/LevelScripting/Logic/EditorOnlyLogic.cs.meta similarity index 74% rename from LocalPackages/net.peeweek.gameplay-ingredients/Runtime/Actions/EditorOnlyAction.cs.meta rename to LocalPackages/net.peeweek.gameplay-ingredients/Runtime/LevelScripting/Logic/EditorOnlyLogic.cs.meta index d21ff8b..f31f648 100644 --- a/LocalPackages/net.peeweek.gameplay-ingredients/Runtime/Actions/EditorOnlyAction.cs.meta +++ b/LocalPackages/net.peeweek.gameplay-ingredients/Runtime/LevelScripting/Logic/EditorOnlyLogic.cs.meta @@ -5,7 +5,7 @@ MonoImporter: serializedVersion: 2 defaultReferences: [] executionOrder: 0 - icon: {instanceID: 0} + icon: {fileID: 2800000, guid: 6d0a734cdedf48d478f3fcc7612af66f, type: 3} userData: assetBundleName: assetBundleVariant: diff --git a/LocalPackages/net.peeweek.gameplay-ingredients/Runtime/LevelScripting/Logic/FlipFlopLogic.cs b/LocalPackages/net.peeweek.gameplay-ingredients/Runtime/LevelScripting/Logic/FlipFlopLogic.cs new file mode 100644 index 0000000..7716282 --- /dev/null +++ b/LocalPackages/net.peeweek.gameplay-ingredients/Runtime/LevelScripting/Logic/FlipFlopLogic.cs @@ -0,0 +1,43 @@ +using UnityEngine; +using NaughtyAttributes; + +namespace GameplayIngredients.Logic +{ + public class FlipFlopLogic : LogicBase + { + public enum State + { + Flip, + Flop + } + + public State InitialState = State.Flip; + + [ReorderableList] + public Callable[] OnFlip; + + [ReorderableList] + public Callable[] OnFlop; + + private State state; + + public void OnEnable() + { + state = InitialState; + } + + public override void Execute(GameObject instigator = null) + { + if (state == State.Flop) + { + Callable.Call(OnFlip, instigator); + state = State.Flip; + } + else + { + Callable.Call(OnFlop, instigator); + state = State.Flop; + } + } + } +} diff --git a/LocalPackages/net.peeweek.gameplay-ingredients/Runtime/LevelScripting/Logic/FlipFlopLogic.cs.meta b/LocalPackages/net.peeweek.gameplay-ingredients/Runtime/LevelScripting/Logic/FlipFlopLogic.cs.meta new file mode 100644 index 0000000..b46b5a0 --- /dev/null +++ b/LocalPackages/net.peeweek.gameplay-ingredients/Runtime/LevelScripting/Logic/FlipFlopLogic.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 6331218ad8cbbe64cb1230f96dac5ffe +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {fileID: 2800000, guid: 6d0a734cdedf48d478f3fcc7612af66f, type: 3} + userData: + assetBundleName: + assetBundleVariant: diff --git a/LocalPackages/net.peeweek.gameplay-ingredients/Runtime/LevelScripting/Logic/Logic.cs b/LocalPackages/net.peeweek.gameplay-ingredients/Runtime/LevelScripting/Logic/Logic.cs new file mode 100644 index 0000000..22d3673 --- /dev/null +++ b/LocalPackages/net.peeweek.gameplay-ingredients/Runtime/LevelScripting/Logic/Logic.cs @@ -0,0 +1,19 @@ +using NaughtyAttributes; +using System.Collections; +using UnityEngine; +using UnityEngine.Events; + +namespace GameplayIngredients.Logic +{ + public class Logic : LogicBase + { + [ReorderableList] + public Callable[] Calls; + + public override void Execute(GameObject instigator = null) + { + Callable.Call(Calls, instigator); + } + } +} + diff --git a/LocalPackages/net.peeweek.gameplay-ingredients/Runtime/LevelScripting/Logic/Logic.cs.meta b/LocalPackages/net.peeweek.gameplay-ingredients/Runtime/LevelScripting/Logic/Logic.cs.meta new file mode 100644 index 0000000..195e0b7 --- /dev/null +++ b/LocalPackages/net.peeweek.gameplay-ingredients/Runtime/LevelScripting/Logic/Logic.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 188f26a3e283eda41a6522c93af8996a +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {fileID: 2800000, guid: 6d0a734cdedf48d478f3fcc7612af66f, type: 3} + userData: + assetBundleName: + assetBundleVariant: diff --git a/LocalPackages/net.peeweek.gameplay-ingredients/Runtime/LevelScripting/Logic/LogicBase.cs b/LocalPackages/net.peeweek.gameplay-ingredients/Runtime/LevelScripting/Logic/LogicBase.cs new file mode 100644 index 0000000..22739ac --- /dev/null +++ b/LocalPackages/net.peeweek.gameplay-ingredients/Runtime/LevelScripting/Logic/LogicBase.cs @@ -0,0 +1,13 @@ +using NaughtyAttributes; +using UnityEngine; + +namespace GameplayIngredients.Logic +{ + public abstract class LogicBase : Callable + { + public override sealed string ToString() + { + return "Logic : " + Name; + } + } +} diff --git a/LocalPackages/net.peeweek.gameplay-ingredients/Runtime/Logic/LogicBase.cs.meta b/LocalPackages/net.peeweek.gameplay-ingredients/Runtime/LevelScripting/Logic/LogicBase.cs.meta similarity index 100% rename from LocalPackages/net.peeweek.gameplay-ingredients/Runtime/Logic/LogicBase.cs.meta rename to LocalPackages/net.peeweek.gameplay-ingredients/Runtime/LevelScripting/Logic/LogicBase.cs.meta diff --git a/LocalPackages/net.peeweek.gameplay-ingredients/Runtime/LevelScripting/Logic/NTimesLogic.cs b/LocalPackages/net.peeweek.gameplay-ingredients/Runtime/LevelScripting/Logic/NTimesLogic.cs new file mode 100644 index 0000000..486db5e --- /dev/null +++ b/LocalPackages/net.peeweek.gameplay-ingredients/Runtime/LevelScripting/Logic/NTimesLogic.cs @@ -0,0 +1,37 @@ +using NaughtyAttributes; +using System.Collections; +using UnityEngine; +using UnityEngine.Events; + +namespace GameplayIngredients.Logic +{ + public class NTimesLogic : LogicBase + { + [ReorderableList] + public Callable[] Calls; + [Min(1), SerializeField] + protected int Count = 1; + + int m_RemainingCount; + + void Awake() + { + ResetCount(); + } + + public void ResetCount() + { + m_RemainingCount = Count; + } + + public override void Execute(GameObject instigator = null) + { + if(m_RemainingCount > 0) + { + m_RemainingCount--; + Callable.Call(Calls, instigator); + } + } + } +} + diff --git a/LocalPackages/net.peeweek.gameplay-ingredients/Runtime/LevelScripting/Logic/NTimesLogic.cs.meta b/LocalPackages/net.peeweek.gameplay-ingredients/Runtime/LevelScripting/Logic/NTimesLogic.cs.meta new file mode 100644 index 0000000..2e62943 --- /dev/null +++ b/LocalPackages/net.peeweek.gameplay-ingredients/Runtime/LevelScripting/Logic/NTimesLogic.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: e5238971271a4cd43b4a07ba72a48e09 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {fileID: 2800000, guid: 6d0a734cdedf48d478f3fcc7612af66f, type: 3} + userData: + assetBundleName: + assetBundleVariant: diff --git a/LocalPackages/net.peeweek.gameplay-ingredients/Runtime/Logic/NextFrameLogic.cs b/LocalPackages/net.peeweek.gameplay-ingredients/Runtime/LevelScripting/Logic/NextFrameLogic.cs similarity index 53% rename from LocalPackages/net.peeweek.gameplay-ingredients/Runtime/Logic/NextFrameLogic.cs rename to LocalPackages/net.peeweek.gameplay-ingredients/Runtime/LevelScripting/Logic/NextFrameLogic.cs index 8d40210..cd01f6e 100644 --- a/LocalPackages/net.peeweek.gameplay-ingredients/Runtime/Logic/NextFrameLogic.cs +++ b/LocalPackages/net.peeweek.gameplay-ingredients/Runtime/LevelScripting/Logic/NextFrameLogic.cs @@ -1,3 +1,4 @@ +using NaughtyAttributes; using System.Collections; using UnityEngine; using UnityEngine.Events; @@ -6,19 +7,20 @@ namespace GameplayIngredients.Logic { public class NextFrameLogic : LogicBase { - public UnityEvent OnComplete; + [ReorderableList] + public Callable[] OnNextFrame; IEnumerator m_Coroutine; - public override void Execute() + public override void Execute(GameObject instigator = null) { - m_Coroutine = RunDelay(); + m_Coroutine = RunDelay(instigator); StartCoroutine(m_Coroutine); } - IEnumerator RunDelay() + IEnumerator RunDelay(GameObject instigator = null) { yield return new WaitForEndOfFrame(); - OnComplete.Invoke(); + Callable.Call(OnNextFrame, instigator); m_Coroutine = null; } } diff --git a/LocalPackages/net.peeweek.gameplay-ingredients/Runtime/Logic/NextFrameLogic.cs.meta b/LocalPackages/net.peeweek.gameplay-ingredients/Runtime/LevelScripting/Logic/NextFrameLogic.cs.meta similarity index 74% rename from LocalPackages/net.peeweek.gameplay-ingredients/Runtime/Logic/NextFrameLogic.cs.meta rename to LocalPackages/net.peeweek.gameplay-ingredients/Runtime/LevelScripting/Logic/NextFrameLogic.cs.meta index 65d72d4..95bfa58 100644 --- a/LocalPackages/net.peeweek.gameplay-ingredients/Runtime/Logic/NextFrameLogic.cs.meta +++ b/LocalPackages/net.peeweek.gameplay-ingredients/Runtime/LevelScripting/Logic/NextFrameLogic.cs.meta @@ -5,7 +5,7 @@ MonoImporter: serializedVersion: 2 defaultReferences: [] executionOrder: 0 - icon: {instanceID: 0} + icon: {fileID: 2800000, guid: 6d0a734cdedf48d478f3fcc7612af66f, type: 3} userData: assetBundleName: assetBundleVariant: diff --git a/LocalPackages/net.peeweek.gameplay-ingredients/Runtime/LevelScripting/Logic/PlatformLogic.cs b/LocalPackages/net.peeweek.gameplay-ingredients/Runtime/LevelScripting/Logic/PlatformLogic.cs new file mode 100644 index 0000000..27bcec8 --- /dev/null +++ b/LocalPackages/net.peeweek.gameplay-ingredients/Runtime/LevelScripting/Logic/PlatformLogic.cs @@ -0,0 +1,33 @@ +using NaughtyAttributes; +using System.Collections; +using System.Linq; +using UnityEngine; +using UnityEngine.Events; + +namespace GameplayIngredients.Logic +{ + public class PlatformLogic : LogicBase + { + public enum InclusionMode + { + IsTarget, + IsNotTarget + } + + [ReorderableList] + public RuntimePlatform[] platforms; + + public InclusionMode inclusionMode = InclusionMode.IsTarget; + + [ReorderableList] + public Callable[] Calls; + + public override void Execute(GameObject instigator = null) + { + + if(platforms.Contains(Application.platform) == (inclusionMode == InclusionMode.IsTarget)) + Call(Calls, instigator); + } + } +} + diff --git a/LocalPackages/net.peeweek.gameplay-ingredients/Runtime/LevelScripting/Logic/PlatformLogic.cs.meta b/LocalPackages/net.peeweek.gameplay-ingredients/Runtime/LevelScripting/Logic/PlatformLogic.cs.meta new file mode 100644 index 0000000..23c3d9d --- /dev/null +++ b/LocalPackages/net.peeweek.gameplay-ingredients/Runtime/LevelScripting/Logic/PlatformLogic.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 3a2d9e7c18466144eaae9232d1d52e61 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {fileID: 2800000, guid: 6d0a734cdedf48d478f3fcc7612af66f, type: 3} + userData: + assetBundleName: + assetBundleVariant: diff --git a/LocalPackages/net.peeweek.gameplay-ingredients/Runtime/LevelScripting/Logic/RandomLogic.cs b/LocalPackages/net.peeweek.gameplay-ingredients/Runtime/LevelScripting/Logic/RandomLogic.cs new file mode 100644 index 0000000..7e29930 --- /dev/null +++ b/LocalPackages/net.peeweek.gameplay-ingredients/Runtime/LevelScripting/Logic/RandomLogic.cs @@ -0,0 +1,20 @@ +using NaughtyAttributes; +using System.Collections; +using UnityEngine; +using UnityEngine.Events; + +namespace GameplayIngredients.Logic +{ + public class RandomLogic : LogicBase + { + [ReorderableList] + public Callable[] RandomCalls; + + public override void Execute(GameObject instigator = null) + { + int r = Random.Range(0, RandomCalls.Length); + Callable.Call(RandomCalls[r], instigator); + } + } +} + diff --git a/LocalPackages/net.peeweek.gameplay-ingredients/Runtime/LevelScripting/Logic/RandomLogic.cs.meta b/LocalPackages/net.peeweek.gameplay-ingredients/Runtime/LevelScripting/Logic/RandomLogic.cs.meta new file mode 100644 index 0000000..a53baba --- /dev/null +++ b/LocalPackages/net.peeweek.gameplay-ingredients/Runtime/LevelScripting/Logic/RandomLogic.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 0de0c9f608a44664f8864259a781085e +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {fileID: 2800000, guid: 6d0a734cdedf48d478f3fcc7612af66f, type: 3} + userData: + assetBundleName: + assetBundleVariant: diff --git a/LocalPackages/net.peeweek.gameplay-ingredients/Runtime/LevelScripting/Logic/SaveDataLogic.cs b/LocalPackages/net.peeweek.gameplay-ingredients/Runtime/LevelScripting/Logic/SaveDataLogic.cs new file mode 100644 index 0000000..bc3fac8 --- /dev/null +++ b/LocalPackages/net.peeweek.gameplay-ingredients/Runtime/LevelScripting/Logic/SaveDataLogic.cs @@ -0,0 +1,136 @@ +using NaughtyAttributes; +using System.Collections; +using System.Collections.Generic; +using UnityEngine; + +namespace GameplayIngredients.Logic +{ + public class SaveDataLogic : LogicBase + { + public enum Evaluation + { + Equal, + NotEqual, + Greater, + GreaterOrEqual, + Less, + LessOrEqual, + Exists + } + + public Evaluation Test = Evaluation.Equal; + public GameSaveManager.Location SaveLocation = GameSaveManager.Location.System; + public GameSaveManager.ValueType ValueType = GameSaveManager.ValueType.String; + public string Key = "SomeKey"; + + bool isBool() {return ValueType == GameSaveManager.ValueType.Bool;} + bool isInt() {return ValueType == GameSaveManager.ValueType.Int;} + bool isFloat() {return ValueType == GameSaveManager.ValueType.Float;} + bool isString() {return ValueType == GameSaveManager.ValueType.String;} + + [ShowIf("isBool")] + public bool BoolTargetValue; + [ShowIf("isInt")] + public int IntTargetValue; + [ShowIf("isFloat")] + public float FloatTargetValue; + [ShowIf("isString")] + public string StringTargetValue; + + [ReorderableList] + public Callable[] OnTestSuccess; + [ReorderableList] + public Callable[] OnTestFail; + + public override void Execute(GameObject instigator = null) + { + var gsm = Manager.Get(); + bool result = false; + + if(Test == Evaluation.Exists) + { + switch(ValueType) + { + case GameSaveManager.ValueType.Bool: result = gsm.HasBool(Key, SaveLocation); break; + case GameSaveManager.ValueType.Float: result = gsm.HasFloat(Key, SaveLocation); break; + case GameSaveManager.ValueType.Int: result = gsm.HasInt(Key, SaveLocation); break; + case GameSaveManager.ValueType.String: result = gsm.HasString(Key, SaveLocation); break; + } + + } + else + { + switch(ValueType) + { + case GameSaveManager.ValueType.Bool: + if (!gsm.HasBool(Key, SaveLocation)) + { + WarnNotExist(Key, ValueType, SaveLocation); + } + else + { + result = TestValue(gsm.GetBool(Key, SaveLocation), BoolTargetValue); + } + break; + case GameSaveManager.ValueType.Int: + if (!gsm.HasInt(Key, SaveLocation)) + { + WarnNotExist(Key, ValueType, SaveLocation); + } + else + { + result = TestValue(gsm.GetInt(Key, SaveLocation), IntTargetValue); + } + break; + case GameSaveManager.ValueType.Float: + if (!gsm.HasFloat(Key, SaveLocation)) + { + WarnNotExist(Key, ValueType, SaveLocation); + } + else + { + result = TestValue(gsm.GetFloat(Key, SaveLocation), FloatTargetValue); + } + break; + case GameSaveManager.ValueType.String: + if (!gsm.HasString(Key, SaveLocation)) + { + WarnNotExist(Key, ValueType, SaveLocation); + } + else + { + result = TestValue(gsm.GetString(Key, SaveLocation), StringTargetValue); + } + break; + } + } + + if (result) + Callable.Call(OnTestSuccess, instigator); + else + Callable.Call(OnTestFail, instigator); + + } + + bool TestValue(T value, T other) where T : System.IComparable + { + switch(Test) + { + case Evaluation.Equal: return value.CompareTo(other) == 0; + case Evaluation.NotEqual: return value.CompareTo(other) != 0; + case Evaluation.Greater: return value.CompareTo(other) > 0; + case Evaluation.GreaterOrEqual: return value.CompareTo(other) >= 0; + case Evaluation.Less: return value.CompareTo(other) < 0; + case Evaluation.LessOrEqual: return value.CompareTo(other) <= 0; + } + return false; + } + + + + void WarnNotExist(string name, GameSaveManager.ValueType type, GameSaveManager.Location location) + { + Debug.LogWarning(string.Format("Save Data Logic: Trying to get {0} value to non existent {1} data in {2} save.", type, name, location)); + } + } +} diff --git a/LocalPackages/net.peeweek.gameplay-ingredients/Runtime/LevelScripting/Logic/SaveDataLogic.cs.meta b/LocalPackages/net.peeweek.gameplay-ingredients/Runtime/LevelScripting/Logic/SaveDataLogic.cs.meta new file mode 100644 index 0000000..673be06 --- /dev/null +++ b/LocalPackages/net.peeweek.gameplay-ingredients/Runtime/LevelScripting/Logic/SaveDataLogic.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 45422369810891b4fa9c4c7ea5628111 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {fileID: 2800000, guid: 6d0a734cdedf48d478f3fcc7612af66f, type: 3} + userData: + assetBundleName: + assetBundleVariant: diff --git a/LocalPackages/net.peeweek.gameplay-ingredients/Runtime/LevelScripting/Logic/SaveDataSwitchOnIntLogic.cs b/LocalPackages/net.peeweek.gameplay-ingredients/Runtime/LevelScripting/Logic/SaveDataSwitchOnIntLogic.cs new file mode 100644 index 0000000..96b9299 --- /dev/null +++ b/LocalPackages/net.peeweek.gameplay-ingredients/Runtime/LevelScripting/Logic/SaveDataSwitchOnIntLogic.cs @@ -0,0 +1,65 @@ +using NaughtyAttributes; +using System.Collections; +using System.Collections.Generic; +using UnityEngine; + +namespace GameplayIngredients.Logic +{ + public class SaveDataSwitchOnIntLogic : LogicBase + { + public GameSaveManager.Location SaveLocation = GameSaveManager.Location.System; + public string Key = "SomeKey"; + + [NonNullCheck] + public Callable[] DefaultCaseToCall; + + [ReorderableList, NonNullCheck] + public Callable[] CasesToCall; + + public override void Execute(GameObject instigator = null) + { + var gsm = Manager.Get(); + if (gsm.HasInt(Key, SaveLocation)) + { + int value = gsm.GetInt(Key, SaveLocation); + if(value > 0 && value < CasesToCall.Length) + { + if (CasesToCall[value] != null) + Callable.Call(CasesToCall[value], instigator); + else + { + Debug.LogWarning($"[SaveDataSwitchOnIntLogic] {gameObject.name} : Callable at index #{Key} was null, using default case."); + CallDefault(instigator); + } + } + else + { + Debug.LogWarning($"[SaveDataSwitchOnIntLogic] {gameObject.name} : Callable at index #{Key} was out of range, using default case."); + CallDefault(instigator); + } + } + else + { + Debug.LogWarning($"[SaveDataSwitchOnIntLogic] {gameObject.name} : Could not Find {Key} in {SaveLocation} Save, using default case."); + CallDefault(instigator); + } + } + + void CallDefault(GameObject instigator) + { + if(DefaultCaseToCall != null) + { + Callable.Call(DefaultCaseToCall, instigator); + } + else + { + Debug.LogWarning($"[SaveDataSwitchOnIntLogic] {gameObject.name} : Did not set a default callable, aborting."); + } + } + + void WarnNotExist(string name, GameSaveManager.ValueType type, GameSaveManager.Location location) + { + Debug.LogWarning(string.Format("Save Data Logic: Trying to get {0} value to non existent {1} data in {2} save.", type, name, location)); + } + } +} diff --git a/LocalPackages/net.peeweek.gameplay-ingredients/Runtime/LevelScripting/Logic/SaveDataSwitchOnIntLogic.cs.meta b/LocalPackages/net.peeweek.gameplay-ingredients/Runtime/LevelScripting/Logic/SaveDataSwitchOnIntLogic.cs.meta new file mode 100644 index 0000000..4955610 --- /dev/null +++ b/LocalPackages/net.peeweek.gameplay-ingredients/Runtime/LevelScripting/Logic/SaveDataSwitchOnIntLogic.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 03c6f74af353ebd46a0c034f1ea5de57 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {fileID: 2800000, guid: 6d0a734cdedf48d478f3fcc7612af66f, type: 3} + userData: + assetBundleName: + assetBundleVariant: diff --git a/LocalPackages/net.peeweek.gameplay-ingredients/Runtime/LevelScripting/Logic/SetInstigatorFromFactoryLogic.cs b/LocalPackages/net.peeweek.gameplay-ingredients/Runtime/LevelScripting/Logic/SetInstigatorFromFactoryLogic.cs new file mode 100644 index 0000000..aefdc13 --- /dev/null +++ b/LocalPackages/net.peeweek.gameplay-ingredients/Runtime/LevelScripting/Logic/SetInstigatorFromFactoryLogic.cs @@ -0,0 +1,29 @@ +using NaughtyAttributes; +using System.Collections; +using System.Collections.Generic; +using UnityEngine; + +namespace GameplayIngredients.Logic +{ + public class SetInstigatorFromFactoryLogic : LogicBase + { + [ReorderableList] + public Callable[] Next; + + [NonNullCheck] + public Factory Factory; + public int FactoryIndex = 0; + public bool ContinueEvenIfNull = false; + + public override void Execute(GameObject instigator = null) + { + if(Factory != null) + { + GameObject instance = Factory.GetInstance(FactoryIndex); + if(instance != null || ContinueEvenIfNull) + Call(Next, instance); + } + } + } +} + diff --git a/LocalPackages/net.peeweek.gameplay-ingredients/Runtime/LevelScripting/Logic/SetInstigatorFromFactoryLogic.cs.meta b/LocalPackages/net.peeweek.gameplay-ingredients/Runtime/LevelScripting/Logic/SetInstigatorFromFactoryLogic.cs.meta new file mode 100644 index 0000000..b6d6b4a --- /dev/null +++ b/LocalPackages/net.peeweek.gameplay-ingredients/Runtime/LevelScripting/Logic/SetInstigatorFromFactoryLogic.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 179702d831a2b2e40820ab80d04ed4b3 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {fileID: 2800000, guid: 6d0a734cdedf48d478f3fcc7612af66f, type: 3} + userData: + assetBundleName: + assetBundleVariant: diff --git a/LocalPackages/net.peeweek.gameplay-ingredients/Runtime/LevelScripting/Logic/SetInstigatorLogic.cs b/LocalPackages/net.peeweek.gameplay-ingredients/Runtime/LevelScripting/Logic/SetInstigatorLogic.cs new file mode 100644 index 0000000..613f2db --- /dev/null +++ b/LocalPackages/net.peeweek.gameplay-ingredients/Runtime/LevelScripting/Logic/SetInstigatorLogic.cs @@ -0,0 +1,21 @@ +using NaughtyAttributes; +using System.Collections; +using System.Collections.Generic; +using UnityEngine; + +namespace GameplayIngredients.Logic +{ + public class SetInstigatorLogic : LogicBase + { + [ReorderableList] + public Callable[] Next; + + public GameObject NewInstigator; + + public override void Execute(GameObject instigator = null) + { + Call(Next, NewInstigator); + } + } +} + diff --git a/LocalPackages/net.peeweek.gameplay-ingredients/Runtime/LevelScripting/Logic/SetInstigatorLogic.cs.meta b/LocalPackages/net.peeweek.gameplay-ingredients/Runtime/LevelScripting/Logic/SetInstigatorLogic.cs.meta new file mode 100644 index 0000000..6e46e6a --- /dev/null +++ b/LocalPackages/net.peeweek.gameplay-ingredients/Runtime/LevelScripting/Logic/SetInstigatorLogic.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 1bbc9ba9041c09746bf4941d88a7bca8 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {fileID: 2800000, guid: 6d0a734cdedf48d478f3fcc7612af66f, type: 3} + userData: + assetBundleName: + assetBundleVariant: diff --git a/LocalPackages/net.peeweek.gameplay-ingredients/Runtime/LevelScripting/Logic/StateLogic.cs b/LocalPackages/net.peeweek.gameplay-ingredients/Runtime/LevelScripting/Logic/StateLogic.cs new file mode 100644 index 0000000..e4c59de --- /dev/null +++ b/LocalPackages/net.peeweek.gameplay-ingredients/Runtime/LevelScripting/Logic/StateLogic.cs @@ -0,0 +1,27 @@ +using GameplayIngredients.StateMachines; +using NaughtyAttributes; +using UnityEngine; + +namespace GameplayIngredients.Logic +{ + public class StateLogic : LogicBase + { + public StateMachine StateMachine; + public State TargetState; + + [ReorderableList] + public Callable[] IfCurrentState; + [ReorderableList] + public Callable[] IfNotCurrentState; + + public override void Execute(GameObject instigator = null) + { + if (StateMachine.CurrentState == TargetState && IfCurrentState != null && IfCurrentState.Length > 0) + Call(IfCurrentState, instigator); + else if (StateMachine.CurrentState != TargetState && IfNotCurrentState != null && IfNotCurrentState.Length > 0) + Call(IfNotCurrentState, instigator); + } + } + +} + diff --git a/LocalPackages/net.peeweek.gameplay-ingredients/Runtime/LevelScripting/Logic/StateLogic.cs.meta b/LocalPackages/net.peeweek.gameplay-ingredients/Runtime/LevelScripting/Logic/StateLogic.cs.meta new file mode 100644 index 0000000..c92aaf5 --- /dev/null +++ b/LocalPackages/net.peeweek.gameplay-ingredients/Runtime/LevelScripting/Logic/StateLogic.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 8984afda389a94b48b9a3c0cbf794642 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {fileID: 2800000, guid: 6d0a734cdedf48d478f3fcc7612af66f, type: 3} + userData: + assetBundleName: + assetBundleVariant: diff --git a/LocalPackages/net.peeweek.gameplay-ingredients/Runtime/Logic/LogicBase.cs b/LocalPackages/net.peeweek.gameplay-ingredients/Runtime/Logic/LogicBase.cs deleted file mode 100644 index 22ede77..0000000 --- a/LocalPackages/net.peeweek.gameplay-ingredients/Runtime/Logic/LogicBase.cs +++ /dev/null @@ -1,11 +0,0 @@ -using UnityEngine; - -namespace GameplayIngredients.Logic -{ - public abstract class LogicBase : MonoBehaviour - { - public abstract void Execute(); - } -} - - diff --git a/LocalPackages/net.peeweek.gameplay-ingredients/Runtime/Managers.meta b/LocalPackages/net.peeweek.gameplay-ingredients/Runtime/Managers.meta new file mode 100644 index 0000000..3fabc06 --- /dev/null +++ b/LocalPackages/net.peeweek.gameplay-ingredients/Runtime/Managers.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: fbf7bcb7494f7aa489d0ff01f1b613d2 +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/LocalPackages/net.peeweek.gameplay-ingredients/Runtime/Managers/Globals.meta b/LocalPackages/net.peeweek.gameplay-ingredients/Runtime/Managers/Globals.meta new file mode 100644 index 0000000..aa2a8fe --- /dev/null +++ b/LocalPackages/net.peeweek.gameplay-ingredients/Runtime/Managers/Globals.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: dd67ebd332bbf1d46af6bd1930423da1 +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/LocalPackages/net.peeweek.gameplay-ingredients/Runtime/Managers/Globals/GlobalLogic.cs b/LocalPackages/net.peeweek.gameplay-ingredients/Runtime/Managers/Globals/GlobalLogic.cs new file mode 100644 index 0000000..b93948d --- /dev/null +++ b/LocalPackages/net.peeweek.gameplay-ingredients/Runtime/Managers/Globals/GlobalLogic.cs @@ -0,0 +1,205 @@ +using NaughtyAttributes; +using System.Collections; +using System.Collections.Generic; +using UnityEngine; + +namespace GameplayIngredients.Logic +{ + public class GlobalLogic : LogicBase + { + [Header("Base Value")] + public Globals.Scope scope = Globals.Scope.Global; + public Globals.Type type = Globals.Type.Boolean; + public string Variable = "SomeVariable"; + public Evaluation evaluation = Evaluation.Equal; + + [Header("Compare To...")] + [ShowIf("isCompareToOther")] + public CompareTo compareTo = CompareTo.Value; + + [ShowIf("isBool")] + public bool boolValue = true; + [ShowIf("isInt")] + public int intValue = 1; + [ShowIf("isString")] + public string stringValue = "Value"; + [ShowIf("isFloat")] + public float floatValue = 1.0f; + [ShowIf("isGameObject")] + public GameObject gameObjectValue; + [ShowIf("isGlobal")] + public string compareToVariable = "OtherVariable"; + [ShowIf("isGlobal")] + public Globals.Scope compareToScope = Globals.Scope.Global; + + + public enum Evaluation + { + Equal, + NotEqual, + Greater, + GreaterOrEqual, + Less, + LessOrEqual, + Exists + } + + public enum CompareTo + { + Value, + OtherGlobalVariable, + } + + bool isBool() { return isValue() && type == Globals.Type.Boolean; } + bool isInt() { return isValue() && type == Globals.Type.Integer; } + bool isFloat() { return isValue() && type == Globals.Type.Float; } + bool isString() { return isValue() && type == Globals.Type.String; } + bool isGameObject() { return isValue() && type == Globals.Type.GameObject; } + bool isValue() { return compareTo == CompareTo.Value && isCompareToOther(); } + bool isGlobal() { return compareTo == CompareTo.OtherGlobalVariable && isCompareToOther(); } + bool isCompareToOther() { return evaluation != Evaluation.Exists; } + + [ReorderableList] + public Callable[] OnTestSuccess; + [ReorderableList] + public Callable[] OnTestFail; + + public override void Execute(GameObject instigator = null) + { + bool result = false; + + if (evaluation == Evaluation.Exists) + { + switch (type) + { + case Globals.Type.Boolean: result = Globals.HasBool(Variable, scope); break; + case Globals.Type.Float: result = Globals.HasFloat(Variable, scope); break; + case Globals.Type.Integer: result = Globals.HasInt(Variable, scope); break; + case Globals.Type.String: result = Globals.HasString(Variable, scope); break; + case Globals.Type.GameObject: result = Globals.HasObject(Variable, scope); break; + } + } + else + { + try + { + switch (type) + { + case Globals.Type.Boolean: + result = TestValue(Globals.GetBool(Variable, scope), GetBoolValue()); + break; + case Globals.Type.Integer: + result = TestValue(Globals.GetInt(Variable, scope), GetIntValue()); + break; + case Globals.Type.Float: + result = TestValue(Globals.GetFloat(Variable, scope), GetFloatValue()); + break; + case Globals.Type.String: + result = TestValue(Globals.GetString(Variable, scope), GetStringValue()); + break; + case Globals.Type.GameObject: + result = TestObjectValue(Globals.GetObject(Variable, scope), GetObjectValue()); + break; + } + } + catch { } + } + + if (result) + Callable.Call(OnTestSuccess, instigator); + else + Callable.Call(OnTestFail, instigator); + + } + + bool GetBoolValue() + { + switch (compareTo) + { + default: + case CompareTo.Value: + return boolValue; + case CompareTo.OtherGlobalVariable: + return Globals.GetBool(compareToVariable, compareToScope); + } + } + + int GetIntValue() + { + switch (compareTo) + { + default: + case CompareTo.Value: + return intValue; + case CompareTo.OtherGlobalVariable: + return Globals.GetInt(compareToVariable, compareToScope); + } + } + + float GetFloatValue() + { + switch (compareTo) + { + default: + case CompareTo.Value: + return floatValue; + case CompareTo.OtherGlobalVariable: + return Globals.GetFloat(compareToVariable, compareToScope); + } + } + + string GetStringValue() + { + switch (compareTo) + { + default: + case CompareTo.Value: + return stringValue; + case CompareTo.OtherGlobalVariable: + return Globals.GetString(compareToVariable, compareToScope); + } + } + + GameObject GetObjectValue() + { + switch (compareTo) + { + default: + case CompareTo.Value: + return gameObjectValue; + case CompareTo.OtherGlobalVariable: + return Globals.GetObject(compareToVariable, compareToScope); + } + } + + bool TestValue(T value, T other) where T : System.IComparable + { + switch (evaluation) + { + case Evaluation.Equal: return value.CompareTo(other) == 0; + case Evaluation.NotEqual: return value.CompareTo(other) != 0; + case Evaluation.Greater: return value.CompareTo(other) > 0; + case Evaluation.GreaterOrEqual: return value.CompareTo(other) >= 0; + case Evaluation.Less: return value.CompareTo(other) < 0; + case Evaluation.LessOrEqual: return value.CompareTo(other) <= 0; + } + return false; + } + + bool TestObjectValue(GameObject value, GameObject other) + { + switch (evaluation) + { + case Evaluation.Equal: + return value == other; + case Evaluation.NotEqual: + case Evaluation.Greater: + case Evaluation.GreaterOrEqual: + case Evaluation.Less: + case Evaluation.LessOrEqual: + return value != other; + } + return false; + } + } +} diff --git a/LocalPackages/net.peeweek.gameplay-ingredients/Runtime/Managers/Globals/GlobalLogic.cs.meta b/LocalPackages/net.peeweek.gameplay-ingredients/Runtime/Managers/Globals/GlobalLogic.cs.meta new file mode 100644 index 0000000..c6db356 --- /dev/null +++ b/LocalPackages/net.peeweek.gameplay-ingredients/Runtime/Managers/Globals/GlobalLogic.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: dfb539acc174ff046a34b6bee7ad48de +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/LocalPackages/net.peeweek.gameplay-ingredients/Runtime/Managers/Globals/Globals.cs b/LocalPackages/net.peeweek.gameplay-ingredients/Runtime/Managers/Globals/Globals.cs new file mode 100644 index 0000000..2277e97 --- /dev/null +++ b/LocalPackages/net.peeweek.gameplay-ingredients/Runtime/Managers/Globals/Globals.cs @@ -0,0 +1,278 @@ +using System.Collections; +using System.Collections.Generic; +using UnityEngine; + +public static class Globals +{ + static Dictionary globalBooleans; + static Dictionary globalInts; + static Dictionary globalStrings; + static Dictionary globalFloats; + static Dictionary globalObjects; + + static Dictionary localBooleans; + static Dictionary localInts; + static Dictionary localStrings; + static Dictionary localFloats; + static Dictionary localObjects; + + public enum Scope + { + Local, + Global + } + public enum Type + { + Boolean, + Integer, + String, + Float, + GameObject + } + + static Globals() + { + globalBooleans = new Dictionary(); + globalInts = new Dictionary(); + globalStrings = new Dictionary(); + globalFloats = new Dictionary(); + globalObjects = new Dictionary(); + + + localBooleans = new Dictionary(); + localInts = new Dictionary(); + localStrings = new Dictionary(); + localFloats = new Dictionary(); + localObjects = new Dictionary(); + } + + public static void ResetLocals() + { + localBooleans.Clear(); + localInts.Clear(); + localStrings.Clear(); + localFloats.Clear(); + localObjects.Clear(); + } + public static void ResetGlobals() + { + globalBooleans.Clear(); + globalInts.Clear(); + globalStrings.Clear(); + globalFloats.Clear(); + globalObjects.Clear(); + } + + + #region Has() + public static bool HasBool(string name, Scope scope) + { + switch (scope) + { + default: + case Scope.Local: + return localBooleans.ContainsKey(name); + case Scope.Global: + return globalBooleans.ContainsKey(name); + } + } + public static bool HasInt(string name, Scope scope) + { + switch (scope) + { + default: + case Scope.Local: + return localInts.ContainsKey(name); + case Scope.Global: + return globalInts.ContainsKey(name); + } + } + public static bool HasString(string name, Scope scope) + { + switch (scope) + { + default: + case Scope.Local: + return localStrings.ContainsKey(name); + case Scope.Global: + return globalStrings.ContainsKey(name); + } + } + public static bool HasFloat(string name, Scope scope) + { + switch (scope) + { + default: + case Scope.Local: + return localFloats.ContainsKey(name); + case Scope.Global: + return globalFloats.ContainsKey(name); + } + } + public static bool HasObject(string name, Scope scope) + { + switch (scope) + { + default: + case Scope.Local: + return localObjects.ContainsKey(name); + case Scope.Global: + return globalObjects.ContainsKey(name); + } + } + #endregion + + #region Get() + public static bool GetBool(string name, Scope scope) + { + switch (scope) + { + default: + case Scope.Local: + return localBooleans[name]; + case Scope.Global: + return globalBooleans[name]; + } + } + public static int GetInt(string name, Scope scope) + { + switch (scope) + { + default: + case Scope.Local: + return localInts[name]; + case Scope.Global: + return globalInts[name]; + } + } + public static string GetString(string name, Scope scope) + { + switch (scope) + { + default: + case Scope.Local: + return localStrings[name]; + case Scope.Global: + return globalStrings[name]; + } + } + public static float GetFloat(string name, Scope scope) + { + switch (scope) + { + default: + case Scope.Local: + return localFloats[name]; + case Scope.Global: + return globalFloats[name]; + } + } + public static GameObject GetObject(string name, Scope scope) + { + switch (scope) + { + default: + case Scope.Local: + return localObjects[name]; + case Scope.Global: + return globalObjects[name]; + } + } + #endregion + + #region Set() + + static void SetValue(Dictionary dict, string name, T value) + { + if (dict.ContainsKey(name)) + dict[name] = value; + else + dict.Add(name, value); + } + + public static void SetBool(string name, bool value, Scope scope) + { + switch (scope) + { + default: + case Scope.Local: + SetValue(localBooleans, name, value); break; + case Scope.Global: + SetValue(globalBooleans, name, value); break; + } + if (OnGlobalsUpdated != null) + OnGlobalsUpdated(Type.Boolean, name, value); + return; + } + public static void SetInt(string name, int value, Scope scope) + { + switch (scope) + { + default: + case Scope.Local: + SetValue(localInts, name, value); break; + case Scope.Global: + SetValue(globalInts, name, value); break; + } + if (OnGlobalsUpdated != null) + OnGlobalsUpdated(Type.Integer, name, value); + return; + + } + public static void SetString(string name, string value, Scope scope) + { + switch (scope) + { + default: + case Scope.Local: + SetValue(localStrings, name, value); break; + case Scope.Global: + SetValue(globalStrings, name, value); break; + } + if (OnGlobalsUpdated != null) + OnGlobalsUpdated(Type.String, name, value); + return; + } + public static void SetFloat(string name, float value, Scope scope) + { + switch (scope) + { + default: + case Scope.Local: + SetValue(localFloats, name, value); break; + case Scope.Global: + SetValue(globalFloats, name, value); break; + } + if (OnGlobalsUpdated != null) + OnGlobalsUpdated(Type.Float, name, value); + return; + } + public static void SetObject(string name, GameObject value, Scope scope) + { + switch (scope) + { + default: + case Scope.Local: + SetValue(localObjects, name, value); break; + case Scope.Global: + SetValue(globalObjects, name, value); break; + } + if (OnGlobalsUpdated != null) + OnGlobalsUpdated(Type.GameObject, name, value); + return; + } + #endregion + + #region Debug + + public delegate void GlobalsUpdatedDelegate(Type t, string name, object value); + public static event GlobalsUpdatedDelegate OnGlobalsUpdated; + + public static IEnumerable GetBoolNames(Scope scope) { return scope == Scope.Global ? globalBooleans.Keys : localBooleans.Keys; } + public static IEnumerable GetIntNames(Scope scope) { return scope == Scope.Global ? globalInts.Keys : localInts.Keys; } + public static IEnumerable GetFloatNames(Scope scope) { return scope == Scope.Global ? globalFloats.Keys : localFloats.Keys; } + public static IEnumerable GetStringNames(Scope scope) { return scope == Scope.Global ? globalStrings.Keys : localStrings.Keys; } + public static IEnumerable GetObjectNames(Scope scope) { return scope == Scope.Global ? globalObjects.Keys : localObjects.Keys; } + + #endregion +} diff --git a/LocalPackages/net.peeweek.gameplay-ingredients/Runtime/Managers/Globals/Globals.cs.meta b/LocalPackages/net.peeweek.gameplay-ingredients/Runtime/Managers/Globals/Globals.cs.meta new file mode 100644 index 0000000..00b7b15 --- /dev/null +++ b/LocalPackages/net.peeweek.gameplay-ingredients/Runtime/Managers/Globals/Globals.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: e66f575592d1e4a4d8d48b182204a4ac +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/LocalPackages/net.peeweek.gameplay-ingredients/Runtime/Managers/Globals/ResetGlobalAction.cs b/LocalPackages/net.peeweek.gameplay-ingredients/Runtime/Managers/Globals/ResetGlobalAction.cs new file mode 100644 index 0000000..c1a6914 --- /dev/null +++ b/LocalPackages/net.peeweek.gameplay-ingredients/Runtime/Managers/Globals/ResetGlobalAction.cs @@ -0,0 +1,25 @@ +using System.Collections; +using System.Collections.Generic; +using UnityEngine; + +namespace GameplayIngredients.Actions +{ + public class ResetGlobalAction : ActionBase + { + public ResetType resetType = ResetType.Locals; + public enum ResetType + { + Locals = 1, + Globals = 2, + All = Locals | Globals, + } + public override void Execute(GameObject instigator = null) + { + if (resetType == ResetType.Locals || resetType == ResetType.All) + Globals.ResetLocals(); + + if (resetType == ResetType.Globals || resetType == ResetType.All) + Globals.ResetGlobals(); + } + } +} diff --git a/LocalPackages/net.peeweek.gameplay-ingredients/Runtime/Managers/Globals/ResetGlobalAction.cs.meta b/LocalPackages/net.peeweek.gameplay-ingredients/Runtime/Managers/Globals/ResetGlobalAction.cs.meta new file mode 100644 index 0000000..1b10392 --- /dev/null +++ b/LocalPackages/net.peeweek.gameplay-ingredients/Runtime/Managers/Globals/ResetGlobalAction.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 99d0858ab4f2a4b408c989c71c3d9083 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/LocalPackages/net.peeweek.gameplay-ingredients/Runtime/Managers/Globals/SetGlobalAction.cs b/LocalPackages/net.peeweek.gameplay-ingredients/Runtime/Managers/Globals/SetGlobalAction.cs new file mode 100644 index 0000000..6e74e95 --- /dev/null +++ b/LocalPackages/net.peeweek.gameplay-ingredients/Runtime/Managers/Globals/SetGlobalAction.cs @@ -0,0 +1,54 @@ +using NaughtyAttributes; +using System.Collections; +using System.Collections.Generic; +using UnityEngine; + +namespace GameplayIngredients.Actions +{ + public class SetGlobalAction : ActionBase + { + public Globals.Scope scope = Globals.Scope.Global; + public Globals.Type type = Globals.Type.Boolean; + public string Variable = "SomeVariable"; + + [ShowIf("isBool")] + public bool boolValue = true; + [ShowIf("isInt")] + public int intValue = 1; + [ShowIf("isString")] + public string stringValue = "Value"; + [ShowIf("isFloat")] + public float floatValue = 1.0f; + [ShowIf("isGameObject")] + public GameObject gameObjectValue; + + bool isBool() { return type == Globals.Type.Boolean; } + bool isInt() { return type == Globals.Type.Integer; } + bool isFloat() { return type == Globals.Type.Float; } + bool isString() { return type == Globals.Type.String; } + bool isGameObject() { return type == Globals.Type.GameObject; } + + public override void Execute(GameObject instigator = null) + { + switch (type) + { + default: + case Globals.Type.Boolean: + Globals.SetBool(Variable, boolValue, scope); + break; + case Globals.Type.Integer: + Globals.SetInt(Variable, intValue, scope); + break; + case Globals.Type.String: + Globals.SetString(Variable, stringValue, scope); + break; + case Globals.Type.Float: + Globals.SetFloat(Variable, floatValue, scope); + break; + case Globals.Type.GameObject: + Globals.SetObject(Variable, gameObjectValue, scope); + break; + } + } + } +} diff --git a/LocalPackages/net.peeweek.gameplay-ingredients/Runtime/Managers/Globals/SetGlobalAction.cs.meta b/LocalPackages/net.peeweek.gameplay-ingredients/Runtime/Managers/Globals/SetGlobalAction.cs.meta new file mode 100644 index 0000000..ff9be53 --- /dev/null +++ b/LocalPackages/net.peeweek.gameplay-ingredients/Runtime/Managers/Globals/SetGlobalAction.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: b74e258e1b854de4db77e924a4a2e459 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/LocalPackages/net.peeweek.gameplay-ingredients/Runtime/Managers/Implementations.meta b/LocalPackages/net.peeweek.gameplay-ingredients/Runtime/Managers/Implementations.meta new file mode 100644 index 0000000..9eb6c80 --- /dev/null +++ b/LocalPackages/net.peeweek.gameplay-ingredients/Runtime/Managers/Implementations.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: dcd0e7c2728af96488efea2d28e1c2cf +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/LocalPackages/net.peeweek.gameplay-ingredients/Runtime/Managers/Implementations/FullScreenFadeManager.cs b/LocalPackages/net.peeweek.gameplay-ingredients/Runtime/Managers/Implementations/FullScreenFadeManager.cs new file mode 100644 index 0000000..e543774 --- /dev/null +++ b/LocalPackages/net.peeweek.gameplay-ingredients/Runtime/Managers/Implementations/FullScreenFadeManager.cs @@ -0,0 +1,89 @@ +using System.Collections; +using System; +using UnityEngine; +using UnityEngine.UI; +using UnityEngine.Events; + +namespace GameplayIngredients +{ + [ManagerDefaultPrefab("FullScreenFadeManager")] + public class FullScreenFadeManager : Manager + { + public enum FadeMode + { + FromBlack = 0, + ToBlack = 1 + } + + public Image FullScreenFadePlane; + + private Coroutine m_Coroutine; + + public void Fade(float duration, FadeMode mode, Callable[] OnComplete, GameObject instigator = null) + { + if (m_Coroutine != null) + { + StopCoroutine(m_Coroutine); + m_Coroutine = null; + } + + if (duration <= 0.0f) + { + var color = FullScreenFadePlane.color; ; + switch (mode) + { + case FadeMode.ToBlack: + color.a = 1.0f; + break; + case FadeMode.FromBlack: + color.a = 0.0f; + break; + default: throw new NotImplementedException(); + } + FullScreenFadePlane.gameObject.SetActive(color.a == 1.0f); + FullScreenFadePlane.color = color; + Callable.Call(OnComplete, instigator); + } + else + { + switch (mode) + { + case FadeMode.ToBlack: + m_Coroutine = StartCoroutine(FadeCoroutine(duration, 1.0f, 1.0f, OnComplete, instigator)); + break; + case FadeMode.FromBlack: + m_Coroutine = StartCoroutine(FadeCoroutine(duration, 0.0f, -1.0f, OnComplete, instigator)); + break; + default: throw new NotImplementedException(); + } + } + + } + + IEnumerator FadeCoroutine(float duration, float target, float sign, Callable[] OnComplete, GameObject instigator) + { + FullScreenFadePlane.gameObject.SetActive(true); + Color c = FullScreenFadePlane.color; + + while (sign > 0 ? FullScreenFadePlane.color.a <= target : FullScreenFadePlane.color.a >= target) + { + c = FullScreenFadePlane.color; + c.a += sign * Time.unscaledDeltaTime / duration; + FullScreenFadePlane.color = c; + yield return new WaitForEndOfFrame(); + } + + Color finalColor = FullScreenFadePlane.color; + finalColor.a = target; + FullScreenFadePlane.color = finalColor; + Callable.Call(OnComplete, instigator); + FullScreenFadePlane.gameObject.SetActive(target != 0.0f); + + yield return new WaitForEndOfFrame(); + m_Coroutine = null; + } + + } + +} + diff --git a/LocalPackages/net.peeweek.gameplay-ingredients/Runtime/Managers/Implementations/FullScreenFadeManager.cs.meta b/LocalPackages/net.peeweek.gameplay-ingredients/Runtime/Managers/Implementations/FullScreenFadeManager.cs.meta new file mode 100644 index 0000000..ba235b6 --- /dev/null +++ b/LocalPackages/net.peeweek.gameplay-ingredients/Runtime/Managers/Implementations/FullScreenFadeManager.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: c3c1731f7f8331345a352b2b9c05f2cb +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/LocalPackages/net.peeweek.gameplay-ingredients/Runtime/Managers/Implementations/GameManager.cs b/LocalPackages/net.peeweek.gameplay-ingredients/Runtime/Managers/Implementations/GameManager.cs new file mode 100644 index 0000000..af69d7f --- /dev/null +++ b/LocalPackages/net.peeweek.gameplay-ingredients/Runtime/Managers/Implementations/GameManager.cs @@ -0,0 +1,141 @@ +using GameplayIngredients.Actions; +using GameplayIngredients.LevelStreaming; +using NaughtyAttributes; +using System.Linq; +using UnityEngine; + +namespace GameplayIngredients +{ + [ManagerDefaultPrefab("GameManager")] + public class GameManager : Manager + { + [Header("Events")] + [ReorderableList] + public Callable[] OnGameStart; + [ReorderableList] + public Callable[] OnLevelLoaded; + [ReorderableList] + public Callable[] OnMainMenuLoaded; + + [Header("Levels"), NonNullCheck] + public GameLevel MainMenuGameLevel; + [ReorderableList, NonNullCheck] + public GameLevel[] MainGameLevels; + + [Header("Save")] + public bool EnableSaveProgress = true; + public string ProgressSaveName = "Progress"; + + public static string MainMenuStartMessage = "GAME_MANAGER_MAINMENU_START"; + public static string GameLevelStartMessage = "GAME_MANAGER_GAME_START"; + + public int currentLevel { get; private set; } = -2; + + public int currentSaveProgress + { + get + { + if(EnableSaveProgress) + { + Manager.Get().LoadUserSave(0); + return Manager.Get().GetInt(ProgressSaveName, GameSaveManager.Location.User); + } + else + { + Debug.LogWarning("Game Manager : Saving Game Progress is Disabled, Returing first level instead."); + return 0; + } + } + set + { + if(EnableSaveProgress) + { + Manager.Get().SetInt(ProgressSaveName, GameSaveManager.Location.User, value); + Manager.Get().SaveUserSave(0); + } + else + { + Debug.LogWarning("Game Manager : Saving Game Progress is Disabled"); + } + } + } + + GameObject m_CurrentLevelSwitch; + + public void Start() + { + currentLevel = int.MinValue; + Callable.Call(OnGameStart); + + if(EnableSaveProgress) + Manager.Get().LoadUserSave(0); + } + + Callable GetCurrentLevelSwitch(int targetLevel, bool showUI = false, Callable[] onComplete = null) + { + if(targetLevel < 0 && MainMenuGameLevel == null) + { + Debug.LogError("GameManager : Could not load Main Menu."); + return null; + } + else if (targetLevel >= 0 && (MainGameLevels == null || MainGameLevels.Length < targetLevel + 1 || MainGameLevels[targetLevel] == null)) + { + Debug.LogError($"GameManager : Could not load Level #{targetLevel}"); + return null; + } + + GameObject go = new GameObject(); + go.name = $"LevelSwtich {currentLevel} -> {targetLevel}"; + go.transform.parent = this.transform; + m_CurrentLevelSwitch = go; + + var cameraFade = go.AddComponent(); + var loadLevel = go.AddComponent(); + var sendMessage = go.AddComponent(); + var destroy = go.AddComponent(); + var next = go.AddComponent(); + + cameraFade.Fading = FullScreenFadeManager.FadeMode.ToBlack; + cameraFade.Name = "Fade to Black"; + cameraFade.Duration = 1.0f; + cameraFade.OnComplete = new Callable[] { loadLevel }; + + loadLevel.Name = $"Load {(targetLevel < 0 ? "Main menu" : MainGameLevels[targetLevel].name)}"; + loadLevel.ShowUI = showUI; + loadLevel.Action = LevelStreamingManager.StreamingAction.Replace; + var level = targetLevel < 0 ? MainMenuGameLevel : MainGameLevels[targetLevel]; + loadLevel.SceneToActivate = level.StartupScenes[0]; + loadLevel.Scenes = level.StartupScenes; + loadLevel.OnLoadComplete = new Callable[] { sendMessage, destroy, next }; + + string message = targetLevel == -1 ? MainMenuStartMessage : GameLevelStartMessage; + sendMessage.Name = $"Send {message}"; + sendMessage.MessageToSend = message; + + destroy.ObjectsToDestroy = new GameObject[] { go }; + + var nextActions = targetLevel < 0 ? OnMainMenuLoaded : OnLevelLoaded; + next.Calls = nextActions.Concat(onComplete).ToArray(); + + // Return first callable + return cameraFade; + } + + public void SwitchLevel(int nextLevel, bool showUI = false, Callable[] onComplete = null, bool saveProgress = false) + { + if (m_CurrentLevelSwitch == null) + { + var call = GetCurrentLevelSwitch(nextLevel, showUI, onComplete); + Globals.ResetLocals(); + call.Execute(); + currentLevel = nextLevel; + + // Save Progression if Enabled and not mainmenu + if(EnableSaveProgress && nextLevel != -1 && saveProgress) + currentSaveProgress = currentLevel; + } + else + Debug.LogWarning("SwitchLevel : an Operation was still in progress and switching level could not be done. "); + } + } +} diff --git a/LocalPackages/net.peeweek.gameplay-ingredients/Runtime/Managers/Implementations/GameManager.cs.meta b/LocalPackages/net.peeweek.gameplay-ingredients/Runtime/Managers/Implementations/GameManager.cs.meta new file mode 100644 index 0000000..34eea00 --- /dev/null +++ b/LocalPackages/net.peeweek.gameplay-ingredients/Runtime/Managers/Implementations/GameManager.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 9fd2ae503e78cd14da039ced88d8e0b3 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {fileID: 2800000, guid: af9148c7de0fc6444b7e4e050f116dd0, type: 3} + userData: + assetBundleName: + assetBundleVariant: diff --git a/LocalPackages/net.peeweek.gameplay-ingredients/Runtime/Managers/Implementations/GameSaveManager.cs b/LocalPackages/net.peeweek.gameplay-ingredients/Runtime/Managers/Implementations/GameSaveManager.cs new file mode 100644 index 0000000..280340c --- /dev/null +++ b/LocalPackages/net.peeweek.gameplay-ingredients/Runtime/Managers/Implementations/GameSaveManager.cs @@ -0,0 +1,233 @@ +using NaughtyAttributes; +using System.IO; +using System.Collections.Generic; +using UnityEngine; +using System.Text; + +namespace GameplayIngredients +{ + [ManagerDefaultPrefab("GameSaveManager")] + public class GameSaveManager : Manager + { + [SerializeField, Tooltip("The path where system and user saves will be stored. Relative to the Executable_Data folder (or Assets folder for editor). Default is '/../' next to the executable or at the root of the project.")] + private string savePath = "/../"; + [SerializeField, Tooltip("The file name of the System Save.")] + private string systemSaveName = "System.sav"; + [SerializeField, Tooltip("The file format for a user save, use the {0} to specify where the numbering happens.")] + private string userSaveName = "User{0}.sav"; + + Dictionary systemSaveEntries; + Dictionary currentUserSaveEntries; + + [ReorderableList] + public Callable[] OnLoad; + + [ReorderableList] + public Callable[] OnSave; + + void Awake() + { + systemSaveEntries = new Dictionary(); + currentUserSaveEntries = new Dictionary(); + } + + private void OnEnable() + { + LoadSystemSave(); + } + + #region SAVE/LOAD + + public void LoadSystemSave() + { + systemSaveEntries = LoadFile(systemSaveName); + Callable.Call(OnLoad); + } + + public void SaveSystemSave() + { + SaveFile(systemSaveName, systemSaveEntries); + Callable.Call(OnSave); + } + + private byte currentUserIndex = 0; + + public void LoadUserSave(byte index) + { + currentUserIndex = index; + Callable.Call(OnLoad); + currentUserSaveEntries = LoadFile(string.Format(userSaveName, index)); + } + + public void SaveUserSave() + { + SaveUserSave(currentUserIndex); + } + + public void SaveUserSave(byte index) + { + // Save + currentUserIndex = index; + Callable.Call(OnSave); + SaveFile(string.Format(userSaveName, index), currentUserSaveEntries); + } + + #endregion + + #region VALUES + + public bool HasBool(string name, Location location) { return HasValue(name, location); } + public bool HasInt(string name, Location location) { return HasValue(name, location); } + public bool HasFloat(string name, Location location) { return HasValue(name, location); } + public bool HasString(string name, Location location) { return HasValue(name, location); } + + public bool GetBool(string name, Location location) { return GetValue(name, location); } + public int GetInt(string name, Location location) { return GetValue(name, location); } + public float GetFloat(string name, Location location) { return GetValue(name, location); } + public string GetString(string name, Location location) { return GetValue(name, location); } + + public void SetBool(string name, Location location, bool value) { SetValue(name, location, value); } + public void SetInt(string name, Location location, int value) { SetValue(name, location, value); } + public void SetFloat(string name, Location location, float value) { SetValue(name, location, value); } + public void SetString(string name, Location location, string value) { SetValue(name, location, value); } + + public enum Location + { + System = 0, + User = 1, + } + + Dictionary GetEntriesFor(Location location) + { + if (location == Location.System) + return systemSaveEntries; + else + return currentUserSaveEntries; + + } + + bool HasValue(string name, Location location) + { + var dict = GetEntriesFor(location); + return dict.ContainsKey(name) && dict[name] is T; + } + + T GetValue(string name, Location location) + { + if (HasValue(name, location)) + { + var dict = GetEntriesFor(location); + return (T)dict[name]; + } + else + return default(T); + } + + void SetValue(string name, Location location, T value) + { + var dict = GetEntriesFor(location); + + if (HasValue(name, location)) + { + dict[name] = value; + } + else if (dict.ContainsKey(name)) // bad type + { + Debug.LogWarning(string.Format("GameSaveManager : {0} entry '{1}' changed type to {2}", location, name, typeof(T))); + dict[name] = value; + } + else + { + dict.Add(name, value); + } + } + + #endregion + + #region SERIALIZATION + + Dictionary LoadFile(string fileName) + { + if(!File.Exists(Application.dataPath + savePath + fileName)) + { + SaveFile(fileName, new Dictionary()); + } + + var dict = new Dictionary(); + + string contents= File.ReadAllText(Application.dataPath + savePath + fileName); + + SerializableOutput data = JsonUtility.FromJson(contents); + + for(int i = 0; i < data.keys.Length; i++) + { + string val = data.values[i]; + object value; + if (data.types[i] == ValueType.Bool) + value = bool.Parse(val); + else if (data.types[i] == ValueType.Int) + value = int.Parse(val); + else if (data.types[i] == ValueType.Float) + value = float.Parse(val); + else + value = val; + + dict.Add(data.keys[i], value); + } + + return dict; + } + + void SaveFile(string filename, Dictionary entries) + { + int count = entries.Count; + + SerializableOutput data = new SerializableOutput(); + + data.keys = new string[count]; + data.values = new string[count]; + data.types = new ValueType[count]; + + int i = 0; + foreach (var kvp in entries) + { + data.keys[i] = kvp.Key; + object value = kvp.Value; + + if (value is bool) + data.types[i] = ValueType.Bool; + else if (value is int) + data.types[i] = ValueType.Int; + else if (value is float) + data.types[i] = ValueType.Float; + else + data.types[i] = ValueType.String; + + data.values[i] = kvp.Value.ToString(); + i++; + } + + File.WriteAllText(Application.dataPath + savePath + filename, JsonUtility.ToJson(data)); + } + + [System.Serializable] + public enum ValueType + { + Bool = 0, + Int = 1, + Float = 2, + String = 3 + } + + [System.Serializable] + class SerializableOutput + { + public string[] keys; + public string[] values; + public ValueType[] types; + } + + #endregion + + } +} diff --git a/LocalPackages/net.peeweek.gameplay-ingredients/Runtime/Managers/Implementations/GameSaveManager.cs.meta b/LocalPackages/net.peeweek.gameplay-ingredients/Runtime/Managers/Implementations/GameSaveManager.cs.meta new file mode 100644 index 0000000..dcf9cad --- /dev/null +++ b/LocalPackages/net.peeweek.gameplay-ingredients/Runtime/Managers/Implementations/GameSaveManager.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 4a94c60800d516b4980b9f68a5ab6cb5 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/LocalPackages/net.peeweek.gameplay-ingredients/Runtime/LevelStreaming/LevelStreamingManager.cs b/LocalPackages/net.peeweek.gameplay-ingredients/Runtime/Managers/Implementations/LevelStreamingManager.cs similarity index 72% rename from LocalPackages/net.peeweek.gameplay-ingredients/Runtime/LevelStreaming/LevelStreamingManager.cs rename to LocalPackages/net.peeweek.gameplay-ingredients/Runtime/Managers/Implementations/LevelStreamingManager.cs index e1b85b3..ea61ae9 100644 --- a/LocalPackages/net.peeweek.gameplay-ingredients/Runtime/LevelStreaming/LevelStreamingManager.cs +++ b/LocalPackages/net.peeweek.gameplay-ingredients/Runtime/Managers/Implementations/LevelStreamingManager.cs @@ -2,31 +2,36 @@ using System.Collections; using System; using System.Collections.Generic; using UnityEngine; -using UnityEngine.Events; using UnityEngine.UI; using UnityEngine.SceneManagement; using System.Linq; namespace GameplayIngredients.LevelStreaming { - public class LevelStreamingManager : MonoBehaviour + [ManagerDefaultPrefab("LevelStreamingManager")] + public class LevelStreamingManager : Manager { - public static LevelStreamingManager instance { get { return s_Instance; } } - private static LevelStreamingManager s_Instance; - public enum StreamingAction { Load, - Unload + Unload, + Replace } [Header("UI Configuration")] public GameObject LoadingRoot; + public GameObject LoadingIcon; public GameObject ProgressBar; public GameObject ProgressBarContainer; public Text LoadingText; public Text PercentageText; + [Header("Behavior")] + [Min(0.0f)] + public float DelayBeforeLoad = 0.0f; + [Min(0.0f)] + public float DelayAfterLoad = 0.0f; + [Header("Debug")] public Text DebugText; public bool EnableDebug = false; @@ -34,24 +39,7 @@ namespace GameplayIngredients.LevelStreaming private float[] percentages; private AsyncOperation[] asyncOperations; - void OnEnable() - { - //if(!Console.HasCommand("STREAMING")) Console.AddCommand(new LevelStreamingCommand()); - - if (s_Instance != null) - throw new InvalidOperationException("LevelStreamingManager Already Exists"); - else - s_Instance = this; - - } - - void OnDisable() - { - if (s_Instance == this) - s_Instance = null; - } - - public void LoadScenes(StreamingAction action, string[] scenes, string sceneToActivate, bool showUI, UnityEvent onLoadComplete) + public void LoadScenes(StreamingAction action, string[] scenes, string sceneToActivate, bool showUI, Callable[] onLoadComplete, bool replace = false) { if (EnableDebug) DebugText.gameObject.SetActive(true); @@ -63,6 +51,7 @@ namespace GameplayIngredients.LevelStreaming if ( (SceneManager.GetSceneByName(scene).isLoaded && action == StreamingAction.Unload) || (!SceneManager.GetSceneByName(scene).isLoaded && action == StreamingAction.Load) + || (action == StreamingAction.Replace) ) { requiredScenes.Add(scene); @@ -70,35 +59,54 @@ namespace GameplayIngredients.LevelStreaming } int count = requiredScenes.Count; - percentages = new float[count]; - asyncOperations = new AsyncOperation[count]; if (showUI) LoadingRoot.SetActive(true); + if (LoadingIcon != null) + LoadingIcon.SetActive(true); + if (count > 0) StartCoroutine(LoadScenesCoroutine(action, requiredScenes, sceneToActivate, showUI, onLoadComplete)); else { Debug.LogWarning("Did not find any candidates to load or unload..."); - if (onLoadComplete != null) onLoadComplete.Invoke(); + if (onLoadComplete != null) + Callable.Call(onLoadComplete); if (showUI) LoadingRoot.SetActive(false); + if (LoadingIcon != null) + LoadingIcon.SetActive(false); + if (EnableDebug) DebugText.gameObject.SetActive(false); } } - IEnumerator LoadScenesCoroutine(StreamingAction action, List scenes, string sceneToActivate, bool showUI, UnityEvent onLoadComplete) + IEnumerator LoadScenesCoroutine(StreamingAction action, List scenes, string sceneToActivate, bool showUI, Callable[] onLoadComplete) { LogDebugInformation("START LOAD/UNLOAD FOR LEVELS..."); + LoadingText.text = "Loading..."; SetProgressBar(0.0f, true); + yield return new WaitForEndOfFrame(); + + if (DelayBeforeLoad >= 0.0f) + yield return new WaitForSeconds(DelayBeforeLoad); + + int count = scenes.Count; + + percentages = new float[count]; + asyncOperations = new AsyncOperation[count]; switch (action) { + case StreamingAction.Replace: + LogDebugInformation("[*] ASYNC REPLACE FOR: " + scenes); + StartCoroutine(LoadLevelCoroutine(scenes, sceneToActivate)); + break; case StreamingAction.Load: LogDebugInformation("[*] ASYNC LOAD FOR: " + scenes); StartCoroutine(LoadLevelCoroutine(scenes)); @@ -110,24 +118,39 @@ namespace GameplayIngredients.LevelStreaming default: throw new NotImplementedException("LoadScenesCoroutine does not handle mode " + action.ToString()); } + if(action == StreamingAction.Replace) + { + while (!asyncOperations[0].isDone) + yield return new WaitForEndOfFrame(); + } + // Wait for all scenes to be loaded while (asyncOperations.Any(a => !a.isDone)) yield return new WaitForEndOfFrame(); // Then change active scene - if (sceneToActivate != "") + if (!string.IsNullOrEmpty(sceneToActivate) && action != StreamingAction.Replace) { var newActive = SceneManager.GetSceneByName(sceneToActivate); SceneManager.SetActiveScene(newActive); yield return new WaitForEndOfFrame(); } + if(DelayAfterLoad >= 0.0f) + { + SetProgressBar(1.0f, true); + yield return new WaitForSeconds(DelayAfterLoad); + } + if (onLoadComplete != null) - onLoadComplete.Invoke(); + Callable.Call(onLoadComplete); if (showUI) LoadingRoot.SetActive(false); + if (LoadingIcon != null) + LoadingIcon.SetActive(false); + if (EnableDebug) DebugText.gameObject.SetActive(false); } @@ -136,19 +159,35 @@ namespace GameplayIngredients.LevelStreaming { for (int i = 0; i < asyncOperations.Length; i++) percentages[i] = asyncOperations[i].progress; + float percentage = percentages.Sum() / percentages.Length; SetProgressBar(percentage); } - private IEnumerator LoadLevelCoroutine(List sceneNames) + private IEnumerator LoadLevelCoroutine(List sceneNames, string singleScene = "") { - for (int i = 0; i < sceneNames.Count; i++) + // Manage Single Scene Loading + int offset = 0; + if (sceneNames.Contains(singleScene)) { - asyncOperations[i] = SceneManager.LoadSceneAsync(sceneNames[i], LoadSceneMode.Additive); - asyncOperations[i].allowSceneActivation = false; + asyncOperations[0] = SceneManager.LoadSceneAsync(singleScene, LoadSceneMode.Single); + asyncOperations[0].allowSceneActivation = true; + sceneNames.Remove(singleScene); + + while (!asyncOperations[0].isDone) + { + SetProgressBar(asyncOperations[0].progress / Math.Max(sceneNames.Count,1)); + yield return new WaitForEndOfFrame(); + } + + offset = 1; } - LoadingText.text = "Loading..."; + for (int i = 0; i < sceneNames.Count; i++) + { + asyncOperations[i + offset] = SceneManager.LoadSceneAsync(sceneNames[i], LoadSceneMode.Additive); + asyncOperations[i + offset].allowSceneActivation = false; + } while (asyncOperations.Any(a => a.progress < 0.9f)) { @@ -159,13 +198,12 @@ namespace GameplayIngredients.LevelStreaming // Activate scenes foreach (var a in asyncOperations) a.allowSceneActivation = true; + LoadingText.text = "Starting..."; LogDebugInformation("All scenes loaded"); while (asyncOperations.Any(a => !a.isDone)) { - foreach (var a in asyncOperations) - Debug.Log("allowSceneActivation: " + a.allowSceneActivation); UpdatePercentage(); yield return new WaitForEndOfFrame(); } diff --git a/LocalPackages/net.peeweek.gameplay-ingredients/Runtime/LevelStreaming/LevelStreamingManager.cs.meta b/LocalPackages/net.peeweek.gameplay-ingredients/Runtime/Managers/Implementations/LevelStreamingManager.cs.meta similarity index 100% rename from LocalPackages/net.peeweek.gameplay-ingredients/Runtime/LevelStreaming/LevelStreamingManager.cs.meta rename to LocalPackages/net.peeweek.gameplay-ingredients/Runtime/Managers/Implementations/LevelStreamingManager.cs.meta diff --git a/LocalPackages/net.peeweek.gameplay-ingredients/Runtime/Managers/Implementations/ScreenshotManager.cs b/LocalPackages/net.peeweek.gameplay-ingredients/Runtime/Managers/Implementations/ScreenshotManager.cs new file mode 100644 index 0000000..1270a27 --- /dev/null +++ b/LocalPackages/net.peeweek.gameplay-ingredients/Runtime/Managers/Implementations/ScreenshotManager.cs @@ -0,0 +1,39 @@ +using NaughtyAttributes; +using System.Collections; +using System.Collections.Generic; +using UnityEngine; + +namespace GameplayIngredients +{ + [ManagerDefaultPrefab("ScreenshotManager")] + public class ScreenshotManager : Manager + { + [Header("Capture")] + public KeyCode ScreenshotKeyCode = KeyCode.F11; + [Range(1, 5)] + public int SuperSize = 1; + + [Header("File name")] + public string Prefix = "Screenshot"; + + [Header("Actions")] + [ReorderableList] + public Callable[] OnBeforeScreenshot; + + [ReorderableList] + public Callable[] OnAfterScreenshot; + + public void Update() + { + if (Input.GetKeyDown(ScreenshotKeyCode)) + { + var now = System.DateTime.Now; + Callable.Call(OnBeforeScreenshot); + string path = $"{Application.dataPath}/../{Prefix}-{now.Year}{now.Month}{now.Day}-{now.Hour}{now.Minute}{now.Second}{now.Millisecond}.png"; + Debug.Log($"Capturing Screenshot (Supersampled to {SuperSize}x) to the file : {path}"); + ScreenCapture.CaptureScreenshot(path, SuperSize); + Callable.Call(OnAfterScreenshot); + } + } + } +} diff --git a/LocalPackages/net.peeweek.gameplay-ingredients/Runtime/Managers/Implementations/ScreenshotManager.cs.meta b/LocalPackages/net.peeweek.gameplay-ingredients/Runtime/Managers/Implementations/ScreenshotManager.cs.meta new file mode 100644 index 0000000..75cdb44 --- /dev/null +++ b/LocalPackages/net.peeweek.gameplay-ingredients/Runtime/Managers/Implementations/ScreenshotManager.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 82e5ad90f67f2ab4f8c09dedbb3beda3 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/LocalPackages/net.peeweek.gameplay-ingredients/Runtime/Managers/Implementations/UIEventManager.cs b/LocalPackages/net.peeweek.gameplay-ingredients/Runtime/Managers/Implementations/UIEventManager.cs new file mode 100644 index 0000000..c7eab0f --- /dev/null +++ b/LocalPackages/net.peeweek.gameplay-ingredients/Runtime/Managers/Implementations/UIEventManager.cs @@ -0,0 +1,24 @@ +using System.Collections; +using System.Collections.Generic; +using UnityEngine; +using UnityEngine.EventSystems; + +namespace GameplayIngredients +{ + [RequireComponent(typeof(EventSystem))] + [RequireComponent(typeof(StandaloneInputModule))] + [ManagerDefaultPrefab("UIEventManager")] + public class UIEventManager : Manager + { + public EventSystem eventSystem { get { return m_EventSystem; } } + [SerializeField] + private EventSystem m_EventSystem; + + private void OnEnable() + { + m_EventSystem = GetComponent(); + } + } +} + + diff --git a/LocalPackages/net.peeweek.gameplay-ingredients/Runtime/Managers/Implementations/UIEventManager.cs.meta b/LocalPackages/net.peeweek.gameplay-ingredients/Runtime/Managers/Implementations/UIEventManager.cs.meta new file mode 100644 index 0000000..96aba2f --- /dev/null +++ b/LocalPackages/net.peeweek.gameplay-ingredients/Runtime/Managers/Implementations/UIEventManager.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: b5bc0b3023dd1f8439a43adc2d70379f +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/LocalPackages/net.peeweek.gameplay-ingredients/Runtime/Managers/Implementations/VirtualCameraManager.cs b/LocalPackages/net.peeweek.gameplay-ingredients/Runtime/Managers/Implementations/VirtualCameraManager.cs new file mode 100644 index 0000000..c45f986 --- /dev/null +++ b/LocalPackages/net.peeweek.gameplay-ingredients/Runtime/Managers/Implementations/VirtualCameraManager.cs @@ -0,0 +1,23 @@ +using System.Collections; +using System.Collections.Generic; +using UnityEngine; +using Cinemachine; + +namespace GameplayIngredients +{ + [RequireComponent(typeof(Camera))] + [RequireComponent(typeof(CinemachineBrain))] + [ManagerDefaultPrefab("VirtualCameraManager")] + public class VirtualCameraManager : Manager + { + public Camera Camera { get; private set; } + public CinemachineBrain Brain { get; private set; } + + private void Awake() + { + Camera = GetComponent(); + Brain = GetComponent(); + } + + } +} diff --git a/LocalPackages/net.peeweek.gameplay-ingredients/Runtime/Managers/Implementations/VirtualCameraManager.cs.meta b/LocalPackages/net.peeweek.gameplay-ingredients/Runtime/Managers/Implementations/VirtualCameraManager.cs.meta new file mode 100644 index 0000000..986fa10 --- /dev/null +++ b/LocalPackages/net.peeweek.gameplay-ingredients/Runtime/Managers/Implementations/VirtualCameraManager.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 2a050287a9067304195c4fe5661de7e2 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/LocalPackages/net.peeweek.gameplay-ingredients/Runtime/Managers/Manager.cs b/LocalPackages/net.peeweek.gameplay-ingredients/Runtime/Managers/Manager.cs new file mode 100644 index 0000000..126610b --- /dev/null +++ b/LocalPackages/net.peeweek.gameplay-ingredients/Runtime/Managers/Manager.cs @@ -0,0 +1,111 @@ +using System.Linq; +using System.Collections.Generic; +using UnityEngine; +using System; +using System.Reflection; + +namespace GameplayIngredients +{ + public abstract class Manager : MonoBehaviour + { + private static Dictionary s_Managers = new Dictionary(); + + public static T Get() where T: Manager + { + if(s_Managers.ContainsKey(typeof(T))) + return (T)s_Managers[typeof(T)]; + else + { + Debug.LogError($"Manager of type '{typeof(T)}' could not be accessed. Check the excludedManagers list in your GameplayIngredientsSettings configuration file."); + return null; + } + } + + public static bool Has() where T:Manager + { + return(s_Managers.ContainsKey(typeof(T))); + } + + static readonly Type[] kAllManagerTypes = GetAllManagerTypes(); + + [RuntimeInitializeOnLoadMethod] + static void AutoCreateAll() + { + var exclusionList = GameplayIngredientsSettings.currentSettings.excludedeManagers; + + Debug.Log("Initializing all Managers..."); + foreach(var type in kAllManagerTypes) + { + if(exclusionList != null && exclusionList.ToList().Contains(type.Name)) + { + Debug.Log($"Manager : {type.Name} is in GameplayIngredientSettings.excludedeManagers List: ignoring Creation"); + continue; + } + var attrib = type.GetCustomAttribute(); + GameObject gameObject; + + if(attrib != null) + { + var prefab = Resources.Load(attrib.prefab); + + if(prefab == null) // Try loading the "Default_" prefixed version of the prefab + { + prefab = Resources.Load("Default_"+attrib.prefab); + } + + if(prefab != null) + { + gameObject = GameObject.Instantiate(prefab); + } + else + { + Debug.LogError($"Could not instantiate default prefab for {type.ToString()} : No prefab '{attrib.prefab}' found in resources folders. Ignoring..."); + continue; + } + } + else + { + gameObject = new GameObject(); + gameObject.AddComponent(type); + } + gameObject.name = type.Name; + GameObject.DontDestroyOnLoad(gameObject); + var comp = (Manager)gameObject.GetComponent(type); + s_Managers.Add(type,comp); + + Debug.Log(string.Format(" -> <{0}> OK", type.Name)); + } + } + + static Type[] GetAllManagerTypes() + { + List types = new List(); + 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(); + } + } +} diff --git a/LocalPackages/net.peeweek.gameplay-ingredients/Runtime/Managers/Manager.cs.meta b/LocalPackages/net.peeweek.gameplay-ingredients/Runtime/Managers/Manager.cs.meta new file mode 100644 index 0000000..9b1160c --- /dev/null +++ b/LocalPackages/net.peeweek.gameplay-ingredients/Runtime/Managers/Manager.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: a51b2a5e60503924ba12a4919d679d42 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/LocalPackages/net.peeweek.gameplay-ingredients/Runtime/Managers/ManagerDefaultPrefabAttribute.cs b/LocalPackages/net.peeweek.gameplay-ingredients/Runtime/Managers/ManagerDefaultPrefabAttribute.cs new file mode 100644 index 0000000..43d1966 --- /dev/null +++ b/LocalPackages/net.peeweek.gameplay-ingredients/Runtime/Managers/ManagerDefaultPrefabAttribute.cs @@ -0,0 +1,20 @@ +using System.Collections; +using System.Collections.Generic; +using UnityEngine; +using System; + +namespace GameplayIngredients +{ + [AttributeUsage(AttributeTargets.Class)] + public class ManagerDefaultPrefabAttribute : Attribute + { + public string prefab { get => m_Prefab; } + string m_Prefab; + + public ManagerDefaultPrefabAttribute(string prefabName) + { + m_Prefab = prefabName; + } + } +} + diff --git a/LocalPackages/net.peeweek.gameplay-ingredients/Runtime/Managers/ManagerDefaultPrefabAttribute.cs.meta b/LocalPackages/net.peeweek.gameplay-ingredients/Runtime/Managers/ManagerDefaultPrefabAttribute.cs.meta new file mode 100644 index 0000000..ed61ca6 --- /dev/null +++ b/LocalPackages/net.peeweek.gameplay-ingredients/Runtime/Managers/ManagerDefaultPrefabAttribute.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 92b17bbe74aea2243973310189255c48 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/LocalPackages/net.peeweek.gameplay-ingredients/Runtime/Messager.meta b/LocalPackages/net.peeweek.gameplay-ingredients/Runtime/Managers/Messager.meta similarity index 100% rename from LocalPackages/net.peeweek.gameplay-ingredients/Runtime/Messager.meta rename to LocalPackages/net.peeweek.gameplay-ingredients/Runtime/Managers/Messager.meta diff --git a/LocalPackages/net.peeweek.gameplay-ingredients/Runtime/Managers/Messager/Messager.cs b/LocalPackages/net.peeweek.gameplay-ingredients/Runtime/Managers/Messager/Messager.cs new file mode 100644 index 0000000..f8de84d --- /dev/null +++ b/LocalPackages/net.peeweek.gameplay-ingredients/Runtime/Managers/Messager/Messager.cs @@ -0,0 +1,68 @@ +using System; +using System.Collections.Generic; +using UnityEngine; + +namespace GameplayIngredients +{ + public static class Messager + { + public delegate void Message(GameObject instigator = null); + + private static Dictionary> m_RegisteredMessages; + + static Messager() + { + m_RegisteredMessages = new Dictionary>(); + } + + public static void RegisterMessage(string messageName, Message message) + { + if (!m_RegisteredMessages.ContainsKey(messageName)) + m_RegisteredMessages.Add(messageName, new List()); + + if (!m_RegisteredMessages[messageName].Contains(message)) + m_RegisteredMessages[messageName].Add(message); + else + { + Debug.LogWarning(string.Format("Messager : {0} entry already contains reference to message.", messageName)); + } + } + + public static void RemoveMessage(string messageName, Message message) + { + var currentEvent = m_RegisteredMessages[messageName]; + if(currentEvent.Contains(message)) + currentEvent.Remove(message); + + if (currentEvent == null || currentEvent.Count == 0) + m_RegisteredMessages.Remove(messageName); + } + + public static void Send(string eventName, GameObject instigator = null) + { + if(GameplayIngredientsSettings.currentSettings.verboseCalls) + Debug.Log(string.Format("[MessageManager] Broadcast: {0}", eventName)); + + if (m_RegisteredMessages.ContainsKey(eventName)) + { + try + { + foreach (var message in m_RegisteredMessages[eventName]) + { + message.Invoke(instigator); + } + } + catch (Exception e) + { + Debug.LogError(string.Format("Messager : Caught {0} while sending Message {1}", e.GetType().Name, eventName)); + Debug.LogException(e); + } + } + else + { + Debug.Log("[MessageManager] could not find any listeners for event : " + eventName); + } + } + } +} + diff --git a/LocalPackages/net.peeweek.gameplay-ingredients/Runtime/Messager/Messager.cs.meta b/LocalPackages/net.peeweek.gameplay-ingredients/Runtime/Managers/Messager/Messager.cs.meta similarity index 100% rename from LocalPackages/net.peeweek.gameplay-ingredients/Runtime/Messager/Messager.cs.meta rename to LocalPackages/net.peeweek.gameplay-ingredients/Runtime/Managers/Messager/Messager.cs.meta diff --git a/LocalPackages/net.peeweek.gameplay-ingredients/Runtime/Managers/Messager/Playables.meta b/LocalPackages/net.peeweek.gameplay-ingredients/Runtime/Managers/Messager/Playables.meta new file mode 100644 index 0000000..d3e069d --- /dev/null +++ b/LocalPackages/net.peeweek.gameplay-ingredients/Runtime/Managers/Messager/Playables.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 82fb72ee12182554681d3834638a7410 +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/LocalPackages/net.peeweek.gameplay-ingredients/Runtime/Managers/Messager/Playables/SendMessage.meta b/LocalPackages/net.peeweek.gameplay-ingredients/Runtime/Managers/Messager/Playables/SendMessage.meta new file mode 100644 index 0000000..5161b30 --- /dev/null +++ b/LocalPackages/net.peeweek.gameplay-ingredients/Runtime/Managers/Messager/Playables/SendMessage.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 28fbd0def0e32d047a3ed5f8690959c6 +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/LocalPackages/net.peeweek.gameplay-ingredients/Runtime/Managers/Messager/Playables/SendMessage/SendMessageBehaviour.cs b/LocalPackages/net.peeweek.gameplay-ingredients/Runtime/Managers/Messager/Playables/SendMessage/SendMessageBehaviour.cs new file mode 100644 index 0000000..d40fd70 --- /dev/null +++ b/LocalPackages/net.peeweek.gameplay-ingredients/Runtime/Managers/Messager/Playables/SendMessage/SendMessageBehaviour.cs @@ -0,0 +1,31 @@ +using System; +using UnityEngine; +using UnityEngine.Playables; +using UnityEngine.Timeline; + +namespace GameplayIngredients.Playables +{ + [Serializable] + public class SendMessageBehaviour : PlayableBehaviour + { + public string StartMessage; + public GameObject Instigator; + + public override void OnBehaviourPlay(Playable playable, FrameData info) + { + base.OnBehaviourPlay(playable, info); + if(StartMessage != "" ) + { + if (Application.isPlaying) + Messager.Send(StartMessage, Instigator); + else + Debug.Log("[SendMessageBehaviour] Would have sent broadcast message : '" + StartMessage + "'"); + } + } + + public override void OnGraphStart (Playable playable) + { + + } + } +} diff --git a/LocalPackages/net.peeweek.gameplay-ingredients/Runtime/Managers/Messager/Playables/SendMessage/SendMessageBehaviour.cs.meta b/LocalPackages/net.peeweek.gameplay-ingredients/Runtime/Managers/Messager/Playables/SendMessage/SendMessageBehaviour.cs.meta new file mode 100644 index 0000000..45f4e18 --- /dev/null +++ b/LocalPackages/net.peeweek.gameplay-ingredients/Runtime/Managers/Messager/Playables/SendMessage/SendMessageBehaviour.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 36ad03ebb9cd1654a81443986e35d906 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/LocalPackages/net.peeweek.gameplay-ingredients/Runtime/Managers/Messager/Playables/SendMessage/SendMessageClip.cs b/LocalPackages/net.peeweek.gameplay-ingredients/Runtime/Managers/Messager/Playables/SendMessage/SendMessageClip.cs new file mode 100644 index 0000000..f556aa6 --- /dev/null +++ b/LocalPackages/net.peeweek.gameplay-ingredients/Runtime/Managers/Messager/Playables/SendMessage/SendMessageClip.cs @@ -0,0 +1,25 @@ +using System; +using UnityEngine; +using UnityEngine.Playables; +using UnityEngine.Timeline; + +namespace GameplayIngredients.Playables +{ + [Serializable] + public class SendMessageClip : PlayableAsset, ITimelineClipAsset + { + public SendMessageBehaviour template = new SendMessageBehaviour (); + + public ClipCaps clipCaps + { + get { return ClipCaps.None; } + } + + public override Playable CreatePlayable (PlayableGraph graph, GameObject owner) + { + var playable = ScriptPlayable.Create (graph, template); + SendMessageBehaviour clone = playable.GetBehaviour (); + return playable; + } + } +} diff --git a/LocalPackages/net.peeweek.gameplay-ingredients/Runtime/Managers/Messager/Playables/SendMessage/SendMessageClip.cs.meta b/LocalPackages/net.peeweek.gameplay-ingredients/Runtime/Managers/Messager/Playables/SendMessage/SendMessageClip.cs.meta new file mode 100644 index 0000000..7e45a8f --- /dev/null +++ b/LocalPackages/net.peeweek.gameplay-ingredients/Runtime/Managers/Messager/Playables/SendMessage/SendMessageClip.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: cb58c39ec6569f44f80a61f5c3cf164f +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/LocalPackages/net.peeweek.gameplay-ingredients/Runtime/Managers/Messager/Playables/SendMessage/SendMessageMixerBehaviour.cs b/LocalPackages/net.peeweek.gameplay-ingredients/Runtime/Managers/Messager/Playables/SendMessage/SendMessageMixerBehaviour.cs new file mode 100644 index 0000000..90804a7 --- /dev/null +++ b/LocalPackages/net.peeweek.gameplay-ingredients/Runtime/Managers/Messager/Playables/SendMessage/SendMessageMixerBehaviour.cs @@ -0,0 +1,26 @@ +using System; +using UnityEngine; +using UnityEngine.Playables; +using UnityEngine.Timeline; + +namespace GameplayIngredients.Playables +{ + public class SendMessageMixerBehaviour : PlayableBehaviour + { + // NOTE: This function is called at runtime and edit time. Keep that in mind when setting the values of properties. + public override void ProcessFrame(Playable playable, FrameData info, object playerData) + { + int inputCount = playable.GetInputCount (); + + for (int i = 0; i < inputCount; i++) + { + float inputWeight = playable.GetInputWeight(i); + ScriptPlayable inputPlayable = (ScriptPlayable)playable.GetInput(i); + SendMessageBehaviour input = inputPlayable.GetBehaviour (); + + // Use the above variables to process each frame of this playable. + + } + } + } +} diff --git a/LocalPackages/net.peeweek.gameplay-ingredients/Runtime/Managers/Messager/Playables/SendMessage/SendMessageMixerBehaviour.cs.meta b/LocalPackages/net.peeweek.gameplay-ingredients/Runtime/Managers/Messager/Playables/SendMessage/SendMessageMixerBehaviour.cs.meta new file mode 100644 index 0000000..7e71bb2 --- /dev/null +++ b/LocalPackages/net.peeweek.gameplay-ingredients/Runtime/Managers/Messager/Playables/SendMessage/SendMessageMixerBehaviour.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 77ff4b879de7c6442b58e17420f97a6b +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/LocalPackages/net.peeweek.gameplay-ingredients/Runtime/Managers/Messager/Playables/SendMessage/SendMessageTrack.cs b/LocalPackages/net.peeweek.gameplay-ingredients/Runtime/Managers/Messager/Playables/SendMessage/SendMessageTrack.cs new file mode 100644 index 0000000..65f5ec5 --- /dev/null +++ b/LocalPackages/net.peeweek.gameplay-ingredients/Runtime/Managers/Messager/Playables/SendMessage/SendMessageTrack.cs @@ -0,0 +1,16 @@ +using UnityEngine; +using UnityEngine.Playables; +using UnityEngine.Timeline; + +namespace GameplayIngredients.Playables +{ + [TrackColor(0.5377358f, 0.3115655f, 0.1699448f)] + [TrackClipType(typeof(SendMessageClip))] + public class SendMessageTrack : TrackAsset + { + public override Playable CreateTrackMixer(PlayableGraph graph, GameObject go, int inputCount) + { + return ScriptPlayable.Create (graph, inputCount); + } + } +} diff --git a/LocalPackages/net.peeweek.gameplay-ingredients/Runtime/Managers/Messager/Playables/SendMessage/SendMessageTrack.cs.meta b/LocalPackages/net.peeweek.gameplay-ingredients/Runtime/Managers/Messager/Playables/SendMessage/SendMessageTrack.cs.meta new file mode 100644 index 0000000..d41a301 --- /dev/null +++ b/LocalPackages/net.peeweek.gameplay-ingredients/Runtime/Managers/Messager/Playables/SendMessage/SendMessageTrack.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 7d750ab4465e67c4d87e45dee6734baf +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/LocalPackages/net.peeweek.gameplay-ingredients/Runtime/Messager/Messager.cs b/LocalPackages/net.peeweek.gameplay-ingredients/Runtime/Messager/Messager.cs deleted file mode 100644 index d9d572d..0000000 --- a/LocalPackages/net.peeweek.gameplay-ingredients/Runtime/Messager/Messager.cs +++ /dev/null @@ -1,48 +0,0 @@ -using System; -using System.Collections.Generic; -using UnityEngine; - -namespace GameplayIngredients -{ - public static class Messager - { - private static Dictionary m_RegisteredEvents; - - static Messager() - { - m_RegisteredEvents = new Dictionary(); - } - - - public static void RegisterEvent(string eventName, Action action) - { - if (!m_RegisteredEvents.ContainsKey(eventName)) - m_RegisteredEvents.Add(eventName, action); - else - m_RegisteredEvents[eventName] += action; - } - - public static void UnregisterEvent(string eventName, Action action) - { - var currentEvent = m_RegisteredEvents[eventName]; - currentEvent -= action; - if (currentEvent == null) - m_RegisteredEvents.Remove(eventName); - } - - public static void Send(string eventName) - { - Debug.Log(string.Format("[MessageManager] Broadcast: {0}", eventName)); - - if (m_RegisteredEvents.ContainsKey(eventName)) - { - m_RegisteredEvents[eventName](); - } - else - { - Debug.Log("[MessageManager] could not find any listeners for event : " + eventName); - } - } - } -} - diff --git a/LocalPackages/net.peeweek.gameplay-ingredients/Runtime/PropertyAttributes.meta b/LocalPackages/net.peeweek.gameplay-ingredients/Runtime/PropertyAttributes.meta new file mode 100644 index 0000000..80f28e4 --- /dev/null +++ b/LocalPackages/net.peeweek.gameplay-ingredients/Runtime/PropertyAttributes.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: d0e791fe1aeccb54287b96625bd374be +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/LocalPackages/net.peeweek.gameplay-ingredients/Runtime/PropertyAttributes/NonNullCheckAttribute.cs b/LocalPackages/net.peeweek.gameplay-ingredients/Runtime/PropertyAttributes/NonNullCheckAttribute.cs new file mode 100644 index 0000000..ed14f1e --- /dev/null +++ b/LocalPackages/net.peeweek.gameplay-ingredients/Runtime/PropertyAttributes/NonNullCheckAttribute.cs @@ -0,0 +1,9 @@ +using System; +using System.Collections; +using System.Collections.Generic; +using UnityEngine; + +namespace GameplayIngredients +{ + public class NonNullCheckAttribute : PropertyAttribute { } +} diff --git a/LocalPackages/net.peeweek.gameplay-ingredients/Runtime/PropertyAttributes/NonNullCheckAttribute.cs.meta b/LocalPackages/net.peeweek.gameplay-ingredients/Runtime/PropertyAttributes/NonNullCheckAttribute.cs.meta new file mode 100644 index 0000000..b30d552 --- /dev/null +++ b/LocalPackages/net.peeweek.gameplay-ingredients/Runtime/PropertyAttributes/NonNullCheckAttribute.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: defe36a4f4b028143982e0d6aedaa35a +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/LocalPackages/net.peeweek.gameplay-ingredients/Runtime/PropertyAttributes/SceneAttribute.cs b/LocalPackages/net.peeweek.gameplay-ingredients/Runtime/PropertyAttributes/SceneAttribute.cs new file mode 100644 index 0000000..0815f12 --- /dev/null +++ b/LocalPackages/net.peeweek.gameplay-ingredients/Runtime/PropertyAttributes/SceneAttribute.cs @@ -0,0 +1,9 @@ +using System; +using System.Collections; +using System.Collections.Generic; +using UnityEngine; + +namespace GameplayIngredients +{ + public class SceneAttribute : PropertyAttribute { } +} diff --git a/LocalPackages/net.peeweek.gameplay-ingredients/Runtime/PropertyAttributes/SceneAttribute.cs.meta b/LocalPackages/net.peeweek.gameplay-ingredients/Runtime/PropertyAttributes/SceneAttribute.cs.meta new file mode 100644 index 0000000..c731099 --- /dev/null +++ b/LocalPackages/net.peeweek.gameplay-ingredients/Runtime/PropertyAttributes/SceneAttribute.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 4d6bacd85ad9374418dcdc6b1768b95c +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/LocalPackages/net.peeweek.gameplay-ingredients/Runtime/PropertyAttributes/StateMachineStateAttribute.cs b/LocalPackages/net.peeweek.gameplay-ingredients/Runtime/PropertyAttributes/StateMachineStateAttribute.cs new file mode 100644 index 0000000..7a67b8e --- /dev/null +++ b/LocalPackages/net.peeweek.gameplay-ingredients/Runtime/PropertyAttributes/StateMachineStateAttribute.cs @@ -0,0 +1,17 @@ +using System; +using System.Collections; +using System.Collections.Generic; +using UnityEngine; + +namespace GameplayIngredients +{ + public class StateMachineStateAttribute : PropertyAttribute + { + public readonly string PropertyName; + + public StateMachineStateAttribute(string propertyName = "") + { + PropertyName = propertyName; + } + } +} diff --git a/LocalPackages/net.peeweek.gameplay-ingredients/Runtime/PropertyAttributes/StateMachineStateAttribute.cs.meta b/LocalPackages/net.peeweek.gameplay-ingredients/Runtime/PropertyAttributes/StateMachineStateAttribute.cs.meta new file mode 100644 index 0000000..bf7d26c --- /dev/null +++ b/LocalPackages/net.peeweek.gameplay-ingredients/Runtime/PropertyAttributes/StateMachineStateAttribute.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 3f6c4fc5e5b9fe44c8ca902bcc94b4bf +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/LocalPackages/net.peeweek.gameplay-ingredients/Runtime/PropertyAttributes/TypeDropDownAttribute.cs b/LocalPackages/net.peeweek.gameplay-ingredients/Runtime/PropertyAttributes/TypeDropDownAttribute.cs new file mode 100644 index 0000000..ed436e1 --- /dev/null +++ b/LocalPackages/net.peeweek.gameplay-ingredients/Runtime/PropertyAttributes/TypeDropDownAttribute.cs @@ -0,0 +1,15 @@ +using System; +using UnityEngine; + +namespace GameplayIngredients +{ + public class TypeDropDownAttribute : PropertyAttribute + { + public Type m_BaseType; + + public TypeDropDownAttribute(Type baseType) + { + m_BaseType = baseType; + } + } +} diff --git a/LocalPackages/net.peeweek.gameplay-ingredients/Runtime/PropertyAttributes/TypeDropDownAttribute.cs.meta b/LocalPackages/net.peeweek.gameplay-ingredients/Runtime/PropertyAttributes/TypeDropDownAttribute.cs.meta new file mode 100644 index 0000000..8aef225 --- /dev/null +++ b/LocalPackages/net.peeweek.gameplay-ingredients/Runtime/PropertyAttributes/TypeDropDownAttribute.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: c58b12809d7699c4eacb4bac0602dec2 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/LocalPackages/net.peeweek.gameplay-ingredients/Runtime/SceneViewPOV.meta b/LocalPackages/net.peeweek.gameplay-ingredients/Runtime/SceneViewPOV.meta new file mode 100644 index 0000000..a4f5091 --- /dev/null +++ b/LocalPackages/net.peeweek.gameplay-ingredients/Runtime/SceneViewPOV.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 23cde805c3888694799b0991bf8ef9aa +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/LocalPackages/net.peeweek.gameplay-ingredients/Runtime/SceneViewPOV/ScenePOVRoot.cs b/LocalPackages/net.peeweek.gameplay-ingredients/Runtime/SceneViewPOV/ScenePOVRoot.cs new file mode 100644 index 0000000..3e53788 --- /dev/null +++ b/LocalPackages/net.peeweek.gameplay-ingredients/Runtime/SceneViewPOV/ScenePOVRoot.cs @@ -0,0 +1,36 @@ +using System.Collections; +using System.Collections.Generic; +using UnityEngine; +using UnityEngine.SceneManagement; + +namespace GameplayIngredients +{ + public class ScenePOVRoot : MonoBehaviour + { + public Scene Scene + { + get { return gameObject.scene; } + } + + public Transform[] AllPOV + { + get + { + List all = new List(); + for(int i = 0; i< gameObject.transform.childCount; i++) + all.Add(gameObject.transform.GetChild(i)); + return all.ToArray(); + } + } + + public void AddPOV(Transform t, string Name) + { + var newPov = new GameObject(Name); + newPov.transform.position = t.position; + newPov.transform.rotation = t.rotation; + newPov.transform.parent = this.transform; + } + } +} + + diff --git a/LocalPackages/net.peeweek.gameplay-ingredients/Runtime/SceneViewPOV/ScenePOVRoot.cs.meta b/LocalPackages/net.peeweek.gameplay-ingredients/Runtime/SceneViewPOV/ScenePOVRoot.cs.meta new file mode 100644 index 0000000..7509e6b --- /dev/null +++ b/LocalPackages/net.peeweek.gameplay-ingredients/Runtime/SceneViewPOV/ScenePOVRoot.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 46a30f76dc1b1664e8670a337da75c21 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/LocalPackages/net.peeweek.gameplay-ingredients/Runtime/Settings.meta b/LocalPackages/net.peeweek.gameplay-ingredients/Runtime/Settings.meta new file mode 100644 index 0000000..0d796fa --- /dev/null +++ b/LocalPackages/net.peeweek.gameplay-ingredients/Runtime/Settings.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: b8739a81f74937f4b815f0298618db6c +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/LocalPackages/net.peeweek.gameplay-ingredients/Runtime/Settings/GameplayIngredientsSettings.cs b/LocalPackages/net.peeweek.gameplay-ingredients/Runtime/Settings/GameplayIngredientsSettings.cs new file mode 100644 index 0000000..a19320d --- /dev/null +++ b/LocalPackages/net.peeweek.gameplay-ingredients/Runtime/Settings/GameplayIngredientsSettings.cs @@ -0,0 +1,75 @@ +using System.Collections; +using System.Collections.Generic; +using UnityEngine; +using NaughtyAttributes; + +namespace GameplayIngredients +{ + public class GameplayIngredientsSettings : ScriptableObject + { + public string[] excludedeManagers { get { return m_ExcludedManagers; } } + public bool verboseCalls { get { return m_VerboseCalls; } } + public bool allowUpdateCalls { get { return m_AllowUpdateCalls; } } + + public bool disableWelcomeScreenAutoStart { get { return m_DisableWelcomeScreenAutoStart; } } + + [BoxGroup("Editor")] + [SerializeField] + protected bool m_DisableWelcomeScreenAutoStart; + + [BoxGroup("Managers")] + [SerializeField, ReorderableList, TypeDropDown(typeof(Manager))] + protected string[] m_ExcludedManagers; + + [BoxGroup("Callables")] + [SerializeField, InfoBox("Verbose Calls enable logging at runtime, this can lead to performance drop, use only when debugging.", InfoBoxType.Warning, "m_VerboseCalls")] + private bool m_VerboseCalls = false; + + [BoxGroup("Callables")] + [SerializeField, InfoBox("Per-update calls should be avoided due to high performance impact. Enable and use with care, only if strictly necessary.", InfoBoxType.Warning, "m_AllowUpdateCalls")] + private bool m_AllowUpdateCalls = false; + + const string kAssetName = "GameplayIngredientsSettings"; + + public static GameplayIngredientsSettings currentSettings + { + get + { + if (hasSettingAsset) + return Resources.Load(kAssetName); + else + return defaultSettings; + } + } + + public static bool hasSettingAsset + { + get + { + return Resources.Load(kAssetName) != null; + } + } + + + public static GameplayIngredientsSettings defaultSettings + { + get + { + if (s_DefaultSettings == null) + s_DefaultSettings = CreateDefaultSettings(); + return s_DefaultSettings; + } + } + + static GameplayIngredientsSettings s_DefaultSettings; + + static GameplayIngredientsSettings CreateDefaultSettings() + { + var defaultAsset = CreateInstance(); + defaultAsset.m_VerboseCalls = false; + defaultAsset.m_ExcludedManagers = new string[0]; + defaultAsset.m_DisableWelcomeScreenAutoStart = false; + return defaultAsset; + } + } +} diff --git a/LocalPackages/net.peeweek.gameplay-ingredients/Runtime/Settings/GameplayIngredientsSettings.cs.meta b/LocalPackages/net.peeweek.gameplay-ingredients/Runtime/Settings/GameplayIngredientsSettings.cs.meta new file mode 100644 index 0000000..0ff5108 --- /dev/null +++ b/LocalPackages/net.peeweek.gameplay-ingredients/Runtime/Settings/GameplayIngredientsSettings.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 9b86121d23ed10e40bcfa3df03459c5c +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/LocalPackages/net.peeweek.gameplay-ingredients/StarterAssets.meta b/LocalPackages/net.peeweek.gameplay-ingredients/StarterAssets.meta new file mode 100644 index 0000000..ea84624 --- /dev/null +++ b/LocalPackages/net.peeweek.gameplay-ingredients/StarterAssets.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 62761f48e3ddc78458b57e2a18964d48 +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/LocalPackages/net.peeweek.gameplay-ingredients/StarterAssets/GameplayIngredients-Starter-HDRP.unitypackage b/LocalPackages/net.peeweek.gameplay-ingredients/StarterAssets/GameplayIngredients-Starter-HDRP.unitypackage new file mode 100644 index 0000000..a06777e Binary files /dev/null and b/LocalPackages/net.peeweek.gameplay-ingredients/StarterAssets/GameplayIngredients-Starter-HDRP.unitypackage differ diff --git a/LocalPackages/net.peeweek.gameplay-ingredients/StarterAssets/GameplayIngredients-Starter-HDRP.unitypackage.meta b/LocalPackages/net.peeweek.gameplay-ingredients/StarterAssets/GameplayIngredients-Starter-HDRP.unitypackage.meta new file mode 100644 index 0000000..918056c --- /dev/null +++ b/LocalPackages/net.peeweek.gameplay-ingredients/StarterAssets/GameplayIngredients-Starter-HDRP.unitypackage.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: 8ec50e1f748a9344f8640616de00af3c +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/LocalPackages/net.peeweek.gameplay-ingredients/StarterAssets/GameplayIngredients-Starter-LWRP.unitypackage b/LocalPackages/net.peeweek.gameplay-ingredients/StarterAssets/GameplayIngredients-Starter-LWRP.unitypackage new file mode 100644 index 0000000..edcf326 Binary files /dev/null and b/LocalPackages/net.peeweek.gameplay-ingredients/StarterAssets/GameplayIngredients-Starter-LWRP.unitypackage differ diff --git a/LocalPackages/net.peeweek.gameplay-ingredients/StarterAssets/GameplayIngredients-Starter-LWRP.unitypackage.meta b/LocalPackages/net.peeweek.gameplay-ingredients/StarterAssets/GameplayIngredients-Starter-LWRP.unitypackage.meta new file mode 100644 index 0000000..73e09c9 --- /dev/null +++ b/LocalPackages/net.peeweek.gameplay-ingredients/StarterAssets/GameplayIngredients-Starter-LWRP.unitypackage.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: ed28711a3eff7c947a23be2fb10d552f +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/LocalPackages/net.peeweek.gameplay-ingredients/StarterAssets/GameplayIngredients-Starter-LegacyRenderer.unitypackage b/LocalPackages/net.peeweek.gameplay-ingredients/StarterAssets/GameplayIngredients-Starter-LegacyRenderer.unitypackage new file mode 100644 index 0000000..06a6adb Binary files /dev/null and b/LocalPackages/net.peeweek.gameplay-ingredients/StarterAssets/GameplayIngredients-Starter-LegacyRenderer.unitypackage differ diff --git a/LocalPackages/net.peeweek.gameplay-ingredients/StarterAssets/GameplayIngredients-Starter-LegacyRenderer.unitypackage.meta b/LocalPackages/net.peeweek.gameplay-ingredients/StarterAssets/GameplayIngredients-Starter-LegacyRenderer.unitypackage.meta new file mode 100644 index 0000000..3fe4450 --- /dev/null +++ b/LocalPackages/net.peeweek.gameplay-ingredients/StarterAssets/GameplayIngredients-Starter-LegacyRenderer.unitypackage.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: 2325e540864e4d3449ec77b3c234b768 +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/LocalPackages/net.peeweek.gameplay-ingredients/UI.meta b/LocalPackages/net.peeweek.gameplay-ingredients/UI.meta new file mode 100644 index 0000000..de5d032 --- /dev/null +++ b/LocalPackages/net.peeweek.gameplay-ingredients/UI.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 21d85dd1b311e68409f505448134da4b +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/LocalPackages/net.peeweek.gameplay-ingredients/UI/PoweredByGameplayIngredients.png b/LocalPackages/net.peeweek.gameplay-ingredients/UI/PoweredByGameplayIngredients.png new file mode 100644 index 0000000..7bbdd8d --- /dev/null +++ b/LocalPackages/net.peeweek.gameplay-ingredients/UI/PoweredByGameplayIngredients.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:364783a7b14b72863b1e0bdf3bc8722d7e76c3cda4cdea3d58f93f48a0d3f934 +size 41523 diff --git a/LocalPackages/net.peeweek.gameplay-ingredients/UI/PoweredByGameplayIngredients.png.meta b/LocalPackages/net.peeweek.gameplay-ingredients/UI/PoweredByGameplayIngredients.png.meta new file mode 100644 index 0000000..170f8c7 --- /dev/null +++ b/LocalPackages/net.peeweek.gameplay-ingredients/UI/PoweredByGameplayIngredients.png.meta @@ -0,0 +1,115 @@ +fileFormatVersion: 2 +guid: fe5023d32168f5c4490124741b49dca1 +TextureImporter: + internalIDToNameTable: [] + externalObjects: {} + serializedVersion: 10 + mipmaps: + mipMapMode: 0 + enableMipMap: 0 + sRGBTexture: 1 + linearTexture: 0 + fadeOut: 0 + borderMipMap: 0 + mipMapsPreserveCoverage: 0 + alphaTestReferenceValue: 0.5 + mipMapFadeDistanceStart: 1 + mipMapFadeDistanceEnd: 3 + bumpmap: + convertToNormalMap: 0 + externalNormalMap: 0 + heightScale: 0.25 + normalMapFilter: 0 + isReadable: 0 + streamingMipmaps: 0 + streamingMipmapsPriority: 0 + grayScaleToAlpha: 0 + generateCubemap: 6 + cubemapConvolution: 0 + seamlessCubemap: 0 + textureFormat: 1 + maxTextureSize: 2048 + textureSettings: + serializedVersion: 2 + filterMode: -1 + aniso: -1 + mipBias: -100 + wrapU: 1 + wrapV: 1 + wrapW: -1 + nPOTScale: 0 + lightmap: 0 + compressionQuality: 50 + spriteMode: 1 + spriteExtrude: 1 + spriteMeshType: 1 + alignment: 0 + spritePivot: {x: 0.5, y: 0.5} + spritePixelsToUnits: 100 + spriteBorder: {x: 0, y: 0, z: 0, w: 0} + spriteGenerateFallbackPhysicsShape: 1 + alphaUsage: 1 + alphaIsTransparency: 1 + spriteTessellationDetail: -1 + textureType: 8 + textureShape: 1 + singleChannelComponent: 0 + maxTextureSizeSet: 0 + compressionQualitySet: 0 + textureFormatSet: 0 + platformSettings: + - serializedVersion: 3 + buildTarget: DefaultTexturePlatform + maxTextureSize: 2048 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 1 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + androidETC2FallbackOverride: 0 + forceMaximumCompressionQuality_BC6H_BC7: 0 + - serializedVersion: 3 + buildTarget: Standalone + maxTextureSize: 2048 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 1 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + androidETC2FallbackOverride: 0 + forceMaximumCompressionQuality_BC6H_BC7: 0 + - serializedVersion: 3 + buildTarget: Android + maxTextureSize: 2048 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 1 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + androidETC2FallbackOverride: 0 + forceMaximumCompressionQuality_BC6H_BC7: 0 + spriteSheet: + serializedVersion: 2 + sprites: [] + outline: [] + physicsShape: [] + bones: [] + spriteID: 5e97eb03825dee720800000000000000 + internalID: 0 + vertices: [] + indices: + edges: [] + weights: [] + secondaryTextures: [] + spritePackingTag: + pSDRemoveMatte: 0 + pSDShowRemoveMatteOption: 0 + userData: + assetBundleName: + assetBundleVariant: diff --git a/LocalPackages/net.peeweek.gameplay-ingredients/package.json b/LocalPackages/net.peeweek.gameplay-ingredients/package.json index 6ee9df6..260a59e 100644 --- a/LocalPackages/net.peeweek.gameplay-ingredients/package.json +++ b/LocalPackages/net.peeweek.gameplay-ingredients/package.json @@ -1,7 +1,21 @@ { - "name": "net.peeweek.gameplay-ingredients", - "displayName": "Gameplay Ingredients", - "version": "0.0.1", - "unity": "2018.3", - "description": "Gameplay ingredients base package" + "name": "net.peeweek.gameplay-ingredients", + "displayName": "Gameplay Ingredients", + "version": "2019.3.1", + "category": "Gameplay", + "unity": "2019.3", + "description": "Gameplay ingredients - A Collection of scripts for the editor and runtime to set-up gameplay actions and logic in your games.", + "dependencies": { + "com.unity.cinemachine": "2.3.4" + }, + "keywords": [ + "Gameplay", + "Ingredients", + "Unity", + "Behaviour", + "State Machine", + "Editor", + "Streaming" + ], + "hideInEditor": false } \ No newline at end of file