Esempio n. 1
0
        public GameManager()
        {
            this.fm = new FileManager ();
            this.parser = new Parser ("Novel");

            this.imageManager = NovelSingleton.ImageManager;
            this.scenarioManager = NovelSingleton.ScenarioManager;
            this.statusManager = NovelSingleton.StatusManager;
            this.audioManager = NovelSingleton.AudioManager;
            this.eventManager = NovelSingleton.EventManager;
            this.saveManager = NovelSingleton.SaveManager;
            this.logManager = new LogManager ();
        }
Esempio n. 2
0
        //[DllImport("user32.dll", EntryPoint = "FindWindow")]
        //private static extern bool SetWindowText(IntPtr hWnd, System.String lpString);
        //[DllImport("user32.dll", EntryPoint = "FindWindow")]
        //private static extern IntPtr FindWindow(System.String className, System.String windowName);
        public GameManager()
        {
            //var w = FindWindow("UnityWndClass", null);
            //if (w != IntPtr.Zero)
            //{
            //    var wnd = Form.FromHandle(w);
            //    if (null != wnd) wnd.Text = "キュアぷらす スクリプトデバッガ";
            //}
            //SetWindowText(w, "キュアぷらす スクリプトデバッガ");

            this.fm = new FileManager(new FileLoader());
            this.parser = new Parser ("Novel");

            this.imageManager = NovelSingleton.ImageManager;
            this.scenarioManager = NovelSingleton.ScenarioManager;
            this.statusManager = NovelSingleton.StatusManager;
            this.audioManager = NovelSingleton.AudioManager;
            this.eventManager = NovelSingleton.EventManager;
            this.saveManager = NovelSingleton.SaveManager;
            this.logManager = new LogManager ();

            //var fl=System.Windows.Forms.Application.OpenForms;
            //var ff = fl[0];
        }
Esempio n. 3
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;

                }
            }

            this.rootObject.GetComponentInChildren<Text> ().text = text;

            //イメージ ここのpathは廃止の方向で
            if (this.param.ContainsKey ("path") && this.param ["path"] == "true") {

                if (this.param ["storage"] != "") {

                    #if(!UNITY_WEBPLAYER)

                    /*
                    byte[] bytes = File.ReadAllBytes(this.param["storage"]);

                    Texture2D texture = new Texture2D (0, 0);
                    texture.LoadImage (bytes);
                    this.targetButton.image = texture;
                    */

                    #else

                    #endif

                } else {
                    //画像がない場合はデフォルトの未設定のファイルを見せるか。。
                }

            } else {

                if (param ["storage"] != "") {

                    string filename = this.imagePath + param ["storage"];
                    this.filename = filename;
                    //Sprite imageSprite = Resources.Load<Sprite>(filename);
                    FileManager fm = new FileManager(new FileLoader());
                    Sprite imageSprite = fm.LoadSprite(filename);

                    //scale の調整
                    this.targetButton.image.overrideSprite = imageSprite;
                    this.targetButton.image.SetNativeSize ();

                }

                //width の設定
                if (param["width"] !="" && param["height"] !="" ) {
                    this.targetButton.GetComponent<RectTransform> ().sizeDelta = new Vector2(float.Parse (param ["width"]),float.Parse (param ["height"]));
                }

            }

            //クリックされた時
            this.targetButton.onClick.AddListener (() => {

                Debug.Log("clicked---:"+this.rootObject.name);
                this.gameManager.eventManager.checkEvent(this.rootObject.name,"click");

                //この次のイベントは止める check
                //StatusManager.isEventButtonStop = true;
                StatusManager.inUiClick = true;
                //イベントチェック

                //Debug.Log ("Clicked.-------------------");

            });
        }
Esempio n. 4
0
 private Sprite LoadSprite(string filename)
 {
     var fm = new FileManager(new FileLoader());
     return fm.LoadSprite(filename);
 }