You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
32 lines
871 B
32 lines
871 B
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); |
|
} |
|
} |
|
|
|
|
|
}
|
|
|