Пример #1
0
    private void FunctionCallBackUserData(	Script_SpriteStudio6_Root scriptRoot,
        string nameParts,
        int indexParts,
        int indexAnimation,
        int frameDecode,
        int frameKeyData,
        ref Library_SpriteStudio6.Data.Animation.Attribute.UserData userData,
        bool flagWayBack
        )
    {
        /* MEMO: "UserData"-callback are execute during animation updating process.                       */
        /*       Therefore, do not change playing-status within "UserData"- callback processing function. */
        /*       As much as possible, please caching values for the next operation                        */
        /*        and perform processing with the next "MonoBehaviour.Update()".                          */
        /* MEMO: "UserData"-callback is processed in the order of "1. part" and "2. frame".            */
        /*       When many frames are skipped, please pay attention to the order of callback.          */
        /*       (In parts by parts, Will be called back according to the order of the played-frames.) */
        /* MEMO: To be honest, it is not recommended to place "UserData" in many parts.                                    */
        /*       As much as possible recommend that you put "UserData" together in 1 part. (Can also get good performance) */
        /* MEMO: Do not place "UserData" in "Instance" animations. */
        /*       (Will be ignored)                                 */
        /* MEMO: "userData" is a shallow-copy of UserData in animation's master(original)-data.                                            */
        /*       Therefore, overwriting "userData" risks affecting animations that use same master-data, so do not overwrite in principle. */
        /*       (Since "userData.Text" is a "string", pay particular attention)                                                           */
        /* MEMO: "userData" is original-data's shallow-copy, so can not guarantee that same "reference".      */
        /*       Therefore, when judging whether same "UserData", judge by compare "scriptRoot","indexParts", */
        /*        "indexAnimation" and "frameKeyData".                                                        */
        /* MEMO: "flagWayBack" becomes true when direction-play is "way-back" during ping-pong(round-trip) playing. */
        /*       Always false during normal(one-way) playing.                                                       */

        /* MEMO: If you know exactly what values are stored in the "UserData",                                          */
        /*        you can directly retrieve values from "NumberInt", "Rectangle", "Coordinate" or "Text".               */
        /*       But usually "IsNumber", "IsRectangle"," IsCoordinate" or "IsText" are used to check values are stored. */
        if((true == userData.IsText) && ("ColorChange" == userData.Text))
        {
            IndexColor++;
            IndexColor %= TableColorFont.Length;
        }
    }
Пример #2
0
        /* ----------------------------------------------- Functions */
        #region Functions
        public void CleanUp()
        {
#if STORE_ANIMATIONSETUP_FULL
            int     valueInitialInt     = int.MinValue;
            float   valueInitialFloat   = float.NaN;
            Vector2 valueInitialVector2 = new Vector2(float.NaN, float.NaN);
            Vector3 valueInitialVector3 = new Vector3(float.NaN, float.NaN, float.NaN);

            Status = Library_SpriteStudio6.Data.Animation.Attribute.DefaultStatus;

            Position     = valueInitialVector3;
            Rotation     = valueInitialVector3;
            Scaling      = valueInitialVector2;
            ScalingLocal = valueInitialVector2;

            RateOpacity      = valueInitialFloat;
            RateOpacityLocal = valueInitialFloat;
            PowerMask        = valueInitialInt;
            Priority         = valueInitialInt;
            PartsColor.CleanUp();               /* = Library_SpriteStudio6.Data.Animation.Attribute.DefaultPartsColor; */
            VertexCorrection.CleanUp();

            OffsetPivot     = valueInitialVector2;
            PositionAnchor  = valueInitialVector2;
            SizeForce       = valueInitialVector2;
            PositionTexture = valueInitialVector2;
            RotationTexture = valueInitialFloat;
            ScalingTexture  = valueInitialVector2;

            RadiusCollision = valueInitialFloat;

            Instance = Library_SpriteStudio6.Data.Animation.Attribute.DefaultInstance;
            Effect   = Library_SpriteStudio6.Data.Animation.Attribute.DefaultEffect;
            Deform   = DefaultDeform;
#endif
            UserData = Library_SpriteStudio6.Data.Animation.Attribute.DefaultUseData;
        }