// Update is called once per frame void Update() { if (triggered) { timePassed += Time.deltaTime; if (timePassed > animationSpeed) { timePassed -= animationSpeed; animationFrame++; if (animationFrame >= frames.Count) { if (animationType.Equals(AnimationType.once)) { triggered = false; } else if (animationType.Equals(AnimationType.loop)) { animationFrame = 0; gameObject.GetComponent <SpriteRenderer>().sprite = frames[animationFrame]; } else if (animationType.Equals(AnimationType.destroy)) { GameObject.Destroy(gameObject); } } else { gameObject.GetComponent <SpriteRenderer>().sprite = frames[animationFrame]; } } } }
public bool Equals(CustomSubItem other) { return(shapeName.Equals(other.shapeName) && shapeId.Equals(other.shapeId) && type.Equals(other.type)); }