示例#1
0
        /// <summary>
        /// Creates a databinding root binding to an instance of <see cref="DataBindingTest"/>.
        /// </summary>
        public static DataBindingRoot CreateRootWithTest(out DataBindingTestExample testBindTarget)
        {
            var rootGo = new GameObject("Root");

            testBindTarget = rootGo.AddComponent <DataBindingTestExample>();
            var root = rootGo.AddComponent <DataBindingRoot>();

            root.target = testBindTarget;
            root.Awake();

            return(root);
        }
示例#2
0
        /// <summary>
        /// Creates a databinding root binding to an instance of <see cref="DataBindingTest"/>.
        /// </summary>
        public static DataBindingScriptedRoot CreateScriptedRootWithTest(out DataBindingTestExample testBindTarget)
        {
            var rootGo = new GameObject("Root");

            testBindTarget = rootGo.AddComponent <DataBindingTestExample>();
            var root = rootGo.AddComponent <DataBindingScriptedRoot>();

            root.bindTargetType = "UnityTK.Test.DataBinding.DataBindingTestExample, UnityTK.Tests";
            root.target         = testBindTarget;
            root.Awake();

            return(root);
        }