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 (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(); } } }