Exemplo n.º 1
0
        public override void start()
        {
            string     name      = this.param ["val"];
            string     show_name = name;
            GameObject obj       = GameObject.Find("_sp_chara_name");

            if (StatusManager.variable.get("_chara_jname." + name) != "null")
            {
                show_name = StatusManager.variable.get("_chara_jname." + name);
                //色の指定もある場合
                if (StatusManager.variable.get("_chara_jcolor." + name) != "null")
                {
                    obj.GetComponent <GUIText> ().guiText.color = ColorX.HexToRGB(StatusManager.variable.get("_chara_jcolor." + name));
                }
            }
            else
            {
                obj.GetComponent <GUIText> ().guiText.color = Color.white;
            }

            Image img = this.gameManager.imageManager.getImage("_sp_chara_name");

            img.dicSave ["val"] = show_name;

            obj.GetComponent <GUIText> ().guiText.text = show_name;

            this.gameManager.nextOrder();
        }
Exemplo n.º 2
0
        public override void init(Dictionary <string, string> param)
        {
            this.param = param;

            GameObject g = Resources.Load(GameSetting.PATH_PREFAB + "Text") as GameObject;

            this.rootObject = (GameObject)Instantiate(g, new Vector3(0, 0.5f, -3.2f), Quaternion.identity);

            GUIText guiText = this.rootObject.GetComponent <GUIText> ().guiText;

            guiText.alignment = TextEnum.textAlignment(this.param["alignment"]);
            guiText.anchor    = TextEnum.textAnchor(this.param["anchor"]);


            string color = this.param ["color"];

            Color objColor = ColorX.HexToRGB(color);

            objColor.a    = 0;
            guiText.color = objColor;

            guiText.fontSize = int.Parse(this.param ["fontsize"]);

            this.guiScaler       = new GuiScaler(guiText);
            this.rootObject.name = this.name;

            if (this.param ["layer"] == "ui")
            {
                //タグをつける
                this.rootObject.tag = "ui";
            }
        }
Exemplo n.º 3
0
        public override void init(Dictionary <string, string> param)
        {
            this.param = param;

            GameObject g = Resources.Load(GameSetting.PATH_PREFAB + "Text") as GameObject;

            this.rootObject = (GameObject)Instantiate(g, new Vector3(0, 0.5f, -3.2f), Quaternion.identity);

            GameObject canvas = GameObject.Find("Canvas") as GameObject;

            this.rootObject.name             = param ["name"];
            this.rootObject.transform.parent = canvas.transform;

            UnityEngine.UI.Text guiText = this.rootObject.GetComponent <Text> ();

            //Debug.Log (this.param ["anchor"]);
            //Debug.Log (TextEnum.textAnchor (this.param ["anchor"]));
            guiText.alignment = TextEnum.textAnchor(this.param ["anchor"]);

            string color = this.param ["color"];

            Color objColor = ColorX.HexToRGB(color);

            objColor.a    = 0;
            guiText.color = objColor;

            guiText.fontSize = int.Parse(this.param ["fontsize"]);

            this.rootObject.name = this.name;
        }
Exemplo n.º 4
0
        public override void start()
        {
            //this.gameView.messageArea.GetComponent<GUIText> ().guiText.color = ColorX.HexToRGB (this.gameManager.getConfig ("messageFontColor"));
            this.gameView.messageArea.GetComponent <Text>().color = ColorX.HexToRGB(this.gameManager.getConfig("messageFontColor"));;

            //this.gameView.messageArea.GetComponent<GUIText> ().guiText.fontSize = int.Parse(this.gameManager.getConfig ("messageFontSize"));
            this.gameView.messageArea.GetComponent <Text> ().fontSize = int.Parse(this.gameManager.getConfig("messageFontSize"));

            this.gameManager.nextOrder();
        }
Exemplo n.º 5
0
 public Field(Vector3 pos, float s, string c)
 {
     if (c.StartsWith("\"#"))
     {
         Color = ColorX.HexToRGB(c.Substring(2, c.Length - 3));
     }
     else
     {
         Color = ColorX.HexToRGB(c);
     }
     Position = pos;
     Size     = s;
     Faces    = new bool[6] {
         true, true, true, true, true, true
     };
 }
Exemplo n.º 6
0
        public override void init(Dictionary <string, string> param)
        {
            this.param = param;

            GameObject g      = Resources.Load(GameSetting.PATH_PREFAB + "Button") as GameObject;
            GameObject canvas = GameObject.Find("Canvas") as GameObject;

            this.rootObject = (GameObject)Instantiate(g, new Vector3(0, 0.5f, -3.2f), Quaternion.identity);

            this.rootObject.name             = param ["name"];
            this.rootObject.transform.parent = canvas.transform;

            // TODO 独自
            GameObject jokerObj = GameObject.Find("JokerObject");

            this.rootObject.transform.parent = jokerObj.transform;
            // TODO

            this.targetText   = this.rootObject.GetComponentInChildren <Text> ();
            this.targetButton = this.rootObject.GetComponentInChildren <Button> ();

            this.targetText.alignment = TextEnum.textAnchor(this.param ["anchor"]);
            //TextEnum.textAlignment(this.param["alignment"]);
            //this.targetText.anchor    = TextEnum.textAnchor(this.param["anchor"]);

            string color = this.param ["color"];

            Color objColor = ColorX.HexToRGB(color);

            objColor.a            = 0;
            this.targetText.color = objColor;

            this.targetText.fontSize = int.Parse(this.param ["fontsize"]);


            /*
             * this.guiScaler = new GuiScaler (guiText);
             * this.rootObject.name = this.name;
             */
            /*
             * if (this.param ["layer"] == "ui") {
             *      //タグをつける
             *      this.rootObject.tag = "ui";
             * }
             */
        }
Exemplo n.º 7
0
        public override void start()
        {
            //this.gameView.messageArea.GetComponent<GUIText> ().guiText.fontSize = int.Parse(this.gameManager.getConfig ("messageFontSize"));

            if (this.param ["size"] != "")
            {
                int size = int.Parse(this.param["size"]);
                this.gameView.messageArea.GetComponent <GUIText> ().guiText.fontSize = size;
            }

            if (this.param ["color"] != "")
            {
                string color = this.param ["color"];
                this.gameView.messageArea.GetComponent <GUIText> ().guiText.color = ColorX.HexToRGB(color);
            }

            this.gameManager.nextOrder();
        }
Exemplo n.º 8
0
        public override void set(Dictionary <string, string> param)
        {
            if (this.rootObject == null)
            {
                this.init(param);
            }

            string text = this.param["val"];

            if (this.param ["cut"] != "")
            {
                int cut = int.Parse(this.param ["cut"]);
                if (cut < text.Length)
                {
                    text = text.Substring(0, cut);

                    this.param ["val"] = text;
                }
            }


            //色を復元する。
            if (this.param ["color"] != "")
            {
                string color    = this.param ["color"];
                Color  objColor = ColorX.HexToRGB(color);
                objColor.a = 0;
                this.rootObject.GetComponent <Text>().color = objColor;
            }

            if (this.param ["fontsize"] != "")
            {
                this.rootObject.GetComponent <Text>().fontSize = int.Parse(this.param ["fontsize"]);
            }

            this.rootObject.GetComponent <Text> ().text = text;
            //this.rootObject.GetComponent<Text> ().resizeTextForBestFit = true;
        }
Exemplo n.º 9
0
    // Use this for initialization
    void Start()
    {
        //すべてクリアする。
        NovelSingleton.clearSingleton();
        StatusManager.initScene();

        Debug.Log("GameStart");

        //ドキュメント作製用
        //DocGenerator.start ();
        //return;

        //NovelSingleton.clearSingleton ();

        this.gameManager = NovelSingleton.GameManager;
        this.gameView    = NovelSingleton.GameView;

        this.gameManager.setScene(this);

        //シナリオの読み込み
        this.gameManager.loadConfig();

        //font タグを使って指定だな。
        //メッセージフォントカラー設定
        Color c = ColorX.HexToRGB(this.gameManager.getConfig("messageFontColor"));

        c.a = 1f;
        this.gameView.messageArea.GetComponent <Text>().color    = c;
        this.gameView.messageArea.GetComponent <Text>().fontSize = int.Parse(this.gameManager.getConfig("messageFontSize"));

        this.gameView.messageAreaPlayer.GetComponent <Text>().color    = c;
        this.gameView.messageAreaPlayer.GetComponent <Text>().fontSize = int.Parse(this.gameManager.getConfig("messageFontSize"));


        //グローバルコンフィグ読み込み
        this.gameManager.saveManager.loadGlobal();

        if (StatusManager.nextLoad != "")
        {
            string next_load = StatusManager.nextLoad;

            //ロードの場合、画面を再現する必要がある。
            StatusManager.nextLoad = "";

            this.gameManager.loadData(next_load);
        }
        else if (StatusManager.nextFileName != "")
        {
            //scene new でジャンプしてきた後。variable は引き継がないとだめ。
            string file   = StatusManager.nextFileName;
            string target = StatusManager.nextTargetName;

            StatusManager.nextFileName   = "";
            StatusManager.nextTargetName = "";

            //この2つを元にその位置へジャンプした上で実行
            string tag_str = "[jump file='" + file + "' target='" + target + "' ]";

            //タグを実行
            AbstractComponent cmp = this.gameManager.parser.makeTag(tag_str);
            cmp.start();
        }
        else
        {
            //初回起動時
            this.messageSpeed = float.Parse(this.gameManager.getConfig("messageSpeed"));

            StatusManager.variable.replaceAll("global", this.gameManager.globalSetting.globalVar);

            string scenario_file = this.gameManager.getConfig("first_scenario");

            this.gameManager.loadScenario(scenario_file);

            this.gameManager.nextOrder();
        }
    }
Exemplo n.º 10
0
        //ゲームをロードします
        public void loadData(string data_name)
        {
            Debug.Log("load files ");
            SaveObject sobj = this.saveManager.getSaveData(data_name);

            Dictionary <string, Image> dic = sobj.dicImage;

            //イメージオブジェクトを画面に復元する
            foreach (KeyValuePair <string, Image> kvp in sobj.dicImage)
            {
                //画面を復元していきまする
                Image image = new Image(dic [kvp.Key].dicSave);
                image.dicFace = dic [kvp.Key].dicFace;
                this.imageManager.addImage(image);
            }

            //タグも復元
            this.imageManager.dicTag = sobj.dicTag;

            this.eventManager.dicEvent = sobj.dicEvent;
            this.scenarioManager       = sobj.scenarioManager;
            StatusManager.variable     = sobj.variable;

            //グローバルで置き換える
            NovelSingleton.GameManager.saveManager.loadGlobal();
            StatusManager.variable.replaceAll("global", NovelSingleton.GameManager.globalSetting.globalVar);


            //開始位置の確認
            StatusManager.currentScenario = sobj.currentFile;
            this.CurrentComponentIndex    = sobj.currentIndex - 1;

            this.loadScenario(StatusManager.currentScenario);

            StatusManager.enableClickOrder = true;

            //テキストを復元する
            NovelSingleton.GameView.messageArea.GetComponent <Text>().text = sobj.currentMessage;

            //現在の色が設定されている場合は色も復元
            if (StatusManager.currentTextColor != "")
            {
                NovelSingleton.GameView.messageArea.GetComponent <Text>().color = ColorX.HexToRGB(StatusManager.currentTextColor);
            }

            NovelSingleton.GameManager.scene.messageForSaveTitle = sobj.currentMessage;

            //ステータス復元
            StatusManager.visibleMessageFrame = sobj.visibleMessageFrame;
            StatusManager.enableNextOrder     = sobj.enableNextOrder;
            StatusManager.enableEventClick    = sobj.enableEventClick;
            StatusManager.enableClickOrder    = sobj.enableClickOrder;
            StatusManager.currentPlayBgm      = sobj.currentPlayBgm;

            StatusManager.isEventStop = sobj.isEventStop;
            //Debug.Log ("wwww:" + sobj.isEventStop);

            NovelSingleton.GameManager.logManager = sobj.logManager;

            //メッセージウィドウが表示状態なら、ここで表示する
            if (StatusManager.visibleMessageFrame == true)
            {
                NovelSingleton.GameView.showMessageWithoutNextOrder(0f);
            }
            else
            {
                NovelSingleton.GameView.hideMessageWithoutNextOrder(0f);
            }

            if (StatusManager.currentPlayBgm != "")
            {
                Novel.AbstractComponent cmp = NovelSingleton.GameManager.parser.makeTag("[playbgm wait=false next=false storage='" + StatusManager.currentPlayBgm + "']");
                cmp.start();
            }

            //何故か、、ここにいれないと。メッセージがすごく遅くなる
            NovelSingleton.GameManager.scene.messageSpeed = 0.02f;


            this.nextOrder();

            //画面を再現します ImageObject のみ
        }