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"); }
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"); }