您最多选择25个主题
主题必须以中文或者字母或数字开头,可以包含连字符 (-),并且长度不得超过35个字符
48 行
1.2 KiB
48 行
1.2 KiB
using System.Collections;
|
|
using System.Collections.Generic;
|
|
using UnityEngine;
|
|
using UnityEngine.Playables;
|
|
using UnityEngine.Animations;
|
|
|
|
public class WeaponAttachPlayable : PlayableBehaviour
|
|
{
|
|
|
|
public void Initialize(Transform weaponAttacher, Transform weaponRoot)
|
|
{
|
|
m_weaponAttacher = weaponAttacher;
|
|
m_weaponRoot = weaponRoot;
|
|
|
|
|
|
}
|
|
|
|
public override void PrepareFrame(Playable playable, FrameData info)
|
|
{
|
|
if (m_weaponAttacher != null && m_weaponRoot != null)
|
|
{
|
|
m_weaponRoot.position = m_weaponAttacher.position;
|
|
m_weaponRoot.rotation = m_weaponAttacher.rotation;
|
|
}
|
|
|
|
base.PrepareFrame(playable, info);
|
|
}
|
|
|
|
public override void ProcessFrame(Playable playable, FrameData info, object playerData)
|
|
{
|
|
//m_weaponRoot.position = m_weaponAttacher.position;
|
|
//m_weaponRoot.rotation = m_weaponAttacher.rotation;
|
|
|
|
//playable
|
|
//AnimationPlayableGraphExtensions
|
|
//AnimationPlayableUtilities..
|
|
//PlayableOutputExtensions
|
|
//PlayableExtensions
|
|
//playable.GetInput()
|
|
|
|
|
|
base.ProcessFrame(playable, info, playerData);
|
|
}
|
|
|
|
Transform m_weaponAttacher;
|
|
Transform m_weaponRoot;
|
|
}
|
|
|