public void init(ref Vector3 position, ref Quaternion rotation, float speed, double stop_time) { base.init(); rigidbody_.init(ref position, ref rotation); var dir = rotation * CV.Vector3Up; var velocity = dir * speed; rigidbody_.setVelocity(velocity); collider_ = MyCollider.createEnemyBullet(); MyCollider.initSphereEnemyBullet(collider_, ref position, 0.5f /* radius */); stop_time_ = stop_time; }
public void init(ref Vector3 position, ref Quaternion rotation, float speed, double update_time) { base.init(); var dir = rotation * CV.Vector3Forward; var velocity = dir * speed; var pos = position + velocity * 0.02f; rigidbody_.init(ref pos, ref rotation); rigidbody_.setVelocity(velocity); collider_ = MyCollider.createEnemyBullet(); MyCollider.initSphereEnemyBullet(collider_, ref position, 0.5f /* radius */); start_ = update_time; beam_id_ = Beam.Instance.spawn(0.5f /* width */, Beam.Type.EnemyBullet); }
public void init(ref Vector3 position, ref Quaternion rotation, float speed, float width, float length, 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.createEnemyBullet(); MyCollider.initSphereEnemyBullet(collider_, ref position, width); start_ = update_time; length_ = length; beam_id_ = Beam2.Instance.spawn(width, Beam2.Type.EnemyBullet); }
public void init(ref Vector3 position, ref Vector3 target, float speed, float update_time) { var rotation = Quaternion.LookRotation(target - position); base.init(ref position, ref rotation); var dir = rotation * CV.Vector3Forward; var velocity = dir * speed; rigidbody_.setVelocity(velocity); collider_ = MyCollider.createEnemyBullet(); MyCollider.initSphereEnemyBullet(collider_, ref position, 0.25f /* radius */); start_ = update_time; beam_id_ = Beam.Instance.spawn(0.5f /* width */, Beam.Type.EnemyBullet); // beam_id_ = Beam2.Instance.spawn(ref rigidbody_.transform_.position_, // ref dir, // 1f /* length */, // speed, // ref col, // 0.5f /* width */); }