Thursday, February 28, 2019

Unity 3d Play Video full script by allunityscripts

 Play Video

unity 3d  PlayVideo full script


using System.Collections;
using System.Collections.Generic;
using UnityEngine;

public class PlayVideo : MonoBehaviour {

    public GameObject videoPlayer;
    public int timeToStop;

// Use this for initialization
void Start () {
        videoPlayer.SetActive(false);
}

// Update is called once per frame
void OnTriggerEnter (Collider player) {

        if (player.gameObject.tag == "Player")
        {
            videoPlayer.SetActive(true);
            Destroy(videoPlayer, timeToStop);
        }
}
}

No comments:

Post a Comment