• Unity
  • Can I assign AnimationReferenceAsset by code?

Hi, I am new to Spine and Code

I've try to use the AnimationReferenceAsset, the problem is , my AnimationReferenceAsset clips are quite a lot, to drag and choose one from inspector like below is time consuming,

Image removed due to the lack of support for HTTPS. | Show Anyway

So I was thinking, if there is a way to assign AnimationReferenceAsset by code?

For example, Let's say, I have 3 clips, IDLE, WALK, HIT

public AnimationReferenceAsset IDLE, WALK, HIT;

How can I assign them with code instead of drag them in inspectors?

Thanks

This is more of a general question of Unity editor-scripting (how to assign asset references from a folder via script). You might find some answers on the official Unity forums here: https://forum.unity.com/

15 dana kasnije

Got it, Thanks for the help