示例#1
0
		public static void clearSingleton(){
			gameManager = null;
			gameView = null;
			imageManager = null;
			scenarioManager = null;
			statusManager = null;
			audioManager= null;
			eventManager= null;
			saveManager= null;
		}
 public static void clearSingleton()
 {
     gameManager     = null;
     gameView        = null;
     imageManager    = null;
     scenarioManager = null;
     statusManager   = null;
     audioManager    = null;
     eventManager    = null;
     saveManager     = null;
 }
示例#3
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();
        }
示例#4
0
文件: GameManager.cs 项目: 2ty/race3d
        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 ();
        }
示例#5
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];
        }
示例#6
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 のみ
        }
示例#7
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;
            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 のみ
        }