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 Melter : MonoBehaviour { | |
| public Transform heatPoint; | |
| public bool restoreColor=false; | |
| void Start () { | |
| var mesh = GetComponent<MeshFilter>().mesh; |
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
| foreach (Transform child in transform) | |
| { | |
| Debug.Log(child.name); | |
| } |
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
| var stopwatch = new System.Diagnostics.Stopwatch(); | |
| stopwatch.Start(); | |
| // your function here.. | |
| stopwatch.Stop(); | |
| //Debug.Log("Timer: " + stopwatch.Elapsed); | |
| Debug.Log("Timer: " + stopwatch.ElapsedMilliseconds); | |
| stopwatch.Reset(); |
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 UnityEngine.UI; | |
| public class GetSliderValue : MonoBehaviour { | |
| public YourScript yourScript; | |
| void Awake () | |
| { |
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 Test : MonoBehaviour { | |
| public LayerMask targetLayer; | |
| Vector3 prevPos; | |
| void Start () { |
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 UnityEditor; | |
| public class ClearPrefs : MonoBehaviour { | |
| // otherwise adjusting player settings resolution wont do anything.. | |
| // http://answers.unity3d.com/questions/516517/why-doesnt-standalone-build-resolution-settings-af.html | |
| [MenuItem("Edit/Reset Playerprefs")] |
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; | |
| // modified from : http://docs.unity3d.com/ScriptReference/Mesh-uv.html | |
| public class PlanarUVMap : MonoBehaviour { | |
| public bool flipX=false; | |
| void Start() |
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
| float Remap(float source, float sourceFrom, float sourceTo, float targetFrom, float targetTo) | |
| { | |
| return targetFrom + (source-sourceFrom)*(targetTo-targetFrom)/(sourceTo-sourceFrom); | |
| } |
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; | |
| // http://answers.unity3d.com/questions/816861/46-ui-image-is-capturing-clicks-how-to-prevent.html | |
| public class UIIgnoreRaycast : MonoBehaviour, ICanvasRaycastFilter | |
| { | |
| public bool IsRaycastLocationValid(Vector2 screenPoint, Camera eventCamera) | |
| { | |
| return false; | |
| } |
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
| // ==UserScript== | |
| // @name AssetStoreBuddy | |
| // @namespace unitycoder.com | |
| // @include https://www.assetstore.unity3d.com/en/#!/search/* | |
| // @version 1 | |
| // @grant none | |
| // ==/UserScript== | |
| // currently need to press F5 to run these |