Kings Grid Implemented

>King's UI can make the Grid appear
>King's movemnt allows the grid to dynamicaly enable and disable
>Code is designed to be flexiable to fit different sizings of
grids/King's FOV
This commit is contained in:
Katherine
2021-12-10 13:56:47 -06:00
parent 5a8b657e16
commit 5b28eb768d
5 changed files with 15244 additions and 27 deletions

View File

@@ -8,7 +8,7 @@ public class KingMove : MonoBehaviour
private Vector3 newPos;
private Vector3 MountCent = new Vector3(0, 30, -80);
private bool RotStr = false;
public GameObject Grid;
// Update is called once per frame
void Update() {
float translation = Input.GetAxis("HorizontalCam") * speed;
@@ -18,10 +18,10 @@ public class KingMove : MonoBehaviour
// Move translation along the object's z-axis
if (transform.position.z <= 61 && transform.position.z >= -80) {
transform.Translate(translation, 0, 0);//Is negated to make the Left arrow go left and the right arraow go right
transform.Translate(translation, 0, 0);
Grid.GetComponent<GridReveal>().DynGridReveal(transform.position.z, translation); //Makes the grid reveal itself as the King moves
//transform.position = new Vector3(-42, 30, transform.position.z);
transform.rotation = Quaternion.Euler(0, 90, 0);
RotStr = false;
}
else if (transform.position.z > 61) {
transform.position = new Vector3(-42, 30, 61);//Keeps them from going too far left

View File

@@ -29,8 +29,9 @@ public class KingPlace : MonoBehaviour
public GameObject Block;
public GameObject Hail;
public GameObject Slime;
public GameObject Grid;
private void PlaceObject(int ID) {
Grid.GetComponent<GridReveal>().GridSwitch(true);
//Switch statement, ID-0 = Block,ID-1 = Hail,ID-2 = Slime
GameObject Place;
switch (ID) {//Parses in the button clicked into the right object that the King is placing