コード例 #1
0
        public void Properties()
        {
            FloatingBehavior b = new FloatingBehavior();

            // default
            Assert.AreEqual("floatingBehavior", b.TagName, "A1");
        }
コード例 #2
0
        public void IsTypeDescriptorClosed()
        {
            FloatingBehavior     a    = new FloatingBehavior();
            ScriptTypeDescriptor desc = ((IScriptObject)a).GetTypeDescriptor();

            desc.AddEvent(new ScriptEventDescriptor("testEvent", true));
        }
コード例 #3
0
ファイル: WhaleAgent.cs プロジェクト: DanTarsoly/GrabADuck
 void Awake()
 {
     Randomizer         = new System.Random(GetHashCode() + DateTime.Now.Millisecond);
     Rigidbody          = GetComponent <Rigidbody>();
     FloatingBehavior   = GetComponent <FloatingBehavior>();
     WaitForThinking    = new WaitForSeconds(ThinkingTime);
     WaitForFixedUpdate = new WaitForFixedUpdate();
 }
コード例 #4
0
ファイル: IslandAgent.cs プロジェクト: DanTarsoly/GrabADuck
    // 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);
    }
コード例 #5
0
        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");
        }
コード例 #6
0
        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");
        }
コード例 #7
0
ファイル: Comets.cs プロジェクト: LostJam/rainyday-game
 private void Start()
 {
     _floatingBehavior = GetComponent<FloatingBehavior>();
 }
コード例 #8
0
    public override void Start()
    {
        base.Start();

        _floatingBehavior = GetComponent <FloatingBehavior>();
    }