sample scenes

This commit is contained in:
2015-07-12 19:08:49 +06:00
parent 3415970378
commit cd145c5f57
82 changed files with 11892 additions and 80520 deletions

View File

@@ -0,0 +1,33 @@
using UnityEngine;
using System.Collections;
namespace IsoTools.Examples {
public class CubeAutoMovement : MonoBehaviour {
public float stepTicks = 0.5f;
public float stepRndTicks = 0.5f;
void Start() {
StartCoroutine("Move");
}
WaitForSeconds RndWait() {
return new WaitForSeconds(stepTicks + Random.Range(0.0f, stepRndTicks));
}
IEnumerator Move() {
var iso_object = GetComponent<IsoObject>();
if ( iso_object ) {
for (;;) {
yield return RndWait();
iso_object.position += new Vector3(1, 0, 0);
yield return RndWait();
iso_object.position += new Vector3(0, 1, 0);
yield return RndWait();
iso_object.position += new Vector3(-1, 0, 0);
yield return RndWait();
iso_object.position += new Vector3(0, -1, 0);
}
}
}
}
} // namespace IsoTools.Examples