2025-09-08 14:51:28 +08:00
|
|
|
|
using System.Collections;
|
|
|
|
|
|
using System.Collections.Generic;
|
|
|
|
|
|
using UnityEngine;
|
|
|
|
|
|
using UnityEngine.Playables;
|
|
|
|
|
|
using ZXKFramework;
|
|
|
|
|
|
|
|
|
|
|
|
public class ClipItem : MonoBehaviour
|
|
|
|
|
|
{
|
|
|
|
|
|
PlayableDirector initClip;
|
2025-09-10 19:05:05 +08:00
|
|
|
|
|
|
|
|
|
|
[HideInInspector]
|
|
|
|
|
|
public PlayableDirector playClip;
|
|
|
|
|
|
// PlayableDirector endClip;
|
2025-09-08 14:51:28 +08:00
|
|
|
|
public void Init()
|
|
|
|
|
|
{
|
|
|
|
|
|
transform.FindFirst<Transform>("Init").TryGetComponent(out initClip);
|
2025-09-10 19:05:05 +08:00
|
|
|
|
if (transform.FindFirst<Transform>("Play").TryGetComponent(out playClip))
|
2025-09-08 14:51:28 +08:00
|
|
|
|
{
|
|
|
|
|
|
////<2F><>playClip<69><70>ֹͣ<CDA3><D6B9><EFBFBD><EFBFBD>ִ<EFBFBD><D6B4>initClip<69><70>ʼ<EFBFBD><CABC><EFBFBD>˲<EFBFBD><CBB2><EFBFBD>
|
|
|
|
|
|
//playClip.paused += args =>
|
|
|
|
|
|
//{
|
|
|
|
|
|
// initClip?.Play();
|
|
|
|
|
|
//};
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
public void PlayReset()
|
|
|
|
|
|
{
|
|
|
|
|
|
initClip?.Play();
|
|
|
|
|
|
}
|
|
|
|
|
|
public void PlayNormal()
|
|
|
|
|
|
{
|
|
|
|
|
|
playClip?.Play();
|
|
|
|
|
|
}
|
|
|
|
|
|
public void StopNormal()
|
|
|
|
|
|
{
|
|
|
|
|
|
playClip?.Stop();
|
|
|
|
|
|
}
|
|
|
|
|
|
public float GetNormalLength()
|
|
|
|
|
|
{
|
|
|
|
|
|
return (float)playClip.duration;
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|