Пример #1
0
 public void InitializeLoadingAnimation()
 {
     AnimationLoader.Process(AnimationType.APNG, Utilities.GetResource(Assembly.GetExecutingAssembly(), "BeatSaberMarkupLanguage.Resources.loading.apng"), (Texture2D tex, Rect[] uvs, float[] delays, int width, int height) =>
     {
         loadingAnimation = new AnimationControllerData(tex, uvs, delays);
         registeredAnimations.Add("LOADING_ANIMATION", loadingAnimation);
     });
 }
Пример #2
0
 public AnimationControllerData Register(string identifier, Texture2D tex, Rect[] uvs, float[] delays)
 {
     if (!registeredAnimations.TryGetValue(identifier, out AnimationControllerData animationData))
     {
         animationData = new AnimationControllerData(tex, uvs, delays);
         registeredAnimations.Add(identifier, animationData);
     }
     else
     {
         GameObject.Destroy(tex);//if the identifier exists then this texture is a duplicate so might as well destroy it and free some memory (this can happen if you try to load a gif twice before the first one finishes processing)
     }
     return(animationData);
 }