Ejemplo n.º 1
0
        //バイナリ読み込み
        public void OnRead(BinaryReader reader)
        {
            this.ClearSub();
            int version = reader.ReadInt32();

            if (version == VERSION)
            {
                int count = reader.ReadInt32();
                for (int i = 0; i < count; i++)
                {
                    AdvSelection selection = new AdvSelection(reader, engine);
                    selections.Add(selection);
                }
                count = reader.ReadInt32();
                for (int i = 0; i < count; i++)
                {
                    AdvSelection selection = new AdvSelection(reader, engine);
                    spriteSelections.Add(selection);
                    AddSpriteClickEvent(selection);
                }
            }
            else if (version == VERSION_0)
            {
                int count = reader.ReadInt32();
                for (int i = 0; i < count; i++)
                {
                    AdvSelection selection = new AdvSelection(reader, engine);
                    selections.Add(selection);
                }
            }
            else
            {
                Debug.LogError(LanguageErrorMsg.LocalizeTextFormat(ErrorMsg.UnknownVersion, version));
            }
        }
Ejemplo n.º 2
0
        /// <summary>
        /// 選択肢追加
        /// </summary>
        /// <param name="label">ジャンプ先のラベル</param>
        /// <param name="name">クリックを有効にするオブジェクト名</param>
        /// <param name="isPolygon">ポリゴンコライダーを使うか</param>
        /// <param name="exp">選択時に実行する演算式</param>
        public void AddSelectionClick(string label, string name, bool isPolygon, ExpressionParser exp, StringGridRow row)
        {
            AdvSelection select = new AdvSelection(label, name, isPolygon, exp, row);

            spriteSelections.Add(select);
            AddSpriteClickEvent(select);
        }
Ejemplo n.º 3
0
        //リストビューのアイテムが作成されるときに呼ばれるコールバック
        protected virtual void CallbackCreateItem(GameObject go, int index)
        {
            AdvSelection     data      = SelectionManager.Selections[index];
            AdvUguiSelection selection = go.GetComponentInChildren <AdvUguiSelection>();

            selection.Init(data, OnTap);
        }
 public void AddData(AdvSelection selection)
 {
     if ((selection.Label != "Alaways") && !this.Check(selection))
     {
         this.dataList.Add(new AdvSelectedHistoryData(selection));
     }
 }
Ejemplo n.º 5
0
        /// <summary>
        /// 初期化
        /// </summary>
        /// <param name="data">選択肢データ</param>
        public virtual void Init(AdvSelection data, Action <AdvUguiSelection> ButtonClickedEvent)
        {
            this.data      = data;
            this.text.text = data.Text;

            UnityEngine.UI.Button button = this.GetComponent <UnityEngine.UI.Button> ();
            button.onClick.AddListener(() => ButtonClickedEvent(this));
        }
Ejemplo n.º 6
0
            public bool Check(AdvSelection selection)
            {
                if (!string.IsNullOrEmpty(this.Label) || !string.IsNullOrEmpty(selection.Label))
                {
                    return(this.Label == selection.Label);
                }

                return((this.Text == selection.Text) && (this.JumpLabel == selection.JumpLabel));
            }
		/// <summary>
		/// 初期化
		/// </summary>
		/// <param name="data">選択肢データ</param>
		public void Init(AdvSelection data, Action<AdvUguiSelection> ButtonClickedEvent)
		{
			this.data = data;
			this.text.text = data.Text;
		//	Debug.Log (data.Text);

			UnityEngine.UI.Button button = this.GetComponent<UnityEngine.UI.Button> ();
			button.onClick.AddListener( ()=>ButtonClickedEvent(this) );

		}
Ejemplo n.º 8
0
        /// <summary>
        /// 既読チェック
        /// </summary>
        public bool Check(AdvSelection selection)
        {
            //選択済みにしない
            if (selection.Label == Ignore)
            {
                return(false);
            }

            return(dataList.Find(x => x.Check(selection)) != null);
        }
Ejemplo n.º 9
0
 /// <summary>
 /// 選択肢データをクリア
 /// </summary>
 public void Clear()
 {
     isWaitSelect = false;
     selected     = null;
     selections.Clear();
     foreach (AdvSelection selection in spriteSelections)
     {
         Engine.GraphicManager.RemoveClickEvent(selection.SpriteName);
     }
     spriteSelections.Clear();
 }
Ejemplo n.º 10
0
 void ClearSub()
 {
     selected = null;
     selections.Clear();
     foreach (AdvSelection selection in spriteSelections)
     {
         Engine.GraphicManager.RemoveClickEvent(selection.SpriteName);
     }
     spriteSelections.Clear();
     IsShowing   = false;
     IsWaitInput = false;
 }
Ejemplo n.º 11
0
        /// <summary>
        /// 選択
        /// </summary>
        /// <param name="selected">選んだ選択肢</param>
        public virtual void Select(AdvSelection selected)
        {
            this.selected = selected;

            string label = selected.JumpLabel;

            if (selected.Exp != null)
            {
                Engine.Param.CalcExpression(selected.Exp);
            }
            this.OnSelected.Invoke(this);
            Engine.SystemSaveData.SelectionData.AddData(selected);
            Clear();
            Engine.ScenarioPlayer.MainThread.JumpManager.RegistoreLabel(label);
        }
Ejemplo n.º 12
0
        /// <summary>
        /// 「選択済み」のデータ追加
        /// </summary>
        public void AddData(AdvSelection selection)
        {
            //選択済みにしない
            if (selection.Label == Ignore)
            {
                return;
            }

            //既に選択済みなのでそのまま
            if (Check(selection))
            {
                return;
            }

            dataList.Add(new AdvSelectedHistoryData(selection));
        }
Ejemplo n.º 13
0
 //コマンド終了待ち
 public override bool Wait(AdvEngine engine)
 {
     if (!engine.SelectionManager.IsWaitSelect)
     {
         AdvSelection selected = engine.SelectionManager.Selected;
         string       label    = selected.JumpLabel;
         if (selected.Exp != null)
         {
             engine.Param.CalcExpression(selected.Exp);
         }
         engine.SelectionManager.Clear();
         engine.JumpScenario(label);
     }
     //JumpScenarioした場合でも常にtrueを返すのが必須
     return(true);
 }
Ejemplo n.º 14
0
 //コマンド終了待ち
 public override bool Wait(AdvEngine engine)
 {
     if (engine.SelectionManager.IsSelected)
     {
         AdvSelection selected = engine.SelectionManager.Selected;
         string       label    = selected.JumpLabel;
         if (selected.Exp != null)
         {
             engine.Param.CalcExpression(selected.Exp);
         }
         engine.SelectionManager.Clear();
         engine.ScenarioPlayer.JumpManager.RegistoreLabel(label);
         return(false);
     }
     return(true);
 }
Ejemplo n.º 15
0
        //バイナリ読み込み
        void Read(BinaryReader reader)
        {
            int version = reader.ReadInt32();

            if (version == VERSION)
            {
                this.Clear();
                int count = reader.ReadInt32();
                for (int i = 0; i < count; i++)
                {
                    AdvSelection selection = new AdvSelection(reader);
                    selections.Add(selection);
                }
            }
            else
            {
                Debug.LogError(LanguageErrorMsg.LocalizeTextFormat(ErrorMsg.UnknownVersion, version));
            }
        }
Ejemplo n.º 16
0
        //選択肢表示に使うプレハブを取得
        protected virtual GameObject GetPrefab(AdvSelection selectionData)
        {
            GameObject prefab = null;

            if (!string.IsNullOrEmpty(selectionData.PrefabName))
            {
                //プレハブ名と一致するものを探す
                prefab = PrefabList.Find(x => x.name == selectionData.PrefabName);
                if (prefab != null)
                {
                    return(prefab);
                }
                else
                {
                    //見つからないとき
                    Debug.LogError("Not found Selection Prefab : " + selectionData.PrefabName);
                }
            }

            //プレハブ名の指定がなかったら、リストの一番目を
            //旧バージョンとの互換性のためListViewから選ぶ
            prefab = PrefabList.Count > 0 ? PrefabList[0] : ListView.ItemPrefab;
            return(prefab);
        }
		void OnSpriteClick(BaseEventData eventData, AdvSelection select)
		{
			Select(select);
		}
		/// <summary>
		/// 選択肢データをクリア
		/// </summary>
		public void Clear()
		{
			isWaitSelect = false;
			selected = null;
			selections.Clear();
			foreach (AdvSelection selection in spriteSelections)
			{
				Engine.GraphicManager.RemoveClickEvent(selection.SpriteName);
			}
			spriteSelections.Clear();
		}
		//バイナリ読み込み
		void Read(BinaryReader reader)
		{
			this.Clear();
			int version = reader.ReadInt32();
			if (version == VERSION)
			{
				int count = reader.ReadInt32();
				for (int i = 0; i < count; i++)
				{
					AdvSelection selection = new AdvSelection(reader, engine);
					selections.Add(selection);
				}
				count = reader.ReadInt32();
				for (int i = 0; i < count; i++)
				{
					AdvSelection selection = new AdvSelection(reader, engine);
					spriteSelections.Add(selection);
					AddSpriteClickEvent(selection);
				}
			}
			else if (version == VERSION_0)
			{
				int count = reader.ReadInt32();
				for (int i = 0; i < count; i++)
				{
					AdvSelection selection = new AdvSelection(reader, engine);
					selections.Add(selection);
				}
			}
			else
			{
				Debug.LogError(LanguageErrorMsg.LocalizeTextFormat(ErrorMsg.UnknownVersion, version));
			}
		}
		void AddSpriteClickEvent(AdvSelection select)
		{
			Engine.GraphicManager.AddClickEvent(select.SpriteName, select.IsPolygon, select.RowData, (eventData) => OnSpriteClick(eventData, select));
		}
Ejemplo n.º 21
0
 /// <summary>
 /// 選択
 /// </summary>
 /// <param name="index">選択肢のインデックス</param>
 public void Select(int index)
 {
     selected     = selections[index];
     isWaitSelect = false;
 }
		/// <summary>
		/// 選択肢追加
		/// </summary>
		/// <param name="label">ジャンプ先のラベル</param>
		/// <param name="name">クリックを有効にするオブジェクト名</param>
		/// <param name="isPolygon">ポリゴンコライダーを使うか</param>
		/// <param name="exp">選択時に実行する演算式</param>
		public void AddSelectionClick(string label, string name, bool isPolygon, ExpressionParser exp, StringGridRow row)
		{
			AdvSelection select = new AdvSelection(label, name, isPolygon, exp, row);
			spriteSelections.Add(select);
			AddSpriteClickEvent(select);
		}
 public bool Check(AdvSelection selection)
 {
Ejemplo n.º 24
0
 public AdvSelectedHistoryData(AdvSelection selection)
 {
     this.Label     = selection.Label;
     this.Text      = selection.Text;
     this.JumpLabel = selection.JumpLabel;
 }
Ejemplo n.º 25
0
 public void Init(AdvSelection data, Action <AdvUguiSelection> ButtonClickedEvent)
 {
Ejemplo n.º 26
0
 /// <summary>
 /// 選択肢データをクリア
 /// </summary>
 public void Clear()
 {
     isWaitSelect = false;
     selected     = null;
     selections.Clear();
 }
Ejemplo n.º 27
0
 /// <summary>
 /// 初期化
 /// </summary>
 /// <param name="data">選択肢データ</param>
 public void Init(AdvSelection data)
 {
     text.text = data.Text;
 }
Ejemplo n.º 28
0
 private GameObject GetPrefab(AdvSelection selectionData)
 {
		/// <summary>
		/// 選択の入力待ち開始
		/// </summary>
		public void StartWaiting()
		{
			isWaitSelect = true;
			selected = null;
		}
Ejemplo n.º 30
0
        private void CallbackCreateItem(GameObject go, int index)
        {
            AdvSelection data = this.SelectionManager.Selections[index];

            go.GetComponentInChildren <AdvUguiSelection>().Init(data, new Action <AdvUguiSelection>(this.OnTap));
        }
Ejemplo n.º 31
0
 void AddSpriteClickEvent(AdvSelection select)
 {
     Engine.GraphicManager.AddClickEvent(select.SpriteName, select.IsPolygon, select.RowData, (eventData) => OnSpriteClick(eventData, select));
 }
Ejemplo n.º 32
0
 void OnSpriteClick(BaseEventData eventData, AdvSelection select)
 {
     Select(select);
 }
Ejemplo n.º 33
0
 /// <summary>
 /// 選択の表示
 /// </summary>
 public void Show()
 {
     selected  = null;
     IsShowing = true;
     OnBeginShow.Invoke(this);
 }
Ejemplo n.º 34
0
 /// <summary>
 /// 選択の入力待ち開始
 /// </summary>
 public void StartWaiting()
 {
     isWaitSelect = true;
     selected     = null;
 }
		/// <summary>
		/// 選択
		/// </summary>
		/// <param name="selected">選んだ選択肢</param>
		public void Select( AdvSelection selected)
		{
			this.selected = selected;
			isWaitSelect = false;
		}
Ejemplo n.º 36
0
 /// <summary>
 /// 選択
 /// </summary>
 /// <param name="selected">選んだ選択肢</param>
 public void Select(AdvSelection selected)
 {
     this.selected = selected;
     isWaitSelect  = false;
 }
Ejemplo n.º 37
0
		/// <summary>
		/// 初期化
		/// </summary>
		/// <param name="data">選択肢データ</param>
		public void Init(AdvSelection data)
		{
			text.text = data.Text;
		}