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; | |
| [ExecuteInEditMode] | |
| public class FGScreenScaler : MonoBehaviour | |
| { | |
| //when desiredHeight is 1080, this acts as if you had the camera set to orthographic with size at 540 (half of 1080) | |
| //except this works with a perspective camera |
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 UnityEngine.UI; | |
| using System.Collections.Generic; | |
| [RequireComponent(typeof(CanvasRenderer))] | |
| public class SimpleGraphic : MaskableGraphic //could extend Graphic if you don't need it maskable | |
| { | |
| public Texture texture; | |
| public override Texture mainTexture |
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.Collections; | |
| using System.IO; | |
| using System.Text; | |
| public class ObjExporterScript | |
| { | |
| private static int StartIndex = 0; | |
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; | |
| public class RXStockpile<T> | |
| { | |
| //make a stockpile of equal value | |
| static public RXStockpile<T> CreateEqual(params T[] things) | |
| { | |
| RXStockpile<T> stockpile = new RXStockpile<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 UnityEngine; | |
| using System.Collections; | |
| using System; | |
| [ExecuteInEditMode] | |
| public class ScreenScaler : MonoBehaviour | |
| { | |
| //when desiredHeight is 1080, this acts as if you had the camera set to orthographic with size at 540 (half of 1080) | |
| //except this works with a perspective camera | |
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; | |
| using System.Collections.Generic; | |
| [Serializable] | |
| public class StringDict : Dictionary<string,string>, ISerializationCallbackReceiver | |
| { | |
| [SerializeField] List<String> keys = new List<string>(); | |
| [SerializeField] List<String> vals = new List<string>(); |
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.UI; | |
| using System.Collections.Generic; | |
| using System; | |
| using UnityEngine; | |
| public class VertBend : BaseMeshEffect | |
| { | |
| public override void ModifyMesh(VertexHelper vh) | |
| { | |
| if(!IsActive()) return; |
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
| public void Update() | |
| { | |
| if(Time.time % 5f < Time.deltaTime) | |
| { | |
| Debug.Log("go!"); | |
| } | |
| } |
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(watchThis != null) | |
| { | |
| var valueStore = watchThis.GetComponent<ValueStore>(); | |
| var theField = valueStore.GetType().GetField(field); | |
| if(theField != null) | |
| { | |
| int prevValue = (int)theField.GetValue(valueStore); | |
| theField.SetValue(valueStore,prevValue + value); | |
| } |
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 System.Linq; | |
| using UnityEngine; | |
| [CreateAssetMenu] | |
| public class SpriteSource : ScriptableObject | |
| { | |
| public Sprite notFoundSprite; |