public TintByState (TintBy action, Node target) : base (action, target) { DeltaB = action.DeltaB; DeltaG = action.DeltaG; DeltaR = action.DeltaR; staticSprite = Target.GetComponent<StaticSprite2D>(); if (staticSprite != null) { var color = staticSprite.Color; FromR = color.R; FromG = color.G; FromB = color.B; return; } shape = Target.GetComponent<Shape>(); if (shape != null) { FromR = shape.Color.R; FromG = shape.Color.G; FromB = shape.Color.B; return; } throw new NotSupportedException("The node should have StaticSprite2D or Shape component"); }
public FadeOutState (FadeOut action, Node target) : base (action, target) { staticSprite = Target.GetComponent<StaticSprite2D>(); if (staticSprite != null) return; shape = Target.GetComponent<Shape>(); if (shape != null) return; throw new NotSupportedException("The node should have StaticSprite2D or Shape component"); }
public TintToState (TintTo action, Node target) : base (action, target) { ColorTo = action.ColorTo; staticSprite = Target.GetComponent<StaticSprite2D>(); if (shape != null) { ColorFrom = staticSprite.Color; return; } shape = Target.GetComponent<Shape>(); if (shape != null) { ColorFrom = shape.Color; return; } throw new NotSupportedException("The node should have StaticSprite2D or Shape component"); }
public FadeToState (FadeTo action, Node target) : base (action, target) { ToOpacity = action.ToOpacity; staticSprite = Target.GetComponent<StaticSprite2D>(); if (staticSprite != null) { FromOpacity = staticSprite.Alpha; return; } shape = Target.GetComponent<Shape>(); if (shape != null) { FromOpacity = shape.Color.A; return; } throw new NotSupportedException("The node should have StaticSprite2D or Shape component"); }