Add video clips from Kuleshov Effect project.

This commit is contained in:
Kaj Forney 2022-09-27 12:42:51 -06:00
parent 7454e0af45
commit 7d53d6c968
Signed by: kforney
GPG key ID: 3AB4E2E04CEF656F
14 changed files with 169 additions and 0 deletions

8
Assets/Scripts.meta Normal file
View file

@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: a4cb8d90f9f1bea63a875f2f3d12e993
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

View file

@ -0,0 +1,52 @@
using System.Collections;
using System.Collections.Generic;
using UnityEngine.Video; //Must be using UnityEngine.Video
using UnityEngine;
public class VideoPlayerManager : MonoBehaviour
{
public VideoPlayer videoPlayer; //Our video player component variable. Can be set in inspector or through code in Start()
public VideoClip[] clips; //Array for video clips
// Start is called before the first frame update
void Start()
{
videoPlayer = GetComponent<VideoPlayer>(); //Stores our video player component into our videoPlayer variable
}
private void Update()
{
//Check to see if the current clip has ended. Once it's over, call to PlayClip()
if ((videoPlayer.frame) > 0 && (videoPlayer.isPlaying == false))
{
PlayClip();
}
}
public void PlayClip()
{
if (videoPlayer.clip == clips[0]) //Checks to see if the clip that just played was the first video
{
int randClip = Random.Range(1, 3); //Randomly picks one of the remaining three videos
videoPlayer.clip = clips[randClip]; //Sets the videoPlayer clip to the next chosen video
}
else if(videoPlayer.clip == clips[1] || videoPlayer.clip == clips[2] || videoPlayer.clip == clips[3]){
videoPlayer.clip = clips[4]; // play the last clip
}
else
{
videoPlayer.clip = clips[0]; //If the last played video wasn't the first video, then go back to playing that first video
}
}
}

View file

@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: 640f865f39e1d47c9b2502e979868765
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

8
Assets/VideoClips.meta Normal file
View file

@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: 81aae1cee259b1ab9a69f8faa177d72a
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

BIN
Assets/VideoClips/cat.webm Normal file

Binary file not shown.

View file

@ -0,0 +1,18 @@
fileFormatVersion: 2
guid: bd3717e5581a43f2ea1629c73a163135
VideoClipImporter:
externalObjects: {}
serializedVersion: 2
frameRange: 0
startFrame: -1
endFrame: -1
colorSpace: 0
deinterlace: 0
encodeAlpha: 0
flipVertical: 0
flipHorizontal: 0
importAudio: 1
targetSettings: {}
userData:
assetBundleName:
assetBundleVariant:

Binary file not shown.

View file

@ -0,0 +1,18 @@
fileFormatVersion: 2
guid: 1bf2926887e8b9c04950fe3e37e793b2
VideoClipImporter:
externalObjects: {}
serializedVersion: 2
frameRange: 0
startFrame: -1
endFrame: -1
colorSpace: 0
deinterlace: 0
encodeAlpha: 0
flipVertical: 0
flipHorizontal: 0
importAudio: 1
targetSettings: {}
userData:
assetBundleName:
assetBundleVariant:

Binary file not shown.

View file

@ -0,0 +1,18 @@
fileFormatVersion: 2
guid: 20882a4e0a23a94328050cfaf296aef4
VideoClipImporter:
externalObjects: {}
serializedVersion: 2
frameRange: 0
startFrame: -1
endFrame: -1
colorSpace: 0
deinterlace: 0
encodeAlpha: 0
flipVertical: 0
flipHorizontal: 0
importAudio: 1
targetSettings: {}
userData:
assetBundleName:
assetBundleVariant:

Binary file not shown.

View file

@ -0,0 +1,18 @@
fileFormatVersion: 2
guid: 84a18ffb520321a55a93df7f4a5924be
VideoClipImporter:
externalObjects: {}
serializedVersion: 2
frameRange: 0
startFrame: -1
endFrame: -1
colorSpace: 0
deinterlace: 0
encodeAlpha: 0
flipVertical: 0
flipHorizontal: 0
importAudio: 1
targetSettings: {}
userData:
assetBundleName:
assetBundleVariant:

BIN
Assets/VideoClips/tea.webm Normal file

Binary file not shown.

View file

@ -0,0 +1,18 @@
fileFormatVersion: 2
guid: ed8f71491616f4f5cbd476141cf177eb
VideoClipImporter:
externalObjects: {}
serializedVersion: 2
frameRange: 0
startFrame: -1
endFrame: -1
colorSpace: 0
deinterlace: 0
encodeAlpha: 0
flipVertical: 0
flipHorizontal: 0
importAudio: 1
targetSettings: {}
userData:
assetBundleName:
assetBundleVariant: