soundvision/UnityProject/Assets/Scenes/Examples/MIDI/script/OrangeCubeScript.cs

31 lines
478 B
C#
Raw Normal View History

2019-10-31 17:37:03 +00:00
using System;
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class OrangeCubeScript : MonoBehaviour
{
public bool go;
private Animator anim;
void Start()
{
anim = GetComponent<Animator>();
}
public void Go()
{
go = true;
}
private void Update()
{
if (go == true)
{
gameObject.GetComponent<Animator>().SetTrigger("AnimTrigger");
}
}
}