public void update(float dt, double update_time, ref MyTransform parent_transform) { if (MyCollider.getHitOpponentForEnemy(collider_) != MyCollider.Type.None) { rigidbody_.addTorque(MyRandom.Range(-20f, 20f), MyRandom.Range(-20f, 20f), MyRandom.Range(-20f, 20f)); } if (lock_target_.isHitted()) { rigidbody_.addTorque(MyRandom.Range(-200f, 200f), MyRandom.Range(-200f, 200f), MyRandom.Range(-200f, 200f)); lock_target_.clearLock(); Explosion.Instance.spawn(ref lock_target_.updated_position_, update_time); Hahen.Instance.spawn(ref lock_target_.updated_position_, update_time); Shockwave.Instance.spawn(ref lock_target_.updated_position_, update_time); SystemManager.Instance.registSound(DrawBuffer.SE.Explosion); } rigidbody_.addSpringTorque(ref parent_transform.rotation_, 30f /* torque_level */); var pos = parent_transform.transformPosition(ref locator_); rigidbody_.transform_.position_ = pos; rigidbody_.update(dt); MyCollider.updateEnemy(collider_, ref rigidbody_.transform_.position_); lock_target_.update(); }
public override void update(float dt, float update_time) { update_time_ = update_time; if (enumerator_ != null) { enumerator_.MoveNext(); } if (alive_) { if (MyCollider.getHitOpponentForEnemy(collider_) != MyCollider.Type.None) { rigidbody_.addTorque(MyRandom.Range(-100f, 100f), MyRandom.Range(-100f, 100f), MyRandom.Range(-100f, 100f)); rigidbody_.addForceZ(-10000f); Explosion.Instance.spawn(ref rigidbody_.transform_.position_, update_time); Hahen.Instance.spawn(ref rigidbody_.transform_.position_, update_time); SystemManager.Instance.registSound(DrawBuffer.SE.Explosion); MyCollider.disableForEnemy(collider_); lock_target_.disable(); phase_ = Phase.Dying; } if (lock_target_.isHitted()) { rigidbody_.addTorque(MyRandom.Range(-100f, 100f), MyRandom.Range(-100f, 100f), MyRandom.Range(-100f, 100f)); rigidbody_.addForceZ(-10000f); lock_target_.clearLock(); Explosion.Instance.spawn(ref lock_target_.updated_position_, update_time); Hahen.Instance.spawn(ref lock_target_.updated_position_, update_time); SystemManager.Instance.registSound(DrawBuffer.SE.Explosion); MyCollider.disableForEnemy(collider_); lock_target_.disable(); phase_ = Phase.Dying; } rigidbody_.update(dt); MyCollider.updateEnemy(collider_, ref rigidbody_.transform_.position_); lock_target_.update(); } }