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; | |
| using System.Collections; | |
| using System.Collections.Generic; | |
| using UnityEngine; | |
| using UnityEngine.Profiling; | |
| public class KdTree<T> : IEnumerable<T>, IEnumerable where T : Component | |
| { | |
| protected KdNode _root; | |
| protected KdNode _last; |
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 !DISABLESTEAMWORKS | |
| // Unity 32bit Mono on Windows crashes with ThisCall/Cdecl for some reason, StdCall without the 'this' ptr is the only thing that works..? | |
| #if (UNITY_EDITOR_WIN && !UNITY_EDITOR_64) || (!UNITY_EDITOR && UNITY_STANDALONE_WIN && !UNITY_64) | |
| #define STDCALL | |
| #elif STEAMWORKS_WIN | |
| #define THISCALL | |
| #endif | |
| namespace Steamworks |
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 !DISABLESTEAMWORKS | |
| // Unity 32bit Mono on Windows crashes with ThisCall/Cdecl for some reason, StdCall without the 'this' ptr is the only thing that works..? | |
| #if (UNITY_EDITOR_WIN && !UNITY_EDITOR_64) || (!UNITY_EDITOR && UNITY_STANDALONE_WIN && !UNITY_64) | |
| #define STDCALL | |
| #elif STEAMWORKS_WIN | |
| #define THISCALL | |
| #endif | |
| namespace Steamworks |
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 DistanceJoint3D : MonoBehaviour { | |
| public Transform ConnectedRigidbody; | |
| public bool DetermineDistanceOnStart = true; | |
| public float Distance; | |
| public float Spring = 0.1f; | |
| public float Damper = 5f; |
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
| ## Photon Methods | |
| **public class Blank : Photon.PunBehaviour** | |
| instead of mono behavior, use this to receive photon callbacks in your script. | |
| **public override void OnLeftRoom()** | |
| An example of overriding a punbehavior callback |
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; | |
| #if UNITY_EDITOR || DEBUG | |
| using System; | |
| using UnityEngine.SceneManagement; | |
| #endif | |
| public class SingletonMonoBehaviour<T> : MonoBehaviour where T : MonoBehaviour { | |
| private static T _instance = null; | |
| public static T Instance { |
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
| //#define TMP_DEBUG_MODE | |
| using System; | |
| using System.Collections; | |
| using System.Collections.Generic; | |
| using System.Text; | |
| using System.Text.RegularExpressions; | |
| using UnityEngine; | |
| using UnityEngine.UI; | |
| using UnityEngine.Events; |
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
| Shader "Hidden/ComputeOcclusion" | |
| { | |
| Properties | |
| { | |
| _MainTex ("", 2D) = "white" {} | |
| } | |
| SubShader | |
| { | |
| Pass | |
| { |
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 System.Collections; | |
| public class CallAfterDelay : MonoBehaviour | |
| { | |
| float delay; | |
| System.Action action; | |
| // Will never call this frame, always the next frame at the earliest | |
| public static CallAfterDelay Create( float delay, System.Action action) |
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
| // Example Scriptable Object. Instance must be placed in Resources folder and have the same name as the class, type of generic parameter must be your class. | |
| using UnityEngine; | |
| [CreateAssetMenu(fileName = "MySingletonSO")] | |
| public class MySingletonSO : SingletonScriptableObject<MySingletonSO> | |
| { | |
| // Here goes your data. This class can be called by the static Instance property, which will automatically locate the instance in the Resources folder. | |
| } |