예제 #1
0
    void Update()
    {
        if (inputManager.IsTriggerClicked() && rayCast.Hit() && canClick)
        {
            if (rayCast.GetHit().transform.name == "Save")
            {
                if (savingManager.GetCurrentSaveID().Length == 3)
                {
                    savingManager.UpdateCurrentSave();
                }
                else
                {
                    //TODO: Display Message
                }
                canClick = false;
            }
            else if (rayCast.GetHit().transform.name == "SaveAs")
            {
                IDSelectorUIHandler idSelectorUIHandler = transform.GetChild(0).Find("IDSelectorUI").GetComponent <IDSelectorUIHandler>();
                string saveID = idSelectorUIHandler.GetCurrentID();

                Debug.Log(saveID);
                // TODO: display override message
                savingManager.SaveGameObjects(saveID);

                canClick = false;
            }
        }
        if (!canClick)
        {
            canClick = !inputManager.IsTriggerClicked();
        }
    }
예제 #2
0
    public void Update()
    {
        selector.SetActive(false);

        if (rayCast.Hit())
        {
            if (rayCast.GetHit().transform.name == "MozartHausMenuButton")
            {
                selector.SetActive(true);
                selector.GetComponent <RectTransform>().anchoredPosition = MOZART_HAUS_MENU_BUTTON_POSITION;

                if (inputManager.IsTriggerClicked())
                {
                    TeleportToMozartHaus();
                }
            }
            else if (rayCast.GetHit().transform.name == "AppartementsMenuButton")
            {
                selector.SetActive(true);
                selector.GetComponent <RectTransform>().anchoredPosition = APPARTEMENTS_MENU_BUTTON_POSITION;

                //TODO implement function when IsTriggerClicked() == true
            }
            else if (rayCast.GetHit().transform.name == "ParametersMenuButton")
            {
                selector.SetActive(true);
                selector.GetComponent <RectTransform>().anchoredPosition = PARAMETERS_MENU_BUTTON_POSITION;

                //TODO: implement function when IsTriggerClicked() == true
            }
        }
    }
예제 #3
0
 void Update()
 {
     if (modHandler.IsInRemoveMod() && rayCast.HitFurniture())
     {
         if (inputManager.IsTriggerClicked() && canClick)
         {
             if (modHandler.IsInRemoveMod() && rayCast.HitFurniture())
             {
                 canClick = false;
                 rayCast.GetHit().transform.position = new Vector3(0, -50, 0);
                 networkManager.SendFurniturePosUpdate(rayCast.GetHit().transform.gameObject);
             }
         }
     }
     if (!canClick)
     {
         canClick = !inputManager.IsTriggerClicked();
     }
 }
 void Update()
 {
     if (inputManager.IsTriggerClicked() && canTeleport && modHandler.IsInUtilitiesMod() && rayCast.Hit())
     {
         Teleport(rayCast.GetHit());
         canTeleport = false;
     }
     else if (!canTeleport)
     {
         canTeleport = !inputManager.IsTriggerClicked();
     }
 }
예제 #5
0
 void Update()
 {
     if (rayCast.Hit())
     {
         laserLine.enabled = true;
         UpdateLaserPos(rayCast.GetHit());
         UpdateLaserColor();
     }
     else
     {
         laserLine.enabled = false;
     }
 }
예제 #6
0
    void Update()
    {
        if (modHandler.IsInEditionMod() && rayCast.Hit())
        {
            if (inputManager.IsTriggerClicked() && canClick)
            {
                canClick = false;

                if (isOnDrag) // Place Game Object
                {
                    furnitureSelected.GetComponent <Collider>().enabled = true;
                    furnitureSelected = null;

                    isOnDrag = false;
                }
                else if (rayCast.HitFurniture() && !isClicked && !isOnDrag) // Select Game Object
                {
                    furnitureSelected = GameObject.Find(rayCast.GetHit().transform.name);
                    isClicked         = true;
                }
                else if (isClicked && !isOnDrag && !movableUIHandler.HitMovableUI()) // UnSelect Game Object
                {
                    DestroyMovableUI();

                    isClicked = false;
                }
            }
            if (isOnDrag) // Move Game Object
            {
                UpdateFurniturePosition(rayCast.GetHit());
                networkManager.SendFurniturePosUpdate(furnitureSelected);
            }

            if (!canClick)
            {
                canClick = !inputManager.IsTriggerClicked();
            }
        }
    }
    void Update()
    {
        if (inputManager.IsTriggerClicked() && rayCast.Hit() && canClick)
        {
            canClick = false;

            if (rayCast.GetHit().transform.name == "ButtonDown")
            {
                Text currentLetterSelector = rayCast.GetHit().transform.parent.Find("LetterView").GetComponentInChildren <Text>();
                currentLetterSelector.text = GetNextChar(currentLetterSelector.text[0]).ToString();
            }
            else if (rayCast.GetHit().transform.name == "ButtonUp")
            {
                Text currentLetterSelector = rayCast.GetHit().transform.parent.Find("LetterView").GetComponentInChildren <Text>();
                currentLetterSelector.text = GetPreviousChar(currentLetterSelector.text[0]).ToString();
            }
        }

        if (!canClick)
        {
            canClick = !inputManager.IsTriggerClicked();
        }
    }
예제 #8
0
    private void Select()
    {
        if (!modHandler.IsInEditionMod() || !inputManager.IsTriggerClicked())
        {
            return;
        }

        if (!rayCast.Hit())
        {
            return;
        }

        canClick = false;
        Transform hitObject = rayCast.GetHit().transform;

        if (hitObject.parent == leftSide.transform)
        {
            UpdateRightUIPart(hitObject.GetSiblingIndex());
        }
        else if (hitObject.parent == rightSide.transform)
        {
            dragFurniture.SelectObject(GameObject.Find((rayCast.GetHit().transform.GetChild(0).GetComponent <Text>().text)));
        }
    }
예제 #9
0
    void Update()
    {
        if (inputManager.IsTriggerClicked() && canClick && rayCast.Hit())
        {
            if (rayCast.GetHit().transform.name == "Load")
            {
                savingManager.LoadGameObjects(idSelectorUIHandler.GetCurrentID()); // TODO: Use return to display fail or success message
                canClick = false;
            }
        }

        if (!canClick)
        {
            canClick = !inputManager.IsTriggerClicked();
        }
    }
예제 #10
0
 private bool HitMoveButton()
 {
     return(rayCast.GetHit().transform.name == "MoveButton");
 }