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);
    }
Beispiel #2
0
    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);
            }
        }
    }
Beispiel #3
0
    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_);
            }
        }
    }
Beispiel #4
0
    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);
            }
        }
    }
Beispiel #5
0
    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);
            }
        }
    }
Beispiel #6
0
    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_);
            }
        }
    }