Exemplo n.º 1
0
 public void zako2_init(ref Vector3 position, ref Quaternion rotation)
 {
     rigidbody_.init(ref position, ref rotation);
     collider_ = MyCollider.createEnemy();
     MyCollider.initSphereEnemy(collider_, ref position, 1f /* radius */);
     lock_target_      = LockTarget.create(this, new LockTarget.CalcPosition(calc_lock_position_center));
     enumerator_       = zako2_act(); // この瞬間は実行されない
     on_update_        = new OnUpdateFunc(zako2_update);
     on_render_update_ = new OnRenderUpdateFunc(zako2_render_update);
     life_             = 100f;
 }
Exemplo n.º 2
0
 public void zako_init(ref Vector3 position, ref Quaternion rotation)
 {
     rigidbody_.init(ref position, ref rotation);
     collider_ = MyCollider.createEnemy();
     MyCollider.initSphereEnemy(collider_, ref rigidbody_.transform_.position_, 0.5f /* radius */);
     collider_homing_ = MyCollider.createEnemyHoming();
     MyCollider.initSphereEnemyHoming(collider_homing_, ref rigidbody_.transform_.position_, 5f /* radius */);
     enumerator_       = zako_act(); // この瞬間は実行されない
     on_update_        = new OnUpdateFunc(zako_update);
     on_render_update_ = new OnRenderUpdateFunc(zako_render_update);
     life_             = 50f;
 }
Exemplo n.º 3
0
 public void dragon_init(ref Vector3 position, ref Quaternion rotation)
 {
     rigidbody_.init(ref position, ref rotation);
     rigidbody_.setDamper(2f);
     rigidbody_.setRotateDamper(20f);
     collider_ = MyCollider.createEnemy();
     MyCollider.initSphereEnemy(collider_, ref position, 1.5f /* radius */);
     collider_homing_ = MyCollider.createEnemyHoming();
     MyCollider.initSphereEnemyHoming(collider_homing_, ref rigidbody_.transform_.position_, 5f /* radius */);
     enumerator_       = dragon_act(); // この瞬間は実行されない
     on_update_        = new OnUpdateFunc(dragon_update);
     on_render_update_ = new OnRenderUpdateFunc(dragon_render_update);
     life_             = 10000000f;
     dragon_           = dragon_pool_;
     dragon_.init(this, ref rigidbody_.transform_.position_, ref rigidbody_.transform_.rotation_);
 }
Exemplo n.º 4
0
        public void dragon_init()
        {
            var position = new Vector3(-10f, -5f, 10f);

            rigidbody_.init(ref position, ref CV.QuaternionIdentity);
            rigidbody_.setDamper(2f);
            rigidbody_.setRotateDamper(20f);
            collider_ = MyCollider.createEnemy();
            MyCollider.initSphereEnemy(collider_, ref position, 1f /* radius */);
            lock_target_      = LockTarget.create(this, new LockTarget.CalcPosition(calc_lock_position_dragon));
            enumerator_       = dragon_act(); // この瞬間は実行されない
            on_update_        = new OnUpdateFunc(dragon_update);
            on_render_update_ = new OnRenderUpdateFunc(dragon_render_update);
            life_             = 10000000f;
            dragon_           = dragon_pool_;
            dragon_.init(this, ref rigidbody_.transform_.position_, ref rigidbody_.transform_.rotation_);
        }
Exemplo n.º 5
0
 public void init(Task task,
                  int idx,
                  ref Vector3 position,
                  ref Quaternion rotation,
                  DrawBuffer.Type draw_type)
 {
     rigidbody_.init(ref position, ref rotation);
     rigidbody_.setRotateDamper(8);
     collider_ = MyCollider.createEnemy();
     MyCollider.initSphereEnemy(collider_, ref position, 1f /* radius */);
     idx_         = idx;
     lock_target_ = LockTarget.create(task, new LockTarget.CalcPosition(this.calc_lock_position));
     locator_     = (idx_ == 0 ?
                     new Vector3(0f, 0f, 0f) :
                     new Vector3(0f, 0f, -3f));
     draw_type_ = draw_type;
 }
Exemplo n.º 6
0
 public void init(Task task,
                  int idx,
                  ref Vector3 position,
                  ref Quaternion rotation,
                  DrawBuffer.Type draw_type)
 {
     rigidbody_.init(ref position, ref rotation);
     rigidbody_.setRotateDamper(8);
     collider_ = MyCollider.createEnemy();
     MyCollider.initSphereEnemy(collider_, ref position, 1.5f /* radius */);
     collider_homing_ = MyCollider.createEnemyHoming();
     MyCollider.initSphereEnemyHoming(collider_homing_, ref rigidbody_.transform_.position_, 1.5f /* radius */);
     idx_     = idx;
     locator_ = (idx_ == 0 ?
                 new Vector3(0f, 0f, 0f) :
                 new Vector3(0f, 0f, -3f));
     draw_type_ = draw_type;
 }
Exemplo n.º 7
0
        public void init(ref Vector3 position, ref Quaternion rotation, Type type)
        {
            base.init(ref position, ref rotation);
            collider_ = MyCollider.createEnemy();
            MyCollider.initSphereEnemy(collider_, ref position, 1f /* radius */);
            var lock_pos = new Vector3(0, 0, 0);

            lock_target_ = LockTarget.create(this, ref lock_pos);

            type_  = type;
            phase_ = Phase.Alive;
            switch (type_)
            {
            case Type.None:
                Debug.Assert(false);
                break;

            case Type.Zako:
                /* ここで GC.allocate が発生してしまう */
                enumerator_ = zako_act();                 // この瞬間は実行されない
                break;
            }
        }