public void Retrieval() // 10/27 publicに変更 { FindObjectOfType <RayBox>().move_ = true; Square_Info si_; si_ = now_pos.GetComponent <Square_Info>(); si_.Decision(); GameObject[] nears_ = si_.GetNear(); foreach (GameObject n in nears_) { if (n.GetComponent <Square_Info>().GetChara() != null) { if (n.GetComponent <Square_Info>().GetChara().tag == "Enemy") { continue; } } Square_Info n_si_ = n.GetComponent <Square_Info>(); if (cost - n_si_.GetCost() >= 0 && n_si_.CanSetCost(cost, now_pos)) { n_si_.Decision(); Retrieval(n, cost); } } rayBox.GetComponent <RayBox>().SetMovePlayer(gameObject); }
void Retrieval() { Square_Info si_; si_ = now_pos.GetComponent <Square_Info>(); si_.Decision(); GameObject[] nears_ = si_.GetNear(); foreach (GameObject n in nears_) { if (n.GetComponent <Square_Info>().GetChara() != null) { if (n.GetComponent <Square_Info>().GetChara().tag == "Player") { continue; } } Square_Info n_si_ = n.GetComponent <Square_Info>(); if (cost - n_si_.GetCost() >= 0 && n_si_.CanSetCost(cost, now_pos) && first_cost >= n_si_.GetCost()) { n_si_.Decision(); Retrieval(n, cost); } } }
void Retrieval(GameObject near, int cost_) { Square_Info si_; si_ = near.GetComponent <Square_Info>(); GameObject[] nears_ = si_.GetNear(); cost_ -= si_.GetCost(); foreach (GameObject n in nears_) { Square_Info n_si_ = n.GetComponent <Square_Info>(); if (cost_ - n_si_.GetCost() >= 0 && n_si_.CanSetCost(cost_, near)) { n_si_.Decision(); Retrieval(n, cost_); } } }
public void Retrieval() { Square_Info si_; si_ = now_pos.GetComponent <Square_Info>(); si_.Decision(); GameObject[] nears_ = si_.GetNear(); foreach (GameObject n in nears_) { Square_Info n_si_ = n.GetComponent <Square_Info>(); if (cost - n_si_.GetCost() >= 0 && n_si_.CanSetCost(cost, now_pos)) { n_si_.Decision(); Retrieval(n, cost); } } }
public void RangeDisplay() { int move_cost = first_cost; Square_Info si_; si_ = now_pos.GetComponent <Square_Info>(); si_.SetNowPosCost(move_cost); si_.Decision(); GameObject[] nears_ = si_.GetNear(); foreach (GameObject n in nears_) { Square_Info n_si_ = n.GetComponent <Square_Info>(); if (move_cost - n_si_.GetCost() >= 0 && n_si_.CanSetCost(move_cost, now_pos)) { n_si_.Decision(); RangeSearch(n, move_cost + attak_range); } } }
void RangeSearch() { int move_cost = first_cost; Square_Info si_; si_ = now_pos.GetComponent <Square_Info>(); si_.SetNowPosCost(move_cost); si_.Decision(); GameObject[] nears_ = si_.GetNear(); foreach (GameObject n in nears_) { if (n.GetComponent <Square_Info>().GetChara() != null) { if (n.GetComponent <Square_Info>().GetChara().tag == "Player") { player_in_range = true; target_square = now_pos; in_range_player = n.GetComponent <Square_Info>().GetChara(); break; } } } if (!player_in_range) { foreach (GameObject n in nears_) { Square_Info n_si_ = n.GetComponent <Square_Info>(); if (move_cost - n_si_.GetCost() >= 0 && n_si_.CanSetCost(move_cost, now_pos)) { n_si_.Decision(); RangeSearch(n, move_cost + attak_range); } } PlayerSearch(); } }
void Retrieval(GameObject near, int cost_) { Square_Info si_; si_ = near.GetComponent <Square_Info>(); GameObject[] nears_ = si_.GetNear(); cost_ -= si_.GetCost(); foreach (GameObject n in nears_) { if (n.GetComponent <Square_Info>().GetChara() != null) { if (n.GetComponent <Square_Info>().GetChara().tag == "Enemy") { continue; } } Square_Info n_si_ = n.GetComponent <Square_Info>(); if (cost_ - n_si_.GetCost() >= 0 && n_si_.CanSetCost(cost_, near)) { n_si_.Decision(); Retrieval(n, cost_); } } }