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; | |
| // Render the screen in lower resolution | |
| [ExecuteInEditMode] | |
| [RequireComponent(typeof(Camera))] | |
| public class ResoScaler : MonoBehaviour | |
| { | |
| [Range(1, 8)] | |
| public float scale = 1; |
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.Diagnostics; | |
| using Debug = UnityEngine.Debug; | |
| public static class ConditionalDebug | |
| { | |
| [Conditional("ENABLE_CONDITIONAL_DEBUG")] | |
| public static void Log(object message) | |
| { | |
| Debug.Log(message); | |
| } |
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 class AnimationCompleteSubscription: IDisposable | |
| { | |
| private readonly SkeletonAnimation _skeletonAnimation; | |
| private readonly Action _eventCallback; | |
| public AnimationCompleteSubscription(SkeletonAnimation skeletonAnimation, Action eventCallback) | |
| { | |
| _skeletonAnimation = skeletonAnimation; | |
| _eventCallback = eventCallback; | |
| _skeletonAnimation.AnimationState.Complete += AnimationEventHappened; |
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 class AnimationEventSubscription: IDisposable | |
| { | |
| private readonly SkeletonAnimation _skeletonAnimation; | |
| private readonly Action _eventCallback; | |
| private readonly string _eventName; | |
| public AnimationEventSubscription(SkeletonAnimation skeletonAnimation, Action eventCallback, string eventName) | |
| { | |
| _skeletonAnimation = skeletonAnimation; | |
| _eventCallback = eventCallback; |
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 static T GetComponentUnderCoursor<T>(this Camera inputCamera) where T : MonoBehaviour | |
| { | |
| RaycastHit hit; | |
| return Physics.Raycast(inputCamera.ScreenPointToRay(Input.mousePosition), out hit) | |
| ? hit.transform.GetComponent<T>() | |
| : null; | |
| } |
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
| /** | |
| * Adds a custom menu to the active spreadsheet, containing a single menu item | |
| * for invoking the exportJSON() function specified above. | |
| * The onOpen() function, when defined, is automatically invoked whenever the | |
| * spreadsheet is opened. | |
| * For more information on using the Spreadsheet API, see | |
| * https://developers.google.com/apps-script/service_spreadsheet | |
| */ | |
| function onOpen() { | |
| var sheet = SpreadsheetApp.getActiveSpreadsheet(); |