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
#!/bin/usr/perl | |
use strict; | |
use File::Basename; | |
chdir (File::Spec->rel2abs (dirname($0)."/..")); # Modify for location of perl script | |
my $monoPath = "External/Mono/builds/monodistribution"; | |
my @sourceDirs = ( | |
"Path/To/Source/*.cs", | |
"Path/To/More/Source/*.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; | |
public class InteractionExample : MonoBehaviour | |
{ | |
public string interactionKey = "i"; | |
public float interactionRadius = 2.0f, interactionViewCone = 60.0f; | |
void Update () |
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 Hover : MonoBehaviour | |
{ | |
public float maxDistance, maxForce; | |
private Vector3 forceVector; | |
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
// Given: float width, float height, float xSpacing, float ySpacing, Vector3 gridStart | |
Waypoint[] points = new Waypoint[width * height]; | |
for (int y = 0; y < height; y++) | |
{ | |
for (int x = 0; x < width; x++) | |
{ | |
points[y * width + x] = new GameObject (string.Format ("Grid-{0}-{1}", x, y), typeof (Waypoint)).GetComponent<Waypoint> (); | |
points[y * width + x].transform.position = gridStart + Vector3.z * ySpacing + Vector3.x * xSpacing; |
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
// Given: Vector2 point, float radius, inside valid GUI context | |
if (new Vector2 (Event.current.mousePosition - point).magnitude < radius) | |
{ | |
GUILayout.Label ("Inside"); | |
} | |
else | |
{ | |
GUILayout.Label ("Outside"); | |
} |
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 OnGUI () | |
{ | |
bool enabled = GUI.enabled; | |
GUI.enabled = enabled && Application.loadedLevel > 0; | |
if (GUILayout.Button ("Previous")) | |
{ | |
Application.LoadLevel (Application.loadedLevel - 1); | |
} | |
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 DistancePoints : MonoBehaviour | |
{ | |
public float pointsPerUnit = 1.0f; | |
private Vector3 lastPosition; |
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
private Dictionary<string, int> activeRepeats = new Dictionary<string, float> (); | |
private Dictionary<string, float> activeTimers = new Dictionary<string, float> (); | |
// The repeat decorator works more or less like a for loop // | |
public BehaveResult InitRepeatDecorator (Tree sender, string name, float repeats, IAgent agent, object data) |
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 delegate void JSCallback (string value); | |
public class WebsiteCommunication : MonoBehaviour | |
{ | |
public TextAsset stringRequest; |
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 OnPlayerDisconnected (NetworkPlayer player) | |
{ | |
Network.RemoveRPCs (player); | |
Network.DestroyPlayerObjects (player); | |
} |