Exemplo n.º 1
0
    // 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];
                }
            }
        }
    }
Exemplo n.º 2
0
 public bool Equals(CustomSubItem other)
 {
     return(shapeName.Equals(other.shapeName) && shapeId.Equals(other.shapeId) &&
            type.Equals(other.type));
 }