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; | |
[RequireComponent (typeof (Collider))] | |
[RequireComponent (typeof (NetworkView))] | |
public abstract class Pickup : MonoBehaviour | |
{ | |
bool available; | |
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
public BehaveResult TickShuffleAction (Tree sender) | |
{ | |
return m_ShuffleTree.Tick (); | |
} | |
public void ResetShuffleAction (Tree sender) | |
{ | |
m_ShuffleTree.Reset (); | |
} |
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; | |
/* | |
Runtime use: | |
To be available, AirPlay needs to be switched on for the device either via a native AirPlay UI component or | |
via the global AirPlay mirroring setting. Your options are: | |
A: Modify your Xcode project to layer a native AirPlay Cocoa control somewhere over your Unity content. |
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; | |
[InitializeOnLoad] | |
public class PackageInfo | |
{ | |
const string kTitle = "Notice", kMessage = "This package is the prettiest of them all.", kButton = "Ok", kPackageIdentifier = "AwesomePackage"; | |
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
for (int i = 0; i < list.Count;) | |
{ | |
GUILayout.Label (list[i].ToString ()); | |
if (GUILayout.Button ("Delete")) | |
{ | |
list.RemoveAt (i); | |
} | |
else | |
{ | |
i++; |
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
mcs -target:library -out:MyAssembly.dll -r:/Applications/Unity/Unity.app/Contents/Frameworks/UnityEngine.dll MyAssembly.cs |
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; | |
using System.Collections.Generic; | |
using System.Reflection; | |
public class CopyInspector : Editor | |
{ | |
static System.Type m_OriginalType; | |
static Dictionary <PropertyInfo, object> m_Values; |
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 DataObject : GUIDraggableObject | |
// This class just has the capability of being dragged in GUI - it could be any type of generic data class | |
{ | |
private string m_Name; | |
private int m_Value; | |
public DataObject (string name, int value, Vector2 position) : base (position) |
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.Reflection; | |
public class Utilities | |
{ | |
/* ... */ | |
static void LogGameObject( GameObject gameObject, bool children ) | |
{ | |
Component[] components = gameObject.GetComponents( typeof( Component ) ); |