working toolbar

This commit is contained in:
klemek
2020-12-15 14:28:00 +01:00
parent e28d91e6bd
commit 78fe021014
11 changed files with 386 additions and 528 deletions
+13
View File
@@ -27,6 +27,9 @@ namespace UntitledLogicGame
public Color DeadColor;
public Color ActivatedColor;
[Header("Gates")]
public List<Gate> GatePrefabs;
#endregion
#region Public Properties
@@ -35,6 +38,8 @@ namespace UntitledLogicGame
public Gate CurrentGate { get; set; }
public MouseManager MouseManager { get; private set; }
#endregion
#region Private Properties
@@ -49,6 +54,7 @@ namespace UntitledLogicGame
if (Instance != null)
throw new InvalidOperationException("More than one GameManager in scene");
Instance = this;
MouseManager = GetComponent<MouseManager>();
}
// Update is called once per frame
@@ -61,6 +67,13 @@ namespace UntitledLogicGame
#region Public Methods
public void CreateGate(Gate gatePrefab, Vector3 position)
{
var gate = Instantiate(gatePrefab, GatesGroup);
gate.transform.position = MouseManager.MousePos - gate.Box.transform.position;
MouseManager.DragGate(gate, true);
}
#endregion
#region Private Methods