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; | |
| public static class ArrayHelper | |
| { | |
| public static T AddArrayElement<T>(ref T[] array) where T : new() | |
| { | |
| return ArrayHelper.AddArrayElement<T>(ref array, (default(T) == null) ? Activator.CreateInstance<T>() : default(T)); | |
| } | |
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; | |
| [ExecuteInEditMode] | |
| public class AlphaAnimator : MonoBehaviour | |
| { | |
| [Range(0f, 1f), SerializeField] | |
| private float m_alpha; | |
| private Renderer m_renderer; | |
| private MaterialPropertyBlock m_propBlock; |
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; | |
| public class Logger { | |
| private static string CUSTOM_MESSAGE = "CUSTOM LOGS: "; | |
| private static bool PrintLog() | |
| { | |
| return true; | |
| } |
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 this for Text Demonstration | |
| using UnityEngine.UI; | |
| public class QT_Trigger : MonoBehaviour { | |
| // We could probably gut the Done State but I use it for my purpose. | |
| public enum QTState { Ready, Delay, Ongoing, Done }; | |
| public QTState qtState = QTState.Ready; | |
| // an enum for a possible response! |
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 WebSocketSharp; | |
| using System.Collections; | |
| public class SocketClient : MonoBehaviour { | |
| // Public Variables | |
| public string ConnectionString = "ws://echo.websocket.org"; | |
| public string Message = "Hello World!"; |
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
| // Converted to C#, originally from https://girlscancode.wordpress.com/2015/03/02/unity3d-flipping-a-texture/ | |
| Texture2D FlipText(Texture2D original) | |
| { | |
| // We create a new texture so we don't change the old one! | |
| Texture2D flip = new Texture2D(original.width,original.height); | |
| // These for loops are for running through each individual pixel and then replacing them in the new texture. | |
| for(int i=0; i < flip.width; i++) { | |
| for(int j=0; j < flip.height; j++) { | |
| flip.SetPixel(flip.width-i-1, j, original.GetPixel(i,j)); |
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 "Custom/Curved" { | |
| Properties { | |
| _MainTex ("Base (RGB)", 2D) = "white" {} | |
| _QOffset ("Offset", Vector) = (0,0,0,0) | |
| _Dist ("Distance", Float) = 100.0 | |
| } | |
| SubShader { | |
| Tags { "RenderType"="Opaque" } | |
| 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; | |
| using PowerUI; | |
| using NodeCanvas.DialogueTrees; | |
| public class DialoguePowerUI : UnityEngine.MonoBehaviour { | |
| public TextAsset HtmlFile; | |
| #if UNITY_EDITOR | |
| private LiveHtml Reloader; |
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
| // Sean Loper | |
| // 2015 | |
| // Also supports complete controller input! | |
| // Pokemon Styled Movement Controller for Unity of course! | |
| using UnityEngine; | |
| using System.Collections; | |
| public class MoveController : MonoBehaviour { |
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; | |
| using System.Collections.Generic; | |
| using PowerUI; | |
| /// <summary> | |
| /// This is the default PowerUIManager with a much needed design resolution. | |
| /// </summary> | |
| public class GUIManager : MonoBehaviour { | |