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.Generic; | |
| using System.Linq; | |
| using Entitas; | |
| public sealed class DestroySystem : ISetPools, IGroupObserverSystem | |
| { | |
| public GroupObserver groupObserver | |
| { | |
| get |
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 R 1.1 | |
| float wave(in vec2 uv, in vec2 center, in float radius) { | |
| vec2 s = uv - center; | |
| float r = length(s); | |
| float h = sin(r * 50.0 + float(iFrame) / 10.0) * 0.1 * (radius - r); | |
| if(r >= radius) | |
| return 0.0; | |
| else | |
| return h; |
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
| Systems createSystem () | |
| { | |
| #if (UNITY_EDITOR) | |
| return new DebugSystems () | |
| #else | |
| return new Systems() | |
| #endif | |
| // ---------------- Create Systems ---------------- // |
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
| /* 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 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; | |
| 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 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 System.Collections.Generic; | |
| using UnityEngine; | |
| #if UNITY_EDITOR | |
| using UnityEditor; | |
| #endif | |
| public class CustomFramer : MonoBehaviour { | |
| public float radius = 1f; |
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 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 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.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 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 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; |