public void Properties() { FloatingBehavior b = new FloatingBehavior(); // default Assert.AreEqual("floatingBehavior", b.TagName, "A1"); }
public void IsTypeDescriptorClosed() { FloatingBehavior a = new FloatingBehavior(); ScriptTypeDescriptor desc = ((IScriptObject)a).GetTypeDescriptor(); desc.AddEvent(new ScriptEventDescriptor("testEvent", true)); }
void Awake() { Randomizer = new System.Random(GetHashCode() + DateTime.Now.Millisecond); Rigidbody = GetComponent <Rigidbody>(); FloatingBehavior = GetComponent <FloatingBehavior>(); WaitForThinking = new WaitForSeconds(ThinkingTime); WaitForFixedUpdate = new WaitForFixedUpdate(); }
// Use this for initialization void Awake() { newDucks = new List <GameObject>(); floating = GetComponent <FloatingBehavior> (); rigidBody = GetComponent <Rigidbody> (); waitForTuring = new WaitForSeconds(TurningTime); waitForLaunching = new WaitForSeconds(LaunchingTime); wait = new WaitForSeconds(WaitingTime); }
public void Render() { FloatingBehavior c = new FloatingBehavior(); StringWriter sw; ScriptTextWriter w; sw = new StringWriter(); w = new ScriptTextWriter(sw); ((IScriptComponent)c).RenderScript(w); Assert.AreEqual("", sw.ToString(), "A1"); }
public void TypeDescriptor() { FloatingBehavior a = new FloatingBehavior(); ScriptTypeDescriptor desc = ((IScriptObject)a).GetTypeDescriptor(); Assert.AreEqual(a, desc.ScriptObject, "A1"); // events IEnumerable <ScriptEventDescriptor> events = desc.GetEvents(); Assert.IsNotNull(events, "A2"); IEnumerator <ScriptEventDescriptor> ee = events.GetEnumerator(); Assert.IsTrue(ee.MoveNext(), "A3"); DoEvent(ee.Current, "propertyChanged", true); Assert.IsFalse(ee.MoveNext(), "A4"); // methods IEnumerable <ScriptMethodDescriptor> methods = desc.GetMethods(); Assert.IsNotNull(methods, "A5"); IEnumerator <ScriptMethodDescriptor> me = methods.GetEnumerator(); Assert.IsFalse(me.MoveNext()); // properties IEnumerable <ScriptPropertyDescriptor> props = desc.GetProperties(); Assert.IsNotNull(props, "A6"); IEnumerator <ScriptPropertyDescriptor> pe = props.GetEnumerator(); Assert.IsTrue(pe.MoveNext(), "A7"); DoProperty(pe.Current, "bindings", ScriptType.Array, true, "Bindings"); Assert.IsTrue(pe.MoveNext(), "A8"); DoProperty(pe.Current, "dataContext", ScriptType.Object, false, ""); Assert.IsTrue(pe.MoveNext(), "A9"); DoProperty(pe.Current, "id", ScriptType.String, false, "ID"); Assert.IsTrue(pe.MoveNext(), "A10"); DoProperty(pe.Current, "handle", ScriptType.Object, false, "Handle"); Assert.IsFalse(pe.MoveNext(), "A11"); }
private void Start() { _floatingBehavior = GetComponent<FloatingBehavior>(); }
public override void Start() { base.Start(); _floatingBehavior = GetComponent <FloatingBehavior>(); }