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
using UnityEngine; | |
using UnityEditor; | |
public class InternalEditorWindowsTracker : MonoBehaviour | |
{ | |
/// <summary> | |
/// Get all currently open editor windows including default Unity windows, custom editors and windows that are tabbed. | |
/// Found here: https://answers.unity.com/questions/1237463/how-do-i-get-a-reference-to-the-default-editor-win.html?_ga=2.133529742.1822843399.1574452927-44739247.1572947128 | |
/// </summary> | |
public static EditorWindow[] GetAllOpenEditorWindows() |
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 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 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
#if UNITY_IOS | |
using UnityEngine; | |
using UnityEditor.Build; | |
using UnityEditor.Build.Reporting; | |
using UnityEditor; | |
using UnityEditor.iOS.Xcode; | |
using System.IO; | |
public class ExcemptFromEncryption : IPostprocessBuildWithReport // Will execute after XCode project is built |
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
#!/bin/sh | |
# new pre commit | |
# get bundle version | |
bundle_ver=`cat ./ProjectSettings/ProjectSettings.asset | grep bundleVersion | cut -d ' ' -f 4` | |
# explanation: | |
# cat - concatenate the content of multiple files | |
# cat [option] [file] | |
# cut command is a fast way to extract parts of lines of text files |
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) { |
NewerOlder