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; | |
public class FrameCounter : MonoBehaviour | |
{ | |
private Text _text; | |
void Awake() | |
{ | |
_text = GetComponent<Text>(); | |
} |
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
/// <summary> | |
/// Provides support for lazy initialization. | |
/// </summary> | |
/// <typeparam name="T">Specifies the type of object that is being lazily initialized.</typeparam> | |
public sealed class Lazy<T> | |
{ | |
private readonly object padlock = new object(); | |
private readonly Func<T> createValue; | |
private bool isValueCreated; | |
private T 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 UnityEngine; | |
using PaintCraft.Controllers; | |
using UnityEngine.Assertions; | |
using UnityEngine.UI; | |
[RequireComponent(typeof(RectTransform))] | |
public class RectToCanvasPosition : MonoBehaviour { | |
public ScreenCameraController ScreenCameraController; | |
RectTransform _rt; |
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.Rendering; | |
using UnityEngine.UI; | |
public class InvertedMaskImage : Image { | |
public override Material materialForRendering | |
{ | |
get | |
{ | |
Material result = base.materialForRendering; |
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 PaintCraft.Canvas.Configs; | |
using System.IO; | |
namespace PaintCraft.Canvas.Configs{ | |
[CreateAssetMenu(menuName = "PaintCraft/StreamingColoringPageConfig")] | |
public class StreamingColoringPageConfig : AdvancedPageConfig | |
{ |
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 UnityEngine; | |
using UnityEngine.Purchasing; | |
using UnityEngine.Purchasing.Security; | |
// Deriving the Purchaser class from IStoreListener enables it to receive messages from Unity Purchasing. | |
public class Purchaser : MonoBehaviour, IStoreListener | |
{ | |
private static IStoreController m_StoreController; // The Unity Purchasing system. | |
private static IExtensionProvider m_StoreExtensionProvider; // The store-specific Purchasing subsystems. |
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.IO; | |
using UnityEditor; | |
using UnityEngine; | |
public class SyncTranslations | |
{ | |
private static string _destFile = "Assets/Resources/Translations.txt"; | |
private static string _url = | |
"https://docs.google.com/spreadsheets/d/xxxx/export?format=tsv&id=xxxx&gid=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
// Unity built-in shader source. Copyright (c) 2016 Unity Technologies. MIT license (see license.txt) | |
#ifndef UNITY_CG_INCLUDED | |
#define UNITY_CG_INCLUDED | |
#define UNITY_PI 3.14159265359f | |
#define UNITY_TWO_PI 6.28318530718f | |
#define UNITY_FOUR_PI 12.56637061436f | |
#define UNITY_INV_PI 0.31830988618f | |
#define UNITY_INV_TWO_PI 0.15915494309f |
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; | |
public static class ArrayUtil { | |
public static int[] GetSequenceArray(int length) | |
{ | |
int[] result = new int[length]; | |
for (int i = 0; i < length; i++) | |
{ | |
result[i] = i; |
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.Diagnostics; | |
public class CoroutineWaiter : IEnumerator { | |
public bool IsFinished { get; private set; } | |
private readonly Action _onFinish; | |
readonly Stack<IEnumerator> _stack= new Stack<IEnumerator>(); | |