[TASK] Added more duck spawn, performance fixes, instruction in the minigame, option to zoom in on stickers
This commit is contained in:
40
Assets/CrystalFramework/Utility/Demos/SafeAreaDemo.cs
Normal file
40
Assets/CrystalFramework/Utility/Demos/SafeAreaDemo.cs
Normal file
@@ -0,0 +1,40 @@
|
||||
using UnityEngine;
|
||||
using System;
|
||||
|
||||
namespace Crystal
|
||||
{
|
||||
public class SafeAreaDemo : MonoBehaviour
|
||||
{
|
||||
[SerializeField] KeyCode KeySafeArea = KeyCode.A;
|
||||
SafeArea.SimDevice[] Sims;
|
||||
int SimIdx;
|
||||
|
||||
void Awake ()
|
||||
{
|
||||
if (!Application.isEditor)
|
||||
Destroy (gameObject);
|
||||
|
||||
Sims = (SafeArea.SimDevice[])Enum.GetValues (typeof (SafeArea.SimDevice));
|
||||
}
|
||||
|
||||
void Update ()
|
||||
{
|
||||
if (Input.GetKeyDown (KeySafeArea))
|
||||
ToggleSafeArea ();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Toggle the safe area simulation device.
|
||||
/// </summary>
|
||||
void ToggleSafeArea ()
|
||||
{
|
||||
SimIdx++;
|
||||
|
||||
if (SimIdx >= Sims.Length)
|
||||
SimIdx = 0;
|
||||
|
||||
SafeArea.Sim = Sims[SimIdx];
|
||||
Debug.LogFormat ("Switched to sim device {0} with debug key '{1}'", Sims[SimIdx], KeySafeArea);
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user