Beispiel #1
0
    // Update is called once per frame
    void Update()
    {
        int count = 0;

        for (int i = 0; i < key_flg.Length; i++)
        {
            if (!(key_flg[i]))
            {
                break;
            }
            count++;
        }
        if (count == key_flg.Length)
        {
            Destroy(this.gameObject);

            //コマンドを設定する
            player_status.SetComandState(Item, true);
            //scroll_control.SetTextBox("Get New Comand : " + Item);
            switch (Item)
            {
            case "shot":
                scroll_control.SetTextBox("火の玉を打つ:shot", "comand_shot");
                GameObject.FindGameObjectWithTag("fireshottext").GetComponent <Text>().text = "shot";
                break;

            case "hide":
                scroll_control.SetTextBox("隠れる:hide", "comand_hide");
                break;

            case "creatmycopy":
                scroll_control.SetTextBox("分身する:creatmycopy", "comand_creatmycopy");
                break;

            default:
                break;
            }
        }
    }
Beispiel #2
0
    // Use this for initialization
    void Start()
    {
        //壁を自動生成
        CreateMapWall();

        //マップの元データ

        /*
         * 0:空
         * 1:壁
         * 2:ドアA
         * 3:ドアB
         * 4:鍵A
         * 5:鍵B
         * 6:敵の出現ボックス
         * 9:プレイヤー
         */
        string map_matrix = "";

        map_matrix += "11111111111111111111111100011111111111:"; //28行目
        map_matrix += "11110000000000001111111107011111111111:"; //27行目
        map_matrix += "11110400000000001111111100011111111111:"; //26行目
        map_matrix += "11110000000000001111111110111111111111:"; //25行目
        map_matrix += "11110000090000001111111110111111111111:"; //24行目
        map_matrix += "11110000000000001111111000000000000111:"; //23行目
        map_matrix += "11110000000000001111111000000060000111:"; //22行目
        map_matrix += "11110000200000001111111000600000000111:"; //21行目
        map_matrix += "11111001111111111111111000000000000111:"; //20行目
        map_matrix += "11111001111111111111111000006000000111:"; //19行目
        map_matrix += "11100000001111111111111000000000000111:"; //18行目
        map_matrix += "11100000000000000000011111111111100111:"; //17行目
        map_matrix += "11100000000000000000011111111111100111:"; //16行目
        map_matrix += "11100600000000006000011111111111100111:"; //15行目
        map_matrix += "11100000000000000000011000000000000011:"; //14行目
        map_matrix += "11100000000006000000000000000000006011:"; //13行目
        map_matrix += "11100000000000000000011000000000000011:"; //12行目
        map_matrix += "11111111111111111111111000000003000011:"; //11行目
        map_matrix += "11111111111111111111111000000001111111:"; //10行目
        map_matrix += "11111111111111111111111000000001111111:"; //9行目
        map_matrix += "11111111111111111111111000000001111111:"; //8行目
        map_matrix += "11111111111111111111111000000001111111:"; //7行目
        map_matrix += "11111111111111111111111006000001111111:"; //6行目
        map_matrix += "11111111111111111111111000004001111111:"; //5行目
        map_matrix += "11111111111111111111111000000001111111:"; //4行目
        map_matrix += "11111111111111111111111111111111111111:"; //3行目
        map_matrix += "11111111111111111111111111111111111111:"; //2行目
        map_matrix += "11111111111111111111111111111111111111:"; //1行目


        //マップのコンテンツを自動生成
        CreateMapContent(map_matrix);

        //コマンドリストを生成する
        scroll_content = GameObject.FindGameObjectWithTag("Content");
        scroll_control = scroll_content.GetComponent <ScrollControl>();
        scroll_control.SetTextBox("コマンドリスト", "comand_list");
        scroll_control.SetTextBox("右に移動:right", "comand_right");
        scroll_control.SetTextBox("左に移動:left", "comand_left");
        scroll_control.SetTextBox("上に移動:up", "comand_up");
        scroll_control.SetTextBox("下に移動:down", "comand_down");
        scroll_control.SetTextBox("開ける:open", "comand_open");
    }