コード例 #1
0
    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);
    }
コード例 #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);
            }
        }
    }
コード例 #3
0
ファイル: Move_System.cs プロジェクト: 52GameProject/Project
    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_);
            }
        }
    }
コード例 #4
0
ファイル: Move_System.cs プロジェクト: 52GameProject/Project
    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);
            }
        }
    }
コード例 #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);
            }
        }
    }
コード例 #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();
        }
    }
コード例 #7
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_)
        {
            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_);
            }
        }
    }