|
@@ -7,22 +7,12 @@ using UnityEngine.UI;
|
|
|
|
|
|
public class ToolsController : MonoBehaviour
|
|
|
{
|
|
|
- //public Button ButtonWall;
|
|
|
- //public Button ButtonRoom;
|
|
|
- //public Button ButtonDel;
|
|
|
public GameObject Cursor;
|
|
|
public int Rounding = 1;
|
|
|
- //public List<GameObject> Walls = new List<GameObject>();
|
|
|
|
|
|
enum Tools { Wall, Room, Del, Cursor};
|
|
|
Tools tools = Tools.Cursor;
|
|
|
|
|
|
- private Vector3 screenPoint;
|
|
|
- private Vector3 offset;
|
|
|
- private Vector3 curScreenPoint;
|
|
|
- private Vector3 curPosition;
|
|
|
-
|
|
|
- bool new_well = false;
|
|
|
|
|
|
// Start is called before the first frame update
|
|
|
void Start()
|
|
@@ -36,26 +26,22 @@ public class ToolsController : MonoBehaviour
|
|
|
|
|
|
}
|
|
|
|
|
|
+ public void CursorOff()
|
|
|
+ {
|
|
|
+ Cursor.SetActive(false);
|
|
|
+ tools = Tools.Cursor;
|
|
|
+ WallCreate.mode = WallCreate.Mode.Cursor;
|
|
|
+ }
|
|
|
+
|
|
|
public void WallEdit()
|
|
|
{
|
|
|
- //tools = Tools.Wall;
|
|
|
Cursor.SetActive(true);
|
|
|
WallCreate.mode = WallCreate.Mode.Wall;
|
|
|
- //var last = Walls.LastOrDefault();
|
|
|
- //if(last != null)last.GetComponent<RoomController>().BoxColliderEnabled = false;
|
|
|
}
|
|
|
|
|
|
|
|
|
public void RoomEdit()
|
|
|
{
|
|
|
- //tools = Tools.Room;
|
|
|
-
|
|
|
- //var Cube = Instantiate(Resources.Load("GameObjects/Cube", typeof(GameObject))) as GameObject;
|
|
|
- //LocationController.Cube(Cube, new Vector3(0.1f, 0.1f, 1));
|
|
|
- //Cube.AddComponent<RoomController>();
|
|
|
- ////Cube.transform.position = new Vector3(0.5f, 0.5f, 0.5f);
|
|
|
- //new_well = true;
|
|
|
- //Walls.Add(Cube);
|
|
|
Cursor.SetActive(true);
|
|
|
WallCreate.mode = WallCreate.Mode.Room;
|
|
|
}
|
|
@@ -65,31 +51,4 @@ public class ToolsController : MonoBehaviour
|
|
|
tools = Tools.Del;
|
|
|
}
|
|
|
|
|
|
- //void Editor()
|
|
|
- //{
|
|
|
- // switch (tools)
|
|
|
- // {
|
|
|
- // case Tools.Room:
|
|
|
- // var Cube = Instantiate(Resources.Load("GameObjects/Cube", typeof(GameObject))) as GameObject;
|
|
|
- // Cube.AddComponent<RoomController>();
|
|
|
- // Walls.Add(Cube);
|
|
|
- // break;
|
|
|
- // }
|
|
|
- //}
|
|
|
-
|
|
|
- //void OnMouseDown()
|
|
|
- //{
|
|
|
- // //Debug.Log(StagesEditorController.indexCursor);
|
|
|
- // switch (tools)
|
|
|
- // {
|
|
|
- // case Tools.Room:
|
|
|
- // screenPoint = Camera.main.WorldToScreenPoint(gameObject.transform.position);
|
|
|
- // offset = gameObject.transform.position - Camera.main.ScreenToWorldPoint(new Vector3(Input.mousePosition.x, Input.mousePosition.y, screenPoint.z));
|
|
|
- // break;
|
|
|
- // }
|
|
|
-
|
|
|
- //}
|
|
|
-
|
|
|
- // Перемещение
|
|
|
-
|
|
|
}
|