コード例 #1
0
 /// <summary>
 /// On run, this reassigns all the necessary events based on the data from the clip
 /// </summary>
 protected virtual void Awake()
 {
     if (player == null)
     {
         player = GetComponent <VideoPlayer>();
     }
     videoClipBakedMethods = new VideoClipBakedMethods(clip, data);
     videoClipBakedMethods.GetVideoClipEvents();
     videoClipBakedMethods.AssignEvents(GetComponentsInChildren <Component>());
     time = player.time.ToTime();
     Debug.Log(videoClipBakedMethods.MethodData());
 }
コード例 #2
0
ファイル: VideoClipData.cs プロジェクト: swipswaps/FMVTools
        public void OnBeforeSerialize()
        {
            if (videoClip == null)
            {
                return;
            }
            VideoClipImporter importer = (VideoClipImporter)AssetImporter.GetAtPath(videoClip.originalPath);

            userData     = importer.userData;
            bakedMethods = new VideoClipBakedMethods(videoClip, userData);
            if (calllingPrefab != null)
            {
                bakedMethods.AssignEvents(calllingPrefab.GetComponentsInChildren <Component>());
            }
        }
コード例 #3
0
        /// <summary>
        /// Gets all the user data from the video clip and caches the video player
        /// </summary>
        public void Init()
        {
            if (player == null)
            {
                player = GetComponent <VideoPlayer>();
            }
            clip = player.clip;
            if (clip == null)
            {
                return;
            }

            videoClipBakedMethods = new VideoClipBakedMethods(clip);
            data = videoClipBakedMethods.ClipEventData;
            videoClipBakedMethods.AssignEvents(GetComponentsInChildren <Component>());
            EditorUtility.SetDirty(this);
        }