panel to toggle nodding on/off
This commit is contained in:
33
Assets/Project Files/Scripts/Arlo/Menu.cs
Normal file
33
Assets/Project Files/Scripts/Arlo/Menu.cs
Normal file
@@ -0,0 +1,33 @@
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using UnityEngine;
|
||||
using UnityEngine.InputSystem;
|
||||
|
||||
public class Menu : MonoBehaviour
|
||||
{
|
||||
public InputActionReference toggleReference;
|
||||
|
||||
// Start is called before the first frame update
|
||||
void Awake()
|
||||
{
|
||||
toggleReference.action.started += Toggle;
|
||||
}
|
||||
|
||||
private void OnDestroy()
|
||||
{
|
||||
toggleReference.action.started -= Toggle;
|
||||
}
|
||||
|
||||
void Toggle(InputAction.CallbackContext context)
|
||||
{
|
||||
bool isActive = gameObject.active;
|
||||
gameObject.SetActive(!isActive);
|
||||
}
|
||||
|
||||
// Update is called once per frame
|
||||
void Update()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
11
Assets/Project Files/Scripts/Arlo/Menu.cs.meta
Normal file
11
Assets/Project Files/Scripts/Arlo/Menu.cs.meta
Normal file
@@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 41ffdfe527a79fa45b656f44cfa8354c
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -28,4 +28,10 @@ public class NoddingMovement : MonoBehaviour
|
||||
transform.Translate(new Vector3(camera.transform.forward.x, 0, camera.transform.forward.z) * speed * Time.deltaTime * (camera.transform.eulerAngles.x-360));
|
||||
}
|
||||
}
|
||||
|
||||
public void toggle()
|
||||
{
|
||||
bool isActive = this.enabled;
|
||||
this.enabled = (!isActive);
|
||||
}
|
||||
}
|
||||
|
||||
21
Assets/Project Files/Scripts/Arlo/TestRotator.cs
Normal file
21
Assets/Project Files/Scripts/Arlo/TestRotator.cs
Normal file
@@ -0,0 +1,21 @@
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using UnityEngine;
|
||||
|
||||
public class TestRotator : MonoBehaviour
|
||||
{
|
||||
|
||||
private GameObject cube;
|
||||
|
||||
// Start is called before the first frame update
|
||||
void Start()
|
||||
{
|
||||
cube = GameObject.Find("Cube (1)");
|
||||
}
|
||||
|
||||
// Update is called once per frame
|
||||
void Update()
|
||||
{
|
||||
cube.transform.Rotate(0, 1, 0);
|
||||
}
|
||||
}
|
||||
11
Assets/Project Files/Scripts/Arlo/TestRotator.cs.meta
Normal file
11
Assets/Project Files/Scripts/Arlo/TestRotator.cs.meta
Normal file
@@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: cac7efaf757714d46ab11db403422423
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
Reference in New Issue
Block a user