Skip to content

Instantly share code, notes, and snippets.

@chittai
Last active January 7, 2019 14:16
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save chittai/2c9959a16b433e7e0d8b1ffff9907324 to your computer and use it in GitHub Desktop.
Save chittai/2c9959a16b433e7e0d8b1ffff9907324 to your computer and use it in GitHub Desktop.
Chronosを使用してトリガーを押している間はAreaClockが有効になるようにしている
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class AreaClockMaking : MonoBehaviour {
public GameObject areaClock;
private GuageDecreasing _guageDecreasing;
void Start () {
_guageDecreasing = GetComponent<GuageDecreasing>();
}
void Update () {
if (OVRInput.Get(OVRInput.Button.PrimaryIndexTrigger) && _guageDecreasing.restGuage >= 0)
{
areaClock.SetActive(true);
_guageDecreasing.Decreasing();
}
else
{
areaClock.SetActive(false);
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment