Exemplo n.º 1
0
        /// <summary>
        /// subject
        /// </summary>
        /// <param name="subject"></param>
        public void Popup(Subject subject)
        {
            targetSubject = subject;
            BattleManager.Instance.SetStateMachine(BattleManager.StateMachine.State.Tutorial);
            popupSystem.Popup();
            popupMaterials.ForEach(material => popupSystem.SubscribeButton(material));
            targetItems = tutorialObject.Items.FindAll((item) => item.subject == (item.subject & subject));
            targetItems = targetItems.OrderBy(item => item.subject).ToList();
            var   imageSize = new Vector2(width, height);
            float xPos      = 0;

            targetItems.ForEach(item =>
            {
                var go = new GameObject();
                go.transform.parent = popupSystem.popupedObject.transform.GetChild(0);
                var image           = go.AddComponent <Image>();
                image.sprite        = item.Sprite;
                Debug.Log(item.subject);
                image.rectTransform.sizeDelta     = imageSize;
                image.rectTransform.localPosition = new Vector2(xPos, 0);
                xPos += width;
                image.rectTransform.localScale = Vector2.one;
            });
            OnPopup();
        }
Exemplo n.º 2
0
        /// <summary>
        /// registration events
        /// </summary>
        private void Start()
        {
            GameObject hitResult;

            TouchGestureDetector.Instance.onGestureDetected.AddListener((gesture, touchInfo) =>
            {
                if (gesture == TouchGestureDetector.Gesture.Click &&
                    battleManager.m_StateMachine.m_State == BattleManager.StateMachine.State.PlayerChoice &&
                    touchInfo.HitDetection(out hitResult, touchTarget) &&
                    IsActivatable &&
                    !PanelManager.Instance.IsOpenedAllPanelsExceptEnemyPanels)
                {
                    Debug.Log(hitResult.gameObject.name);
                    if (hitResult.tag != "ShufflePanels")
                    {
                        return;
                    }
                    battleManager.SetStateMachine(BattleManager.StateMachine.State.Pause);
                    popupSystem.Popup();
                    popupSystem.SubscribeButton(new PopupSystemMaterial(Activate, PositiveButton.gameObject.name, true));
                    popupSystem.SubscribeButton(new PopupSystemMaterial(Cancel, NegativeButton.gameObject.name, true));
                }
            });

            // animationが終わった時にスキルを発動するイベントを登録する
            var animBehaviour = skillAnim.GetBehaviour <AnimBehaviour>();

            animBehaviour.SetStateExitEventWithState(PanelShuffle);
        }
        private void Start()
        {
            m_touchGestureDetector.onGestureDetected.AddListener((gesture, touchInfo) =>
            {
                GameObject hitResult;

                // クリック時 && プレイヤー選択時
                // && ユニークスキルフラグtrueの時
                //&& タッチしたゲームオブジェクトのタグが"PlayerSkillGauge"の時
                if (gesture == TouchGestureDetector.Gesture.Click &&
                    m_battleManager.m_StateMachine.m_State == BattleManager.StateMachine.State.PlayerChoice &&
                    SkillFlag == true &&
                    touchInfo.HitDetection(out hitResult))
                {
                    if (hitResult.tag != "PlayerSkillGauge")
                    {
                        return;
                    }
                    m_battleManager.SetStateMachine(BattleManager.StateMachine.State.Pause);
                    m_popupSystem.Popup();
                    // buttonのイベント登録
                    m_popupSystem.SubscribeButton(new PopupSystemMaterial(Activate, "PositiveButton", true));
                    m_popupSystem.SubscribeButton(new PopupSystemMaterial(Chancel, "NegativeButton", true));
                }
            });
        }
Exemplo n.º 4
0
 /// <summary>
 /// ポース画面を出す
 /// </summary>
 public void InningThePause()
 {
     if (battleManager.m_StateMachine.m_State == BattleManager.StateMachine.State.PlayerChoice ||
         battleManager.m_StateMachine.m_State == BattleManager.StateMachine.State.PlayerAttack ||
         battleManager.m_StateMachine.m_State == BattleManager.StateMachine.State.EnemyAttack)
     {
         battleManager.SetStateMachine(BattleManager.StateMachine.State.Pause);
         popupSystem.Popup();
         ButtonEvents.ForEach(item => popupSystem.SubscribeButton(item));
     }
 }
Exemplo n.º 5
0
        /// <summary>
        /// デバッグ画面を出す
        /// </summary>
        public void InningTheDebugWindow()
        {
            if (battleManager.m_StateMachine.m_State != BattleManager.StateMachine.State.Pause &&
                battleManager.m_StateMachine.m_State != BattleManager.StateMachine.State.Init &&
                battleManager.m_StateMachine.m_State != BattleManager.StateMachine.State.Win &&
                battleManager.m_StateMachine.m_State != BattleManager.StateMachine.State.Debugging)
            {
                // pauseステートに遷移し,各要素をポップアップ後イベント登録
                battleManager.SetStateMachine(BattleManager.StateMachine.State.Debugging);
                popupSystem.Popup();
                popupSystem.SubscribeButton(buttonMaterial);
                toggleMaterials.ForEach(material => popupSystem.SubscribeToggle(material));
                sliderMaterials.ForEach(material => popupSystem.SubscribeSlider(material));

                // 各要素を適切に初期化
                var toggles = popupSystem.popupedObject.GetComponentsInChildren <Toggle>().ToList();
                toggles.ForEach(toggle =>
                {
                    if (toggle.gameObject.name == displayPanelsToggle.gameObject.name)
                    {
                        if (battleDebugger.DisplayPanels)
                        {
                            toggle.isOn = true;
                        }
                    }
                    if (toggle.gameObject.name == autoPlayToggle.gameObject.name)
                    {
                        if (battleDebugger.AutoPlay)
                        {
                            toggle.isOn = true;
                        }
                    }
                    if (toggle.gameObject.name == skipEffectToggle.gameObject.name)
                    {
                        if (battleDebugger.EffectSkip)
                        {
                            toggle.isOn = true;
                        }
                    }

                    var slider   = GameObject.Find("OpenPanelsSlider").GetComponentInChildren <Slider>();
                    slider.value = battleDebugger.OpenPanelQuantity;

                    slider       = GameObject.Find("PanelAnimTimeSlider").GetComponentInChildren <Slider>();
                    slider.value = PanelManager.Instance.PanelAnimTime;
                });
            }
        }
 /// <summary>
 /// 攻撃ボタンをポップアップさせる
 /// </summary>
 public void DisplayAttackButton()
 {
     popupSystem.Popup();
     popupSystem.SubscribeButton(new PopupSystemMaterial(StartAttack, attackButton.gameObject.name, true));
 }