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
// GravityObject.cs | |
using UnityEngine; | |
using System.Collections; | |
[RequireComponent (typeof (Rigidbody))] | |
public class GravityObject : MonoBehaviour | |
{ | |
public float gravityModifier = 1.0f; | |
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
const string controlName = "My text field"; | |
string myString = "Text"; | |
void OnGUI () | |
{ | |
EventType handledEventType = Event.current.type; | |
GUI.SetNextControlName (controlName); | |
myString = GUILayout.TextField (myString); |
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
///////////////////////////////////////////////////////////////// | |
// MyProxy.cs - the C# source file in your assets | |
///////////////////////////////////////////////////////////////// | |
using UnityEngine; | |
using UnityEditor; | |
using MyAssemblyNamespace; | |
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 Tile tilePrefabs[]; | |
public int width = 1, height = 1; | |
public Vector2 tileSize = new Vector2 (1.0f, 1.0f); | |
Tile tiles[]; | |
void Start () | |
{ | |
tiles = new Tile[width * height]; |
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; | |
enum CameraIdentity | |
{ | |
None, | |
One, | |
Two, | |
Three, |
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 StartPanicAction | |
{ | |
get | |
{ | |
panic = true; | |
return BehaveResult.Success; | |
} | |
} | |
public BehaveResult PatrolAction |
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
void InvokeDelayed (Action action, float seconds) | |
{ | |
StartCoroutine (DoInvokeDelayed (action, seconds)); | |
} | |
IEnumerator DoInvokeDelayed (Action action, float seconds) | |
{ | |
yield return new WaitForSeconds (seconds); | |
action (); |
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 (BoxCollider))] | |
public class ContainerGravity : MonoBehaviour | |
{ | |
public float strength = 10.0f; | |
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
target.RotateAround (target.position, target.right, addedRotation); | |
bool lookingUp = Vector3.Angle (target.forward, Vector3.up) < Vector3.Angle (target.forward, Vector3.up * -1.0f); | |
float angle = Vector3.Angle (target.forward, Vector3.Cross (target.right, Vector3.up)); | |
if (angle > forwardAngleClamp) | |
{ | |
target.RotateAround (target.position, target.right, lookingUp ? angle - forwardAngleClamp : forwardAngleClamp - angle); | |
} |
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.Generic; | |
public class AnimationStateInspector : EditorWindow | |
{ | |
Dictionary<int, List<AnimationState>> layers = null; | |