public static OnePointModel RentModel(string model_key) { if (!model_manager.one_point_models.ContainsKey(model_key)) { // 存在しない ? return(null); } var md = model_manager.one_point_models[model_key]; foreach (var m in md.models) { if (m.is_rent == false) { m.is_rent = true; return(m); } } { var m = new OnePointModel(md.path); m.is_rent = true; md.models.Add(m); return(m); } }
public ActionShootArrow(int start_wait, RouteAsShoot route_as_shoot, bool is_success) { this.timer_start_wait = start_wait; this.is_success = is_success; this.route_as_shoot = route_as_shoot; model_arrow = ModelManager.RentModel("戦闘/矢"); var start_x = route_as_shoot.start_x * correct; var start_y = route_as_shoot.start_y * correct + 20.0f; var start_z = route_as_shoot.start_z * correct; var end_x = route_as_shoot.end_x * correct; var end_y = route_as_shoot.end_y * correct; var end_z = route_as_shoot.end_z * correct; route_xz_list = new List <Point>(route_as_shoot.route_pos_list_xz); route_y_list = new List <Point>(route_as_shoot.route_pos_list_route); direction_list = new List <RouteAsShoot.ExDPoint>(route_as_shoot.direction_list_route); correct_time_to_xz = (double)route_xz_list.Count() / shoot_time; correct_time_to_y = (double)route_y_list.Count() / shoot_time; // 弓の向きを計算 // もともとのモデルが -x方向に向いているのでこのような計算になる rot_y = (float)(Math.PI - route_as_shoot.direction); model_arrow.Rot(0, rot_y, 0); start_pos = DX.VGet(start_x, start_y, start_z); }