// Update is called once per frame
    void Update()
    {
        if (InventoryManager.isChanged == true)         // There is a change
        {
            ChangeEquipmentType();
            InventoryManager.isChanged = false;
        }

        if (Swipe.GetInstance().GetSwipeUp())
        {
            if (RectTransformUtility.RectangleContainsScreenPoint(ItemSelectionTransform, Swipe.GetInstance().GetLastTouchedPosition()))
            {
                ShiftUp();
            }
        }
        else if (Swipe.GetInstance().GetSwipeDown())
        {
            if (RectTransformUtility.RectangleContainsScreenPoint(ItemSelectionTransform, Swipe.GetInstance().GetLastTouchedPosition()))
            {
                ShiftDown();
            }
        }
        if (EMScript.isShown && isShown)
        { // If both are showiing
            EquipButton.SetActive(true);
        }
        else
        { // If both aren't showing
            EquipButton.SetActive(false);
        }
    }
Ejemplo n.º 2
0
 // Function to Check if
 // A Language Flag was Selected
 private void DetectLanguageChange()
 {
     // check tapped which flag
     // 9 = Language Layer
     if (Swipe.GetInstance().GetCurrentSelectedGO().layer == 9)
     {
         // Find the Child with the script LanguageChange
         GameObject.Find("Language_IMG").GetComponent <LanguageChange>().ChangeLanguage(Swipe.GetInstance().GetCurrentSelectedGO().name);
     }
 }
Ejemplo n.º 3
0
    // Update is called once per frame
    void Update()
    {
        if (Swipe.GetInstance().GetSwipeRight())
        {
            LeftScene.gameObject.SetActive(true);
            LeftScene.GetComponent <RectTransform>().DOAnchorPosX(0, 0.4f, true);

            if (currentScene == Scenes.JournalScene)
            { // All the way to the left
                GetComponent <GoToNewScene>().GoToNewScene_INT_Timer((int)Scenes.CharacterScene, 0.4f);
            }
            else
            {
                GetComponent <GoToNewScene>().GoToNewScene_INT_Timer((int)currentScene - 1, 0.4f);
            }
        }
        else if (Swipe.GetInstance().GetSwipeLeft())
        {
            RightScene.gameObject.SetActive(true);
            RightScene.GetComponent <RectTransform>().DOAnchorPosX(0, 0.4f, true);

            if (currentScene == Scenes.CharacterScene)
            { // All the way to the left
                GetComponent <GoToNewScene>().GoToNewScene_INT_Timer((int)Scenes.JournalScene, 0.4f);
            }
            else
            {
                GetComponent <GoToNewScene>().GoToNewScene_INT_Timer((int)currentScene + 1, 0.4f);
            }
        }
        else if (Swipe.GetInstance().GetSwipeUp())
        {
            if (currentScene == Scenes.InventoryScene)
            {
                for (int i = 0; i < InventoryRectTransform.Length; ++i)
                {
                    if (RectTransformUtility.RectangleContainsScreenPoint(InventoryRectTransform[i], Swipe.GetInstance().GetLastTouchedPosition()))
                    {
                        return;
                    }
                }
                // Hard coded here for now because not enough time to change all the scenes to haev a collider box
                // for checking if they are going to swipe up
                // Only inventory has this issue
            }
            GameScene.gameObject.SetActive(true);
            GameScene.GetComponent <RectTransform>().DOAnchorPosY(0, 0.4f, true);

            GetComponent <GoToNewScene>().GoToNewScene_INT_Timer((int)Scenes.Game_Scene, 0.4f);
        }
    }
 // Update is called once per frame
 void Update()
 {
     if (Swipe.GetInstance().GetSwipeUp())
     {
         if (RectTransformUtility.RectangleContainsScreenPoint(EquipmentBoxTransform, Swipe.GetInstance().GetLastTouchedPosition()))
         {
             ShiftUp();
         }
     }
     else if (Swipe.GetInstance().GetSwipeDown())
     {
         if (RectTransformUtility.RectangleContainsScreenPoint(EquipmentBoxTransform, Swipe.GetInstance().GetLastTouchedPosition()))
         {
             ShiftDown();
         }
     }
 }
Ejemplo n.º 5
0
    // Update is called once per frame
    void Update()
    {
        DoneRotate();

        // if currently rotating, don't
        // get new input
        if (rotating)
        {
            return;
        }

        // Detect Right Swipe
        if (Swipe.GetInstance().GetSwipeRight())
        {
            GameObject lastHitGo = Swipe.GetInstance().GetCurrentSelectedGO();

            if (lastHitGo == null)
            {
                RotateRight();
            }
            else if (lastHitGo.tag != "EditableUI")
            {
                RotateRight();
            }
        }
        // Detect Left Swipe
        else if (Swipe.GetInstance().GetSwipeLeft())
        {
            GameObject lastHitGo = Swipe.GetInstance().GetCurrentSelectedGO();

            if (lastHitGo == null)
            {
                RotateLeft();
            }
            else if (lastHitGo.tag != "EditableUI")
            {
                RotateLeft();
            }
        }
    }
Ejemplo n.º 6
0
    // Update is called once per frame
    void Update()
    {
        // Check if there any popUps active now
        if (GetComponent <ActivatePopUp>().GetPopActive())
        {
            return;
        }

        // Detect Up Swipe
        if (Swipe.GetInstance().GetSwipeUp())
        {
            // NO active PopUps, so go to GameScene
            //// Activate FAKE GameScreen
            //screens[2].SetActive(true);

            //float slideUpTime = 0.4f;
            //// DOTween the screens up
            //GameObject.Find("MapStuff").GetComponent<RectTransform>().DOAnchorPosY(1682.0f, slideUpTime, true);
            //// Start Timer to Change Scene
            //GetComponent<GoToNewScene>().GoToNewScene_STRING_Timer("Game_Scene", slideUpTime);
            GoToFakeGameScene();
        }
    }
Ejemplo n.º 7
0
    // Update is called once per frame
    void Update()
    {
        // If at option Pannel...
        if (RotatePivot.GetInstance().GetPannelIndex() == 3 ||
            RotatePivot.GetInstance().GetPannelIndex() == 7)
        {
            // If a GO was Clicked
            if (Swipe.GetInstance().GetCurrentSelectedGO() != null)
            {
                // Detect Language Clicking
                DetectLanguageChange();
            }

            // Detect Up Swipe
            if (Swipe.GetInstance().GetSwipeUp())
            {
                float finalHeight = rectTransform.anchoredPosition.y + (Swipe.GetInstance().GetSwipeDelta().y * 9.0f);
                if (finalHeight > maxHeight)
                {
                    rectTransform.DOAnchorPosY(maxHeight, 0.5f, true);
                }
                else
                {
                    rectTransform.DOAnchorPosY(finalHeight, 0.5f, true);
                }

                Debug.Log("UP SWIPE!!");
            }
            // Detect Down Swipe
            else if (Swipe.GetInstance().GetSwipeDown())
            {
                float finalHeight = rectTransform.anchoredPosition.y + (Swipe.GetInstance().GetSwipeDelta().y * 9.0f);
                if (finalHeight < minHeight)
                {
                    rectTransform.DOAnchorPosY(minHeight, 0.5f, true);
                }
                else
                {
                    rectTransform.DOAnchorPosY(finalHeight, 0.5f, true);
                }

                Debug.Log("DOWN SWIPE!!");
            }


            // Detect Right Swipe
            if (Swipe.GetInstance().GetSwipeRight())
            {
                // if within the shortcut section and swiped
                if (RectTransformUtility.RectangleContainsScreenPoint(shortCutSectionTransform, Swipe.GetInstance().GetLastTouchedPosition()))
                {
                    shortCutSectionTransform.DOAnchorPosX(minShortcutX, 0.4f, true);
                }
            }
            // Detect Left Swipe
            else if (Swipe.GetInstance().GetSwipeLeft())
            {
                // if within the shortcut section and swiped
                if (RectTransformUtility.RectangleContainsScreenPoint(shortCutSectionTransform, Swipe.GetInstance().GetLastTouchedPosition()))
                {
                    shortCutSectionTransform.DOAnchorPosX(maxShortcutX, 0.4f, true);
                }
            }
        }   // End of Panel Checking
    }