panel to toggle nodding on/off

This commit is contained in:
2022-03-19 22:29:19 +02:00
parent 84e21c94f3
commit f76431d855
11 changed files with 1059 additions and 411 deletions

View 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()
{
}
}

View File

@@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: 41ffdfe527a79fa45b656f44cfa8354c
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -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);
}
}

View 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);
}
}

View File

@@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: cac7efaf757714d46ab11db403422423
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant: