playVideo()

public void playVideo(string videoName) {
        turnOffAllVideos();
        gameObject.GetComponent().enabled = true;
        foreach (GameObject videoGO in allVideos){
            if (videoGO.name == videoName){
                currentVideo = videoGO;
                currentVideo.SetActive(true);
                return;
            }
        }
        Debug.LogWarning("Video not found: " + videoName);
    }


Comments

Leave a Reply

Your email address will not be published. Required fields are marked *