Beispiel #1
0
        public void Init(Item data, GalleryManager gM)
        {
            touchGestureDetector = TouchGestureDetector.Instance;
            galleryM             = gM;

            ObjectTag  touchTag    = ObjectTag.None;
            GameObject beginObject = null;

            if (!Reflect(data))
            {
                touchGestureDetector.onGestureDetected.AddListener((gesture, touchInfo) =>
                {
                    if (gesture == TouchGestureDetector.Gesture.TouchBegin)
                    {
                        touchTag    = ObjectTag.None;
                        beginObject = null;
                        if (touchInfo.HitDetection(out beginObject, charaObj[2]))
                        {
                            touchTag = ObjectTag.Character;
                        }
                        //if (touchInfo.HitDetection(out beginObject, returnObj))
                        //{
                        //    touchTag = ObjectTag.ReturnObj;
                        //}
                        if (touchInfo.HitDetection(out beginObject, soundIcon))
                        {
                            touchTag = ObjectTag.Sound;
                        }
                    }
                    if (gesture == TouchGestureDetector.Gesture.Click)
                    {
                        GameObject hit;
                        if (touchTag == ObjectTag.Character &&
                            touchInfo.HitDetection(out hit, charaObj[2]))
                        {
                            galleryM.CharacterSpeak(person.voice);
                        }
                        if (touchTag == ObjectTag.Sound &&
                            touchInfo.HitDetection(out hit, soundIcon))
                        {
                            galleryM.CharacterSpeak(person.voice);
                        }
                        //if (touchTag == ObjectTag.ReturnObj
                        //&& touchInfo.HitDetection(out hit, returnObj))
                        //{
                        //    galleryM.ContentClose();
                        //}
                    }
                });
            }
        }
Beispiel #2
0
        void Initialize()
        {
            sceneFader           = SceneFader.Instance;
            touchGestureDetector = TouchGestureDetector.Instance;

            //Debug用にコメントアウト
            StartCoroutine(FlashObject(touchText));

            //touchGestureDetector = GameObject.Find("DemonicCity.TouchGestureDetector").GetComponent<TouchGestureDetector>();

            touchGestureDetector.onGestureDetected.AddListener((gesture, touchInfo) =>
            {
                if (gesture == TouchGestureDetector.Gesture.Click)
                {
                    if (isTrasing)
                    {
                        return;
                    }
                    GameObject hitObj = null;
                    touchInfo.HitDetection(out hitObj);
                    Debug.Log(hitObj.name);

                    Debug.Log("Hit");
                    if (IsPopUp)
                    {
                        //if (touchInfo.HitDetection(out hitObj, returnObj))
                        if (returnObj.name == hitObj.name)
                        {
                            CreditChange(false);
                        }
                    }
                    else
                    {
                        //if (touchInfo.HitDetection(out hitObj, configBtn))
                        if (hitObj.name == configBtn.name)
                        {
                            ConfigOpen();
                        }
                        else if (hitObj == CreditIcon)
                        {
                            CreditChange(true);
                        }
                        else if (!creditOpened)/*if (hitObj == null || hitObj.tag != "Button")*/
                        {
                            isTrasing = true;
                            SceneTrans();
                        }
                    }
                }
            });
        }
        public void Start()
        {
            m_touchGestureDetector = TouchGestureDetector.Instance; // shingleton,TouchGestureDetectorインスタンスの取得
            battleManager          = BattleManager.Instance;
            isSkillActivating      = true;

            // UnityEvent機能を使ってメソッドを登録する
            m_touchGestureDetector.onGestureDetected.AddListener((gesture, touchInfo) =>
            {
                if (isMoving || battleManager.m_StateMachine.m_State != BattleManager.StateMachine.State.PlayerChoice) // 枠移動中の時は終了
                {
                    return;
                }

                if (gesture == TouchGestureDetector.Gesture.TouchStationary)
                {
                    Debug.Log("Stationary");
                }

                switch (gesture)                                    // タッチ情報が左右のフリックだったら
                {
                case TouchGestureDetector.Gesture.FlickLeftToRight: // 右フリックの時,枠が左にいないときはひとつ左に動かす
                    switch (m_framePosition)
                    {
                    case FramePosition.Center:
                        StartCoroutine(MovingFrame(FramePosition.Left));
                        break;

                    case FramePosition.Right:
                        StartCoroutine(MovingFrame(FramePosition.Center));
                        break;
                    }
                    break;

                case TouchGestureDetector.Gesture.FlickRightToLeft:     // 左フリックの時,枠が右にいないときはひとつ右に動かす
                    switch (m_framePosition)
                    {
                    case FramePosition.Center:
                        StartCoroutine(MovingFrame(FramePosition.Right));
                        break;

                    case FramePosition.Left:
                        StartCoroutine(MovingFrame(FramePosition.Center));
                        break;
                    }
                    break;
                }
            });
        }
Beispiel #4
0
 public void Close(GameObject _obj)
 {
     obj = _obj;
     Debug.Log("jfkgod;sghu");
     progress = Progress.Instance;
     tgd      = TouchGestureDetector.Instance;
     tgd.onGestureDetected.AddListener((gesture, touchInfo) =>
     {
         if (isFirst)
         {
             Destroy(obj);
             isFirst = false;
         }
     });
 }
        private void Awake()
        {
            m_touchGestureDetector = TouchGestureDetector.Instance; // shingleton,TouchGestureDetectorインスタンスの取得
            m_battleManager        = BattleManager.Instance;        // shingleton,BattleManagerインスタンスの取得
            m_magia = Magia.Instance;                               // 参照取得

            m_battleManager.m_BehaviourByState.AddListener((state) =>
            {
                // init時マギアの形態に応じてユニークスキルの条件値を設定する
                if (state == BattleManager.StateMachine.State.Init)
                {
                    //Condition = m_magia.UniqueSkillConditionByAttribute;
                }
            });
        }
Beispiel #6
0
 private void Awake()
 {
     m_touchGestureDetector = TouchGestureDetector.Instance;
 }
 void Awake()
 {
     tGD = TouchGestureDetector.Instance;
 }
 //GameObject nowWindow;
 void Awake()
 {
     soundM = SoundManager.Instance;
     touchGestureDetector = TouchGestureDetector.Instance;
     sceneFader           = SceneFader.Instance;
 }
Beispiel #9
0
 void Awake()
 {
     windowRect            = GetComponent <RectTransform>();
     windowRect.localScale = Vector3.zero;
     touchGestureDetector  = TouchGestureDetector.Instance;
 }