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; | |
using System.Collections; | |
using System.Collections.Generic; | |
using System.Reflection; | |
public class EditorCoroutineRunner | |
{ | |
[MenuItem("Window/Lotte's Coroutine Runner: Demo")] |
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 Components.GameObjects; | |
using Components.Miscellaneous; | |
using Entitas; | |
using Entitas.Unity.VisualDebugging; | |
using EntitasHelpers; | |
using JetBrains.Annotations; | |
public sealed class CleanUpGameObjectSystem<TEntity> : ReactiveSystem<TEntity> where TEntity : class, IEntity, new() | |
{ |
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 UnityEngine; | |
using VRTK; | |
[RequireComponent(typeof(VRTK_InteractGrab))] | |
public class InteractableObjectGrabHook : MonoBehaviour | |
{ | |
[Tooltip("How long a complete move of the interactable object should take (in either direction).")] | |
public float Duration; |
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 Components.Miscellaneous; | |
using Entitas; | |
using EntitasHelpers; | |
using JetBrains.Annotations; | |
public sealed class DestroySystem<TEntity> : ReactiveSystem<TEntity> where TEntity : class, IEntity, new() | |
{ | |
private readonly Context<TEntity> _context; | |
private IMatcher<TEntity> _triggerMatcher; |
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; | |
using System.IO; | |
using UnityEngine; | |
public class AsyncBundleLoader : MonoBehaviour | |
{ | |
// Used for visual debugging as to not generate unnecessary allocations | |
public GameObject worldLight; | |
// Private fields to keep track of loaded objects |
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; | |
using System.Collections.Generic; | |
using UnityEngine; | |
#if UNITY_EDITOR | |
using UnityEditor; | |
#endif | |
public class CustomFramer : MonoBehaviour { | |
public float radius = 1f; |
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.IO; | |
public static class CustomInspectorCreator | |
{ | |
[MenuItem("Assets/Create/Custom Inspector", priority = 81)] | |
static void CreateInsptorEditorClass() | |
{ | |
foreach (var script in Selection.objects) |
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
/* C# code that sets up the mip colors texture: | |
s_MipColorsTexture = new Texture2D (32, 32, TextureFormat.RGBA32, true); | |
s_MipColorsTexture.hideFlags = HideFlags.HideAndDontSave; | |
Color[] colors = new Color[6]; | |
colors[0] = new Color (0.0f, 0.0f, 1.0f, 0.8f); | |
colors[1] = new Color (0.0f, 0.5f, 1.0f, 0.4f); | |
colors[2] = new Color (1.0f, 1.0f, 1.0f, 0.0f); // optimal level | |
colors[3] = new Color (1.0f, 0.7f, 0.0f, 0.2f); | |
colors[4] = new Color (1.0f, 0.3f, 0.0f, 0.6f); | |
colors[5] = new Color (1.0f, 0.0f, 0.0f, 0.8f); |
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
Systems createSystem () | |
{ | |
#if (UNITY_EDITOR) | |
return new DebugSystems () | |
#else | |
return new Systems() | |
#endif | |
// ---------------- Create Systems ---------------- // |