View Levels.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
const int | |
kPreLevelScenes = 2, // Number of scenes before the first level (splash, menu, etc.) | |
kPostLevelScenes = 0; // Number of scenes after last level (score, credits, whatever) | |
const string kLevelScorePrefix = "Score for level "; | |
// ... | |
void OnLevelBeat () | |
{ | |
if (Application.loadedLevel < Application.levelCount - kPostLevelScenes - 1) |
View BehaveExtensions.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 Behave.Runtime; | |
using Library = BLYourLibraryName; | |
using Tree = Behave.Runtime.Tree; | |
public interface IActionClass | |
{ | |
bool OnForward (Tree sender); | |
BehaveResult Init (Tree sender); |
View RenderGUIToTexture.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 System.Collections; | |
[RequireComponent (typeof (Renderer))] | |
public class RenderGUIToTexture : MonoBehaviour | |
{ | |
public RenderTexture texture; | |
public Texture2D background; | |
View GameManager.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 System.Collections; | |
public enum GameStatus | |
{ | |
Setup, | |
Initializing, | |
ReInitializing, | |
AwaitingMasterServer, |
View Player.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 System.Collections; | |
[RequireComponent (typeof (NetworkView))] | |
[RequireComponent (typeof (Rigidbody))] | |
[RequireComponent (typeof (AnimationController))] | |
public class Player : MonoBehaviour, System.IComparable | |
{ | |
public Transform graphicsPrefab; |
View Connection.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
public float GetCost (Agent agent) | |
{ | |
return (To.Position - From.Position).Magnitude * | |
Weight * | |
(customWeightHandler == null ? 1.0f : customWeightHandler (agent, this)); | |
} |
View MyAgent.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 System.Collections; | |
using Behave.Runtime; | |
using Tree = Behave.Runtime.Tree; | |
public class MyAgent : IAgent | |
{ | |
private Tree myTree; | |
View ExplicitProperty.txt
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
// This: | |
public Rigidbody target; | |
void FixedUpdate () | |
{ | |
target.AddForce (transform.forward * 1.0f); | |
} |
View MyStateMachine.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 System.Collections.Generic; | |
public class MyStateMachine : MonoBehaviour | |
{ | |
public delegate void StateHandlerDelegate (); | |
public enum MyStateType |
View DelayedInitialization.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
private static int newID = 0; | |
private int id; | |
private bool initialized = false; | |
IEnumerator Start () | |
{ | |
id = newID++; | |
for (int i = 0; i < id; i++) | |
{ |
OlderNewer