This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| using UnityEditor; | |
| using UnityEngine; | |
| using UnityEditor.SceneManagement; | |
| // inspired by https://answers.unity.com/questions/205742/adding-scene-to-build.html?_ga=2.184209894.1575122923.1603913761-831749454.1600446627 | |
| public static class AddSceneToBuildSettingsShortcut | |
| { | |
| [MenuItem("Game/Add scene as last build scene &a")] | |
| private static void AddAsLastBuildScene() |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| using System.Collections; | |
| using UnityEngine; | |
| // Taken from: https://stackoverflow.com/questions/39380901/shake-an-object-back-and-forth-with-easing-at-the-end | |
| public class ObjectShaker : MonoBehaviour | |
| { | |
| public GameObject GameObjectToShake; | |
| bool shaking = false; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| using UnityEditor; | |
| using UnityEngine; | |
| // Taken from: https://answers.unity.com/questions/118306/grouping-objects-in-the-hierarchy.html | |
| public static class GroupCommand | |
| { | |
| [MenuItem("GameObject/Group Selected %g")] | |
| private static void GroupSelected() | |
| { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| using UnityEngine; | |
| public class RandomiseInsideCollider : MonoBehaviour | |
| { | |
| public Collider2D AreaPolygonCollider; | |
| Bounds Bounds; | |
| Vector3 BoundX1, BoundX2, BoundY1, BoundY2; | |
| Vector3 randomPos; | |
| public Transform go; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #if UNITY_EDITOR | |
| using UnityEditor; | |
| using UnityEditor.SceneManagement; | |
| // TODO: if the level is unchecked in build settings, the loop starts over | |
| public class ShortcutLevelLoader | |
| { | |
| [MenuItem("Level loader/Load previous level &LEFT")] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // Adapted from https://docs.unity3d.com/ScriptReference/PrefabUtility.html | |
| using UnityEngine; | |
| using UnityEditor; | |
| public class MultiprefabCreator | |
| { | |
| // Creates a new menu item 'Examples > Create Prefab' in the main menu. | |
| [MenuItem("Window/Create Prefab")] | |
| static void CreatePrefab() |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| using UnityEngine; | |
| public class ReverseAnimationLegacy : MonoBehaviour | |
| { | |
| Animation Animation; | |
| void Start() | |
| { | |
| Animation = GetComponent<Animation>(); | |
| Animation["walk"].speed = -0.25f; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| using UnityEngine; | |
| using UnityEditor; | |
| /// Taken from: https://gist.github.com/SiarheiPilat/05463e64d4662860c6a799bb23d9aec8 | |
| /// Forked from: https://gist.github.com/unity3dcollege/c1efea3f87d3775bee3e010e9c6d7648 | |
| /// Author: Siarhei Pilat (Suasor AB) | |
| /// License: MIT | |
| public class ReplaceWithPrefab : EditorWindow | |
| { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| using UnityEditor; | |
| using UnityEngine; | |
| public class ScriptableObjectMassCreator : EditorWindow | |
| { | |
| public string str; | |
| public bool FromText; | |
| public bool SplitComma; | |
| [MenuItem("Window/Scriptable Object Mass Creator")] |