This file contains 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 <Foundation/Foundation.h> | |
#ifdef __cplusplus | |
extern "C" { | |
#endif | |
static UIActivityIndicatorView* spinner = nil; | |
void startSpinner() { | |
if(spinner == nil) { | |
spinner = [[UIActivityIndicatorView alloc] initWithFrame:CGRectMake(0, 0, 100, 80)]; | |
} |
This file contains 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
try | |
cc.p = cc.p || (x, y)-> | |
return {x:x, y:y} | |
cc.c4b = cc.c4 || (r, g, b, o)-> | |
return {r: r, g: g, b: b, a: o} | |
cc.c3 = cc.c3 || (r, g, b)-> | |
return {r: r, g: g, b: b} | |
cc.BLACK = cc.c3(0,0,0) |
This file contains 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; | |
public class SceneOverlay : EditorWindow | |
{ | |
[MenuItem ("Window/Scene Overlay")] | |
static void Init () | |
{ |
This file contains 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; | |
#if UNITY_EDITOR | |
using UnityEditor; | |
#endif | |
using System.Collections; | |
public class SceneMerger : MonoBehaviour | |
{ | |
public string[] mergeScenes; | |
private static bool semaphore ; |
This file contains 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; | |
public class SceneSaveHook : AssetModificationProcessor | |
{ | |
static string[] OnWillSaveAssets (string[] paths) | |
{ | |
foreach (string path in paths) { | |
if (path.EndsWith (".unity")) { |
This file contains 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 SwipeManager : MonoBehaviour | |
{ | |
private float startTime; | |
private Vector2 startPos; | |
private bool couldBeSwipe; | |
public float comfortZone; | |
public float minSwipeDist; |
This file contains 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 Ring : MonoBehaviour | |
{ | |
private Transform _myTransform ; | |
void Awake () | |
{ | |
_myTransform = transform; |
This file contains 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 static class CSRect | |
{ | |
public static Rect OffsetXRect(this Rect rect, float x) | |
{ | |
Rect newRect = rect; | |
newRect.x = rect.x + x; | |
return newRect; |
This file contains 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 class SingletonMonoBehaviour<T> : MonoBehaviour where T : MonoBehaviour | |
{ | |
private static T instance; | |
public static T Instance { | |
get { | |
if (instance == null) { | |
instance = (T)FindObjectOfType (typeof(T)); |
This file contains 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 abstract class SingletonMonoBehaviour : MonoBehaviour | |
{ | |
// name this after the prefab in the Resources folder. | |
public const string resourceName = "Singletons"; | |
// this will be the object containing all components which are singletons. | |
static GameObject singletonsObject = null; |