mirror of
https://github.com/Leahnaya/TheKingsRace.git
synced 2026-08-21 18:04:27 -05:00
King Menu
>Radial menu has been added in a rough state >Can be turned on and off
This commit is contained in:
@@ -46,7 +46,6 @@ public class KingPlace : NetworkBehaviour
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
public GameObject Block;
|
||||
public GameObject BlockWithoutNetwork;
|
||||
|
||||
|
||||
40
Assets/Scripts/KingScripts/RadialMenu.cs
Normal file
40
Assets/Scripts/KingScripts/RadialMenu.cs
Normal file
@@ -0,0 +1,40 @@
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using UnityEngine;
|
||||
|
||||
public class RadialMenu : MonoBehaviour
|
||||
{
|
||||
|
||||
bool UIOn = false;
|
||||
// Update is called once per frame
|
||||
void Update()
|
||||
{
|
||||
if (UIOn == false) {
|
||||
transform.position = Input.mousePosition;//Moved the UI to where the mouse is
|
||||
}
|
||||
if(Input.GetAxis("RadialMenu") > 0) {//Pressing Q makes the UI appear
|
||||
MenuOn();
|
||||
}
|
||||
if (Input.GetAxis("RadialMenu") < 0) {//Pressing E makes the UI dissapear
|
||||
MenuOff();
|
||||
}
|
||||
}
|
||||
|
||||
void MenuOn()
|
||||
{
|
||||
foreach (Transform child in transform) { //Turns on all of the different buttons attached to this panel and stops it from moving
|
||||
child.gameObject.SetActive(true);
|
||||
Debug.Log("Wax On");
|
||||
UIOn = true;
|
||||
}
|
||||
}
|
||||
|
||||
void MenuOff()
|
||||
{
|
||||
foreach (Transform child in transform) { //Turns off all of the different buttons attached to this panel and starts it moving again
|
||||
child.gameObject.SetActive(false);
|
||||
Debug.Log("Wax Off");
|
||||
UIOn = false;
|
||||
}
|
||||
}
|
||||
}
|
||||
11
Assets/Scripts/KingScripts/RadialMenu.cs.meta
Normal file
11
Assets/Scripts/KingScripts/RadialMenu.cs.meta
Normal file
@@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: d94be097208c22f4daa3776bd00128b4
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
Reference in New Issue
Block a user