Created
May 30, 2011 09:57
-
-
Save AngryAnt/998665 to your computer and use it in GitHub Desktop.
Tree tick frequency.
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; | |
IEnumerator Start () | |
{ | |
myTree = BLMyLibrary.InstantiateTree (BLMyLibrary.TreeType.MyCollection_MyTree, this); | |
while (Application.isPlaying) | |
{ | |
yield return new WaitForSeconds (1.0f / myTree.Frequency); | |
myTree.Tick (); | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment