You cannot select more than 25 topics
			Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
		
		
		
		
		
			
		
			
	
	
		
			37 lines
		
	
	
		
			1.3 KiB
		
	
	
	
		
			C#
		
	
		
		
			
		
	
	
			37 lines
		
	
	
		
			1.3 KiB
		
	
	
	
		
			C#
		
	
| 
											2 years ago
										 | using UnityEngine; | ||
|  | using UnityEngine.Playables; | ||
|  | using Game; | ||
|  | 
 | ||
|  | public class AttackMixerBehaviour : PlayableBehaviour | ||
|  | { | ||
|  |     // NOTE: This function is called at runtime and edit time.  Keep that in mind when setting the values of properties. | ||
|  |     public override void ProcessFrame(Playable playable, FrameData info, object playerData) | ||
|  |     { | ||
|  |         Transform trackBinding = playerData as Transform; | ||
|  | 
 | ||
|  |         if (!trackBinding) | ||
|  |             return; | ||
|  | 
 | ||
|  |         int inputCount = playable.GetInputCount(); | ||
|  | 
 | ||
|  |         for (int i = 0; i < inputCount; i++) | ||
|  |         { | ||
|  |             float inputWeight = playable.GetInputWeight(i); | ||
|  |             ScriptPlayable<AttackBehaviour> inputPlayable = (ScriptPlayable<AttackBehaviour>)playable.GetInput(i); | ||
|  |             AttackBehaviour input = inputPlayable.GetBehaviour(); | ||
|  |             var toGridSize = 16f / 64f; | ||
|  | 
 | ||
|  |             var attackTimeClipTime = inputPlayable.GetTime(); | ||
|  |             var attackTimeClipTimeMax = inputPlayable.GetDuration(); | ||
|  | 
 | ||
|  |             if (attackTimeClipTime > 0 && attackTimeClipTime + 0.01f < attackTimeClipTimeMax) | ||
|  |             { | ||
|  |                 Util.DrawBox(trackBinding.position + input.center * toGridSize, input.halfExtents * toGridSize, Vector3.right, Color.green); | ||
|  |             } | ||
|  | 
 | ||
|  |             // Use the above variables to process each frame of this playable. | ||
|  | 
 | ||
|  |         } | ||
|  |     } | ||
|  | } |