Hi, I am trying to transfer sprite mesh animation frame to another scene. The sprite mesh animation consist of character clothes , is it actually possible to transfer this value to another scene? I have try creating static variable. But that doesn’t help. My other option is to use one scene instead of multiple scene. However I am a little scare if it will eat up player computer resource.
I am using Anima 2D. here’s my code. maybe there’s something wrong with it.`enter code here
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.UI;
using Anima2D;
public class Wardrobe : MonoBehaviour
{
public static int Clothing = 0;
public Animator animator;
public SpriteMeshAnimation Body;
public SpriteMeshAnimation HandRt;
public SpriteMeshAnimation HandLt;
public SpriteMeshAnimation LegLt;
public SpriteMeshAnimation LegRt;
public void WardrobeShow()
{
animator.SetBool("Wardrobe", true);
}
public void WardrobeHide()
{
animator.SetBool("Wardrobe", false);
}
public void ChangeClothes(int Clothing)
{
print("the clothes no is now" + Clothing + "this is function");
Body.frame = Clothing;
HandRt.frame = Clothing;
HandLt.frame = Clothing;
LegLt.frame = Clothing;
LegRt.frame = Clothing;
}
void Update()
{
if (Clothing >= 1)
{
print("the clothes no is now" + Clothing + "this is update");
Body.frame = Clothing;
HandRt.frame = Clothing;
HandLt.frame = Clothing;
LegLt.frame = Clothing;
LegRt.frame = Clothing;
}
}
}