init
This commit is contained in:
33
Assets/Scripts/Demo.cs
Normal file
33
Assets/Scripts/Demo.cs
Normal file
@@ -0,0 +1,33 @@
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using UnityEngine;
|
||||
using UnityEngine.InputSystem.HID;
|
||||
using UnityEngine.UI;
|
||||
|
||||
public class Demo : MonoBehaviour
|
||||
{
|
||||
[SerializeField]
|
||||
private ObjectQ _queue;
|
||||
|
||||
[SerializeField] private Button previousBtn;
|
||||
[SerializeField] private Button nextBtn;
|
||||
|
||||
void Awake()
|
||||
{
|
||||
GameObject cube = GameObject.CreatePrimitive(PrimitiveType.Cube);
|
||||
GameObject sphere = GameObject.CreatePrimitive(PrimitiveType.Sphere);
|
||||
GameObject capsule = GameObject.CreatePrimitive(PrimitiveType.Capsule);
|
||||
GameObject cylinder = GameObject.CreatePrimitive(PrimitiveType.Cylinder);
|
||||
GameObject plane = GameObject.CreatePrimitive(PrimitiveType.Quad);
|
||||
|
||||
_queue.Add(cube);
|
||||
_queue.Add(sphere);
|
||||
_queue.Add(capsule);
|
||||
_queue.Add(cylinder);
|
||||
_queue.Add(plane);
|
||||
|
||||
previousBtn.onClick.AddListener(() => _queue.Change(true));
|
||||
nextBtn.onClick.AddListener(() => _queue.Change(false));
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user