This file contains 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
// Taken from: https://discussions.unity.com/t/inspector-field-for-scene-asset/40763 | |
using UnityEngine; | |
#if UNITY_EDITOR | |
using UnityEditor; | |
#endif | |
[System.Serializable] | |
public class SceneField |
This file contains 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
public static T[] Shuffle<T>(T[] array) | |
{ | |
T[] shuffledArray = new T[array.Length]; | |
Array.Copy(array, shuffledArray, array.Length); | |
System.Random random = new System.Random(); | |
for (int i = shuffledArray.Length - 1; i > 0; i--) | |
{ | |
int j = random.Next(0, i + 1); | |
T temp = shuffledArray[i]; | |
shuffledArray[i] = shuffledArray[j]; |
This file contains 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 Firebase; | |
using Firebase.Analytics; | |
public class FirebaseTest : MonoBehaviour | |
{ | |
void Start() | |
{ | |
FirebaseApp.CheckAndFixDependenciesAsync().ContinueWith(task => { FirebaseAnalytics.SetAnalyticsCollectionEnabled(true); }); | |
} |
This file contains 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.Generic; | |
using System.IO; | |
using UnityEditor; | |
using UnityEditorInternal; | |
using UnityEngine; | |
// NOTE: This DOES work, but need to do it twice?? | |
// This is only useful for spritesheets that need to be automatically sliced (Sprite Editor > Slice > Automatic) | |
public class AutoSpriteSlicer |
This file contains 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; | |
using System.Collections.Generic; | |
using System.IO; | |
using System.Reflection; | |
using UnityEditor; | |
using UnityEngine; | |
namespace MultiScreenshotCaptureNamespace | |
{ | |
internal static class ReflectionExtensions |
This file contains 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.Build; | |
using UnityEditor.Build.Reporting; | |
using UnityEditor; | |
public class IncrementBuildNumber : IPreprocessBuildWithReport { | |
public int callbackOrder { get { return 0; } } // Part of the IPreprocessBuildWithReport interface | |
public void OnPreprocessBuild(BuildReport report) { | |
if (report.summary.platform == BuildTarget.iOS) { |
This file contains 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 System.Collections.Generic; | |
using System.Text.RegularExpressions; | |
// original: https://github.com/tikonen/blog/blob/master/csvreader/CSVReader.cs | |
// IMPORTANT: CSV FILE MUST BE IN THE RESOURCES FOLDER | |
// USAGE EXAMPLE FOR A 3 COLUMN CSV FILE: | |
// | |
// [ContextMenu("test csv data")] |
This file contains 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 BuildToDesktop | |
{ | |
[MenuItem("File/Build to Desktop")] | |
public static void BuildGame() | |
{ | |
string dateTime = System.DateTime.Now.ToString("yyyy-MM-dd-HH-mm-ss"); | |
string path = System.Environment.GetFolderPath(System.Environment.SpecialFolder.Desktop) + "/Build_" + dateTime; |
This file contains 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.Generic; | |
using UnityEngine; | |
using NodeCanvas.DialogueTrees; | |
using TMPro; | |
using UnityEngine.UI; | |
using NodeCanvas.Framework; | |
public class NcSimpleDialogueUi : MonoBehaviour | |
{ | |
public TextMeshProUGUI NarrationText; |
This file contains 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; | |
using System; | |
namespace Suasor | |
{ | |
public class FindCustomScriptsEditor : EditorWindow | |
{ | |
Vector2 scrollPosition; | |
public string[] Strings = new string[4] {"BreakableHelper", "ObjectColor", "StickerController", "Obi" }; // REPLACE THIS WITH LIST EDITABLE |
NewerOlder