Example #1
0
 public void init(ref Vector3 position, ref Quaternion rotation)
 {
     base.init();
     rigidbody_.init(ref position, ref rotation);
     collider_ = MyCollider.createBullet();
     MyCollider.initSphereBullet(collider_, ref position, 0.25f /* radius */);
     MyCollider.disableForBullet(collider_, true);
     is_held_ = true;
     start_   = 0;
     beam_id_ = Beam.Instance.spawn(0.25f /* width */, Beam.Type.Bullet);
 }
Example #2
0
        public void init(ref Vector3 position, ref Quaternion rotation, float speed, double update_time)
        {
            base.init();
            rigidbody_.init(ref position, ref rotation);
            var dir      = rotation * CV.Vector3Forward;
            var velocity = dir * speed;

            rigidbody_.setVelocity(velocity);
            collider_ = MyCollider.createBullet();
            MyCollider.initSphereBullet(collider_, ref position, 0.5f /* radius */);
            start_   = update_time;
            beam_id_ = Beam.Instance.spawn(0.75f /* width */, Beam.Type.Bullet);
        }
Example #3
0
        public void init(ref Vector3 position, ref Quaternion rotation, float speed, float update_time)
        {
            base.init(ref position, ref rotation);
            var dir      = rotation * Vector3.forward;
            var velocity = dir * speed;

            rigidbody_.setVelocity(velocity);
            collider_ = MyCollider.createBullet();
            MyCollider.initSphereBullet(collider_, ref position, 1f /* radius */);
            start_   = update_time;
            beam_id_ = Beam.Instance.spawn(0.75f /* width */, Beam.Type.Bullet);
            // beam_id_ = Beam2.Instance.spawn(ref rigidbody_.transform_.position_,
            //                              ref dir,
            //                              1.0f /* length */,
            //                              speed,
            //                              ref col,
            //                              0.75f /* width */);
        }