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; | |
using System.IO; | |
class NewSkyBoxGenerator : MonoBehaviour | |
{ | |
static int faceSize = 2046; | |
static string directory = "Assets/Skyboxes"; | |
static string skyboxShader = "RenderFX/Skybox"; |
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.Generic; | |
using UnityEngine; | |
using UnityEngine.UI; | |
using UnityEditor; | |
using TMPro; | |
class ChangeTextToTextMeshPro : EditorWindow | |
{ |
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; | |
// attach this to LayoutElement, and it will maintain its aspect. | |
// Don't use too many of these custom UI scripts (especially nested), since each one lags 1 frame behind, | |
// when the parent is resized. Also might introduce rect-transform instability, but a couple is ok. | |
// | |
// Make sure your LayoutGroup (in parent) has Child controls size ticked, else | |
// we won't be able to adjust our size! |
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; | |
[ExecuteInEditMode] | |
[AddComponentMenu("Layout/Auto Grid Layout Group", 152)] | |
public class AutoGridLayout : GridLayoutGroup | |
{ | |
[SerializeField] | |
private bool m_IsColumn; | |
[SerializeField] |
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.Purchasing; | |
using UnityEngine.Purchasing.Security; | |
public class IAPManager : MonoBehaviour, IStoreListener | |
{ | |
IStoreController controller; | |
IExtensionProvider extensions; | |
const string gameID = "com.YourCompany.YourGameID."; |
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 System.IO; | |
using System.Linq; | |
using UnityEngine; | |
using Unity.Collections; | |
using System.Diagnostics; | |
#if UNITY_2018_3_OR_NEWER | |
using UnityEngine.Rendering; | |
#else |
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 System.Diagnostics; | |
using UnityEngine; | |
public class RayTraceSpeed : MonoBehaviour | |
{ | |
public TMPro.TextMeshProUGUI m_UIPerfText; | |
Stopwatch m_Stopwatch = new Stopwatch(); | |
int m_UpdateCounter; |
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
#import <AVFoundation/AVFoundation.h> | |
extern "C" { | |
void _EnableFlashlight(bool enable) { | |
AVCaptureDevice *device = [AVCaptureDevice defaultDeviceWithMediaType:AVMediaTypeVideo]; | |
if ([device hasTorch]) { | |
[device lockForConfiguration:nil]; | |
[device setTorchMode:enable ? AVCaptureTorchModeOn : AVCaptureTorchModeOff]; | |
[device unlockForConfiguration]; |