mono / CocosSharp

CocosSharp is a C# implementation of the Cocos2D and Cocos3D APIs that runs on any platform where MonoGame runs.
493 stars 160 forks source link

RunActions (CCFiniteTimeAction[]) doubles up first item #347

Open chamons opened 8 years ago

chamons commented 8 years ago

Code:

        var one = new CCCallFunc (() =>
        {
            System.Diagnostics.Debug.WriteLine ("1");
        });

        var two = new CCCallFunc (() =>
        {
            System.Diagnostics.Debug.WriteLine ("2");
        });

        var three = new CCCallFunc (() =>
        {
            System.Diagnostics.Debug.WriteLine ("3");
        });

        var four = new CCCallFunc (() =>
        {
            System.Diagnostics.Debug.WriteLine ("4");
        });

        var five = new CCCallFunc (() =>
        {
            System.Diagnostics.Debug.WriteLine ("5");
        });

        this.RunActions (new CCFiniteTimeAction[] { one, two, three, four, five });

Output: 1 1 2 3 4 5

Expected: 1 2 3 4 5

chamons commented 8 years ago

You can work around this by having your first action have state to ignore the first time it was called, but this can get annoying for non-call func actions.

chamons commented 8 years ago

Oh, and 1.6.2.0 if that matters.

Therzok commented 8 years ago

Sounds similar to https://github.com/xamarin/urho/issues/88