using System.Collections; using System.Collections.Generic; using UnityEngine; using HTC.UnityPlugin.Vive; public class ExplodeSphere : MonoBehaviour { public GameObject target; public GameObject Sphere; public GameObject explodeSystem; // Use this for initialization void Start () { } // Update is called once per frame void Update () { if (ViveInput.GetPressDown(HandRole.RightHand, ControllerButton.Trigger)) { GameObject Sphere_ = Instantiate(Sphere); Sphere_.transform.position = target.transform.position; Sphere_.SetActive(true); GameObject explodeSystem_ = Instantiate(explodeSystem); explodeSystem.transform.position = target.transform.position; Destroy(Sphere_, 5.0f); Destroy(explodeSystem_, 2.0f); } } }