public void CreateMassAnimationName(particleAnimation anime, int team, bool isActive = false) { if (anime.position != Vector3.zero && !string.IsNullOrEmpty(anime.name) && !massAnimation.ContainsKey(anime) && team != 0) { var instance = GameObject.Instantiate(animationNames[anime.name]); instance.transform.localPosition = anime.position; massAnimation.Add(anime, instance.GetComponent <ParticleSystem>()); if (team < 0) { #pragma warning disable CS0618 // Тип или член устарел massAnimation[anime].startColor = Color.red; #pragma warning restore CS0618 // Тип или член устарел } else { #pragma warning disable CS0618 // Тип или член устарел massAnimation[anime].startColor = Color.green; #pragma warning restore CS0618 // Тип или член устарел } if (isActive) { #pragma warning disable CS0618 // Тип или член устарел massAnimation[anime].startColor = Color.yellow; #pragma warning restore CS0618 // Тип или член устарел } } }
public void DestroyMassAnimationInstance(particleAnimation animation) { if (!string.IsNullOrEmpty(animation.name) && animation.position != Vector3.zero) { Destroy(massAnimation[animation].gameObject); massAnimation.Remove(animation); } }
public void RemoveFromList(string name, bool isMass) { if (!isMass) { if (playingAnimations.ContainsKey(name)) { playingAnimations.Remove(name); var em = World.Active.EntityManager; em.AddComponentData <Action>(currentEntity, new Action()); //HideSkillScroll(); } } else { bool contains = false; particleAnimation k = new particleAnimation(); do { contains = false; foreach (var anime in massAnimation) { if (anime.Key.name == name) { contains = true; k = anime.Key; } } if (contains) { massAnimation.Remove(k); } } while (contains == true); var em = World.Active.EntityManager; em.AddComponentData <Action>(currentEntity, new Action()); //HideSkillScroll(); } }