Example #1
0
        // private DrawBuffer dummy_draw_buffer_;
        void Start()
        {
            TaskManager.Instance.init();
            Sight.Instance.init(null /* material */);
            LockTarget.createPool();
            list_ = new List<TestTask>();
            GameObject prefab = null;
            for (var i = 0; i < MAX; ++i) {
            GameObject go;
            if (prefab == null) {
                prefab = GameObject.Find("Cube");
                go = prefab;
            } else {
                float range = 8;
                go = Instantiate(prefab, new Vector3(Random.Range(-range, range),
                                                     Random.Range(-range, range),
                                                     Random.Range(-range, range)),
                                 Quaternion.identity) as GameObject;
            }
            var task = new TestTask();
            var pos = go.transform.position;
            var rot = go.transform.rotation;
            task.init(ref pos, ref rot);
            var lock_target = LockTarget.create(task, ref CV.Vector3Zero);
            task.lock_target_ = lock_target;
            task.owner_ = go;
            list_.Add(task);
            }
            camera_ = Camera.main;

            my_camera_ = MyCamera.create();
            // dummy_draw_buffer_ = new DrawBuffer();
        }
Example #2
0
        void Start()
        {
            TaskManager.Instance.init();
            // Sight.Instance.init();
            LockTarget.createPool();
            list_ = new List <TestTask>();
            GameObject prefab = null;

            for (var i = 0; i < MAX; ++i)
            {
                GameObject go;
                if (prefab == null)
                {
                    prefab = GameObject.Find("Cube");
                    go     = prefab;
                }
                else
                {
                    float range = 8;
                    go = Instantiate(prefab, new Vector3(Random.Range(-range, range),
                                                         Random.Range(-range, range),
                                                         Random.Range(-range, range)),
                                     Quaternion.identity) as GameObject;
                }
                var task = new TestTask();
                var pos  = go.transform.position;
                var rot  = go.transform.rotation;
                task.init();
                task.rigidbody_.init(ref pos, ref rot);
                var lock_target = LockTarget.create(task, new LockTarget.CalcPosition(task.calc_position));
                task.lock_target_ = lock_target;
                task.owner_       = go;
                list_.Add(task);
            }
            camera_ = Camera.main;

            player_ = Player.create();
        }
Example #3
0
        // private DrawBuffer dummy_draw_buffer_;

        void Start()
        {
            TaskManager.Instance.init();
            Sight.Instance.init(null /* material */);
            LockTarget.createPool();
            list_ = new List <TestTask>();
            GameObject prefab = null;

            for (var i = 0; i < MAX; ++i)
            {
                GameObject go;
                if (prefab == null)
                {
                    prefab = GameObject.Find("Cube");
                    go     = prefab;
                }
                else
                {
                    float range = 8;
                    go = Instantiate(prefab, new Vector3(Random.Range(-range, range),
                                                         Random.Range(-range, range),
                                                         Random.Range(-range, range)),
                                     Quaternion.identity) as GameObject;
                }
                var task = new TestTask();
                var pos  = go.transform.position;
                var rot  = go.transform.rotation;
                task.init(ref pos, ref rot);
                var lock_target = LockTarget.create(task, ref CV.Vector3Zero);
                task.lock_target_ = lock_target;
                task.owner_       = go;
                list_.Add(task);
            }
            camera_ = Camera.main;

            my_camera_ = MyCamera.create();
            // dummy_draw_buffer_ = new DrawBuffer();
        }