WXGame/box1/Assets/Script/UI/PlaySpineAni.cs
2024-10-29 15:22:32 +08:00

36 lines
701 B
C#

using System;
using System.Collections;
using System.Collections.Generic;
using Spine.Unity;
using UnityEngine;
public class PlaySpineAni : MonoBehaviour
{
public SkeletonGraphic spine;
[SerializeField] private int trackIndex;
[SerializeField] private string spineAniName;
[SerializeField] private bool loop = false;
private void Awake()
{
spine = GetComponent<SkeletonGraphic>();
}
private void OnEnable()
{
spine.AnimationState.SetAnimation(0, spineAniName, loop);
}
// Start is called before the first frame update
void Start()
{
}
// Update is called once per frame
void Update()
{
}
}