mirror of
https://github.com/Leahnaya/TheKingsRace.git
synced 2026-08-23 10:54:24 -05:00
King UI Started
>King has a UI with buttons >Clicking the buttons is parsed into the correct function >Grid and Placement still needs to be implemented
This commit is contained in:
File diff suppressed because it is too large
Load Diff
64
Assets/Scripts/KingScripts/KingPlace.cs
Normal file
64
Assets/Scripts/KingScripts/KingPlace.cs
Normal file
@@ -0,0 +1,64 @@
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using UnityEngine;
|
||||
|
||||
public class KingPlace : MonoBehaviour
|
||||
{
|
||||
//Is called when the King clicks on the Block button
|
||||
public void OnBlockClicked() {
|
||||
PlaceObject(0);
|
||||
}
|
||||
|
||||
//Is called when the King clicks on the Hail button
|
||||
public void OnHailClicked() {
|
||||
PlaceObject(1);
|
||||
}
|
||||
|
||||
//Is called when the King clicks on the Slime button
|
||||
public void OnSlimeClicked() {
|
||||
PlaceObject(2);
|
||||
}
|
||||
|
||||
public GameObject Thunderstorm;
|
||||
//Is called when the King clicks on the Thunderstorm button
|
||||
public void OnThundClicked() {
|
||||
|
||||
}
|
||||
|
||||
|
||||
public GameObject Block;
|
||||
public GameObject Hail;
|
||||
public GameObject Slime;
|
||||
|
||||
private void PlaceObject(int ID) {
|
||||
//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
|
||||
case 0:
|
||||
Debug.Log("B");
|
||||
Place = Block;
|
||||
break;
|
||||
case 1:
|
||||
Debug.Log("H");
|
||||
Place = Hail;
|
||||
break;
|
||||
case 2:
|
||||
Debug.Log("S");
|
||||
Place = Slime;
|
||||
break;
|
||||
}
|
||||
//Layout the grid
|
||||
/* Have grid always existing? and Enable it for the King to see?
|
||||
* Draw the grid dynamically based on the King's Camera?
|
||||
* Draw it/Have it show up around the mouse cursor?
|
||||
*/
|
||||
|
||||
//The player selects where on the grid they want to place the object
|
||||
/* Center anchored
|
||||
* Should be "simple" to snap the cursor poistion onto the grid.
|
||||
*/
|
||||
|
||||
//The object is placed there
|
||||
//Energy is spent
|
||||
}
|
||||
}
|
||||
11
Assets/Scripts/KingScripts/KingPlace.cs.meta
Normal file
11
Assets/Scripts/KingScripts/KingPlace.cs.meta
Normal file
@@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 1b197075b52c7e644a525bf0ff3f69a7
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -6,32 +6,32 @@ EditorUserSettings:
|
||||
serializedVersion: 4
|
||||
m_ConfigSettings:
|
||||
RecentlyUsedScenePath-0:
|
||||
value: 224247031146466f181a033019225303593b17282e3169032e2c1336f1af073be7e933d6ca3b36327717e1351027
|
||||
flags: 0
|
||||
RecentlyUsedScenePath-1:
|
||||
value: 224247031146466f181a033019225303593b17282e3169032e2c1336f1af073be7e933d6ca3f31297717e1351027
|
||||
flags: 0
|
||||
RecentlyUsedScenePath-2:
|
||||
RecentlyUsedScenePath-1:
|
||||
value: 22424703114646680e0b0227036c6f02131b172b282d347e38271427fb
|
||||
flags: 0
|
||||
RecentlyUsedScenePath-2:
|
||||
value: 22424703114646680e0b0227036c7b151b180b6505263035233d1221fbd33134e7e422e0e8347129370bfb25
|
||||
flags: 0
|
||||
RecentlyUsedScenePath-3:
|
||||
value: 22424703114646680e0b0227036c7b151b180b6505263035233d1221fbd33134e7e422e0e8347129370bfb25
|
||||
flags: 0
|
||||
RecentlyUsedScenePath-4:
|
||||
value: 224247031146467c0c03096f3d2c4a1e02161124623d28393930
|
||||
flags: 0
|
||||
RecentlyUsedScenePath-5:
|
||||
RecentlyUsedScenePath-4:
|
||||
value: 22424703114646680e0b0227036c7b151b180b6505263035233d1221fbd33134e7e422e0e8347129370bfb25
|
||||
flags: 0
|
||||
RecentlyUsedScenePath-6:
|
||||
RecentlyUsedScenePath-5:
|
||||
value: 22424703114646680e0b0227036c7b151b180b650d262f3d192c0e27d1e33136e7a923e7ee2e26
|
||||
flags: 0
|
||||
RecentlyUsedScenePath-7:
|
||||
RecentlyUsedScenePath-6:
|
||||
value: 22424703114646680e0b0227036c6f02131b172b282d347e38271427fb
|
||||
flags: 0
|
||||
RecentlyUsedScenePath-8:
|
||||
RecentlyUsedScenePath-7:
|
||||
value: 22424703114646680e0b0227036c78111b125507233d28242c20137df7ee3d2cfb
|
||||
flags: 0
|
||||
RecentlyUsedScenePath-8:
|
||||
value: 22424703114646680e0b0227036c731f1415016439262f2434
|
||||
flags: 0
|
||||
RecentlyUsedScenePath-9:
|
||||
value: 22424703114646680e0b0227036c7b151b180b650721283704240d7df7ee3d2cfb
|
||||
flags: 0
|
||||
|
||||
Reference in New Issue
Block a user