Hi,
The effect is working fine when I test it in the editor view. It animates and it clears. However when running the game in the editor the effect does not animate or clear. This happens both when I programmatically add an effect and when I hit the Test button while the game is running.
I notice that the triangle count and effect counts keeps increasing. If I keep running it I eventually wind up with a filled circle.
Is there something I’m missing?
Here’s my code:
FlatFX fx = warnAnimation.GetComponent<FlatFX>();
fx.gameObject.transform.localScale = new Vector3(100, 100, 100);
RectTransform rt = GetComponent<RectTransform>();
Bounds b = GetRectTransformBounds(rt);
fx.AddEffect(b.center, 2);
The FlatFX object is a child of a canvas object. Here’s the JSON of my object:
{
"selectedEffect": 2,
"settings": [
{
"type": 0,
"sectorCount": 30,
"lifetime": 0.699999988079071,
"easing": 11,
"randomizePosition": 1.0,
"start": {
"position": {
"x": 0.0,
"y": 0.0
},
"size": 2.0,
"thickness": 3.0,
"rotation": 159.8514404296875,
"innerColor": {
"r": 1.0,
"g": 0.43448272347450259,
"b": 0.0,
"a": 1.0
},
"outerColor": {
"r": 1.0,
"g": 0.18620696663856507,
"b": 0.0,
"a": 1.0
},
"seed": 0.0
},
"end": {
"position": {
"x": 0.0,
"y": 0.0
},
"size": 3.0,
"thickness": 0.0,
"rotation": 159.8514404296875,
"innerColor": {
"r": 0.4852941036224365,
"g": 0.37824392318725588,
"b": 0.37824392318725588,
"a": 1.0
},
"outerColor": {
"r": 0.4485294222831726,
"g": 0.4485294222831726,
"b": 0.4485294222831726,
"a": 1.0
},
"seed": 0.0
}
},
{
"type": 1,
"sectorCount": 30,
"lifetime": 2.0,
"easing": 11,
"randomizePosition": 0.5,
"start": {
"position": {
"x": 0.0,
"y": 0.0
},
"size": 0.0,
"thickness": 1.0,
"rotation": 117.05316925048828,
"innerColor": {
"r": 0.0,
"g": 0.7103447914123535,
"b": 1.0,
"a": 1.0
},
"outerColor": {
"r": 0.0,
"g": 0.7098039388656616,
"b": 1.0,
"a": 1.0
},
"seed": 0.0
},
"end": {
"position": {
"x": 0.0,
"y": 0.0
},
"size": 6.0,
"thickness": 0.0,
"rotation": 117.05316925048828,
"innerColor": {
"r": 0.0,
"g": 0.7098039388656616,
"b": 1.0,
"a": 0.0
},
"outerColor": {
"r": 0.0,
"g": 0.7098039388656616,
"b": 1.0,
"a": 0.0
},
"seed": 0.0
}
},
{
"type": 2,
"sectorCount": 10,
"lifetime": 0.5,
"easing": 12,
"randomizePosition": 0.0,
"start": {
"position": {
"x": 0.0,
"y": 0.0
},
"size": 6.0,
"thickness": 4.0,
"rotation": 274.034912109375,
"innerColor": {
"r": 1.0,
"g": 0.5611366629600525,
"b": 0.4784313440322876,
"a": 1.0
},
"outerColor": {
"r": 1.0,
"g": 0.6781498789787293,
"b": 0.4784313440322876,
"a": 1.0
},
"seed": 0.0
},
"end": {
"position": {
"x": 0.0,
"y": 0.0
},
"size": 2.0,
"thickness": 0.0,
"rotation": 274.034912109375,
"innerColor": {
"r": 1.0,
"g": 0.0,
"b": 0.1030879020690918,
"a": 1.0
},
"outerColor": {
"r": 1.0,
"g": 0.4784313440322876,
"b": 0.8786624073982239,
"a": 1.0
},
"seed": 0.0
}
},
{
"type": 3,
"sectorCount": 4,
"lifetime": 0.30000001192092898,
"easing": 0,
"randomizePosition": 0.0,
"start": {
"position": {
"x": 0.0,
"y": 0.0
},
"size": 20.0,
"thickness": 20.0,
"rotation": 49.638118743896487,
"innerColor": {
"r": 1.0,
"g": 1.0,
"b": 1.0,
"a": 1.0
},
"outerColor": {
"r": 1.0,
"g": 1.0,
"b": 1.0,
"a": 1.0
},
"seed": 0.0
},
"end": {
"position": {
"x": 0.0,
"y": 0.0
},
"size": 20.0,
"thickness": 20.0,
"rotation": 49.638118743896487,
"innerColor": {
"r": 1.0,
"g": 1.0,
"b": 1.0,
"a": 1.0
},
"outerColor": {
"r": 1.0,
"g": 1.0,
"b": 1.0,
"a": 1.0
},
"seed": 0.0
}
},
{
"type": 4,
"sectorCount": 16,
"lifetime": 2.0,
"easing": 0,
"randomizePosition": 0.0,
"start": {
"position": {
"x": 0.0,
"y": 0.0
},
"size": 10.0,
"thickness": 9.0,
"rotation": 344.0030517578125,
"innerColor": {
"r": 1.0,
"g": 0.9215686917304993,
"b": 0.01568627543747425,
"a": 1.0
},
"outerColor": {
"r": 1.0,
"g": 0.9215686321258545,
"b": 0.01568627543747425,
"a": 0.0
},
"seed": 0.0
},
"end": {
"position": {
"x": 0.0,
"y": 0.0
},
"size": 10.0,
"thickness": 9.0,
"rotation": 224.0030517578125,
"innerColor": {
"r": 1.0,
"g": 0.9215686917304993,
"b": 0.01568627543747425,
"a": 1.0
},
"outerColor": {
"r": 1.0,
"g": 0.9215686917304993,
"b": 0.01568627543747425,
"a": 0.0
},
"seed": 0.0
}
}
],
"sortingLayer": 0,
"orderInLayer": 0
}