void Update()
    {
        /* Update User-CallBack */
        SpriteStudioData.UpdateUserData(ScriptRoot.FrameNoNow, gameObject, ScriptRoot);

        /* Set Matrix for Transform (to the GameObject) */
        /* MEMO: Return-Value is ignored, 'cause NULL-Node has no Meshes. */
        SpriteStudioData.UpdateGameObject(gameObject, ScriptRoot.FrameNoNow);
    }
    void Update()
    {
        /* Get Animation-Data-Referenced */
        if ((null != ScriptRoot.SpriteStudioDataReferenced) && (null == spriteStudioData))
        {
            spriteStudioData = ScriptRoot.SpriteStudioDataReferenced.DataGetNode(ID);
        }

        /* Boot-Check */
        if (null == WorkArea)
        {
            WorkArea = new Library_SpriteStudio.AnimationData.WorkAreaRuntime();
        }

        /* Update User-CallBack */
        spriteStudioData.UpdateUserData(ScriptRoot.FrameNoNow, gameObject, ScriptRoot);

        /* Set Matrix for Transform (to the GameObject) */
        /* MEMO: Return-Value is ignored, 'cause NULL-Node has no Meshes. */
        spriteStudioData.UpdateGameObject(gameObject, ScriptRoot.FrameNoNow, CollisionComponent, WorkArea);
    }
示例#3
0
    void Update()
    {
        /* Get Animation-Data-Referenced */
        if ((null != ScriptRoot.SpriteStudioDataReferenced) && (null == spriteStudioData))
        {
            spriteStudioData = ScriptRoot.SpriteStudioDataReferenced.DataGetNode(ID);
        }

        /* Boot-Check */
        if (null == dataMesh)
        {
            MeshCreate();
        }
        if (null == DataMeshInformation)
        {
            DataMeshInformation = new Library_SpriteStudio.DrawManager.InformationMeshData();
        }
        if (null == WorkArea)
        {
            WorkArea = new Library_SpriteStudio.AnimationData.WorkAreaRuntime();
        }

        /* Update User-CallBack */
        spriteStudioData.UpdateUserData(ScriptRoot.FrameNoNow, gameObject, ScriptRoot);

        /* Mesh-Data Update */
        spriteStudioData.UpdateMesh(dataMesh, ScriptRoot.FrameNoNow, ScriptRoot);

        /* Set Matrix for Transform (to the GameObject) */
        if ((true == spriteStudioData.UpdateGameObject(gameObject, ScriptRoot.FrameNoNow, CollisionComponent, WorkArea)) && (false == FlagHideForce))
        {               /* Show the Sprite */
            DataMeshInformation.DataMesh      = dataMesh.Mesh;
            DataMeshInformation.DataTransform = transform;
            DataMeshInformation.PartsInstance = null;
            spriteStudioData.DrawEntry(DataMeshInformation, ScriptRoot.FrameNoNow, ScriptRoot);
        }
    }
示例#4
0
    void Update()
    {
        /* Clear Instance-Part's Draw-List */
        DrawListClearInstance();

        /* Boot-Check */
        if (null == DataMeshInformation)
        {
            DataMeshInformation = new Library_SpriteStudio.DrawManager.InformationMeshData();
        }
        if (null == InstanceGameObjectPartsRootSub)
        {               /* Get "Instance"-Parts" */
            GameObject InstanceChild          = null;
            Transform  InstanceTransformChild = null;
            Script_SpriteStudio_PartsRoot InstancePartsRootSub = null;
            int CountChild = transform.childCount;
            for (int i = 0; i < CountChild; i++)
            {
                InstanceTransformChild = transform.GetChild(i);
                if (null != InstanceTransformChild)
                {
                    InstanceChild        = InstanceTransformChild.gameObject;
                    InstancePartsRootSub = InstanceChild.gameObject.GetComponent <Script_SpriteStudio_PartsRoot>();
                    if (null != InstancePartsRootSub)
                    {
                        InstanceGameObjectPartsRootSub     = InstanceChild;
                        scriptPartsRootSub                 = InstancePartsRootSub;
                        scriptPartsRootSub.PartsRootOrigin = PartsRootGetOrigin(ScriptRoot);
                        break;                          /* Exit for-Loop */
                    }
                }
            }
        }

        if (null != InstanceGameObjectPartsRootSub)
        {
            /* Update User-CallBack */
            SpriteStudioData.UpdateUserData(ScriptRoot.FrameNoNow, gameObject, ScriptRoot);

            /* Update Instance-Data */
            bool FlagValidInstanceData = SpriteStudioData.UpdateInstanceData(ScriptRoot.FrameNoNow, gameObject, ScriptRoot, this);

            /* Set Matrix for Transform (to the GameObject) */
            if ((true == SpriteStudioData.UpdateGameObject(gameObject, ScriptRoot.FrameNoNow, true)) && (null != scriptPartsRootSub) && (true == FlagValidInstanceData) && (false == FlagHideForce))
            {                   /* Show Instance */
                                /* MEMO: "Instance"-Parts has no mesh */
                DataMeshInformation.DataMesh      = null;
                DataMeshInformation.DataTransform = transform;
                DataMeshInformation.PartsInstance = this;
                SpriteStudioData.DrawEntryInstance(DataMeshInformation, ScriptRoot.FrameNoNow, ScriptRoot);
            }
        }

        if (null != scriptPartsRootSub)
        {
            Script_SpriteStudio_PartsRoot PartsOrigin = scriptPartsRootSub.PartsRootOrigin;
            if (null != PartsOrigin)
            {
                if (false == PartsOrigin.AnimationCheckPlay())
                {                       /* Parent is stopped */
                    scriptPartsRootSub.AnimationStop();
                }
            }
        }
    }
示例#5
0
    void Update()
    {
        MainLoopCount++;

        /* Boot-Check */
        if (null == InstanceCameraDraw)
        {
            InstanceCameraDraw = Library_SpriteStudio.Utility.CameraGetParent(gameObject);
        }
        if (null == InstanceDrawManagerView)
        {
            InstanceDrawManagerView = Library_SpriteStudio.Utility.DrawManagerViewGetParent(gameObject);
        }
        if (null == arrayListMeshDraw)
        {
            arrayListMeshDraw = new Library_SpriteStudio.DrawManager.ArrayListMeshDraw();
            arrayListMeshDraw.BootUp();
        }
        if (null == ListCallBackUserData)
        {
            ListCallBackUserData = new ArrayList();
            ListCallBackUserData.Clear();
        }

        /* Entry Object to Draw */
        if ((null != InstanceDrawManagerView) && (null == partsRootOrigin))
        {               /* Not "Instance"-Object */
            if (false == FlagHideForce)
            {
                InstanceDrawManagerView.DrawEntryObject(this);
            }
        }

        /* Animation Update */
        if (null == SpriteStudioData)
        {
            return;
        }

        if (null == ListInformationPlay)
        {
            return;
        }

        if (0 == (Status & BitStatus.PLAYING))
        {
            return;
        }

        if (0 != (Status & BitStatus.PAUSING))
        {
            return;
        }

        int FrameCountNow  = 0;
        int FrameCountEnd  = frameNoEnd - frameNoStart;
        int FrameCountFull = FrameCountEnd + 1;

        float RateTimeProgress  = (0 == (Status & BitStatus.PLAYING_REVERSE)) ? 1.0f : -1.0f;
        float TimeAnimationFull = (float)FrameCountFull * TimeFramePerSecond;

        bool FlagLoop   = false;
        bool FlagReLoop = true;

        /* FrameNo Update */
        Status |= BitStatus.PLAY_FIRST;
        if (-1 != frameNoPrevious)
        {               /* Not Update, Just Starting */
            TimeAnimation += (Time.deltaTime * rateTimePlay) * RateTimeProgress;
            Status        &= ~BitStatus.DECODE_USERDATA;
            Status        &= ~BitStatus.PLAY_FIRST;
        }

        FrameCountNow        = (int)(TimeAnimation / TimeFramePerSecond);
        countLoopThisTime    = 0;
        flagTurnBackPingPong = false;
        flagReversePrevious  = (0 != (Status & BitStatus.PLAYING_REVERSE)) ? true : false;
        Status &= ~BitStatus.REDECODE_INSTANCE;

        if (false == FlagStylePingpong)
        {               /* One-Way */
            if (0 == (Status & BitStatus.PLAYING_REVERSE))
            {           /* Play foward */
                        /* Get Frame Count */
                if (FrameCountEnd < FrameCountNow)
                {       /* Frame-Over */
                    FlagLoop   = true;
                    FlagReLoop = true;
                    while (true == FlagReLoop)
                    {
                        /* Loop-Count Check */
                        if (0 <= CountLoopRemain)
                        {                               /* Limited-Count Loop */
                            CountLoopRemain--;
                            FlagLoop = (0 > CountLoopRemain) ? false : FlagLoop;
                        }

                        /* ReCalculate Frame */
                        if (true == FlagLoop)
                        {                               /* Loop */
                            countLoopThisTime++;

                            /* ReCalculate Frame */
                            TimeAnimation -= TimeAnimationFull;
                            FrameCountNow  = (int)(TimeAnimation / TimeFramePerSecond);
                            FlagReLoop     = (TimeAnimationFull <= TimeAnimation) ? true : false;

                            /* Set Instance Parts Restart Request */
                            Status |= BitStatus.REDECODE_INSTANCE;

                            /* Force-Decode UserData */
                            Status |= BitStatus.DECODE_USERDATA;
                        }
                        else
                        {                               /* End */
                            TimeAnimation = ((float)FrameCountEnd) * TimeFramePerSecond;
                            FrameCountNow = FrameCountEnd;
//							Status &= ~BitStatus.PLAYING;
                            Status    |= BitStatus.REQUEST_PLAYEND;
                            FlagReLoop = false;
                        }
                    }
                }
            }
            else
            {                   /* Play backwards */
                                /* Get Frame Count */
                if (0 > FrameCountNow)
                {               /* Frame-Over */
                    FlagLoop   = true;
                    FlagReLoop = true;
                    while (true == FlagReLoop)
                    {
                        /* Loop-Count Check */
                        if (0 <= CountLoopRemain)
                        {                               /* Limited-Count Loop */
                            CountLoopRemain--;
                            FlagLoop = (0 > CountLoopRemain) ? false : FlagLoop;
                        }

                        /* ReCalculate Frame */
                        if (true == FlagLoop)
                        {                               /* Loop */
                            countLoopThisTime++;

                            /* ReCalculate Frame */
                            TimeAnimation += TimeAnimationFull;
                            FrameCountNow  = (int)(TimeAnimation / TimeFramePerSecond);
                            FlagReLoop     = (0.0f > TimeAnimation) ? true : false;

                            /* Set Instance Parts Restart Request */
                            Status |= BitStatus.REDECODE_INSTANCE;

                            /* Force-Decode UserData */
                            Status |= BitStatus.DECODE_USERDATA;
                        }
                        else
                        {                               /* End */
                            TimeAnimation = 0.0f;
                            FrameCountNow = 0;
//							Status &= ~BitStatus.PLAYING;
                            Status    |= BitStatus.REQUEST_PLAYEND;
                            FlagReLoop = false;
                        }
                    }
                }
            }
        }
        else
        {               /* Ping-Pong */
            if (0 == (Status & BitStatus.STYLE_REVERSE))
            {           /* Style-Normaly */
                FlagReLoop = true;
                while (true == FlagReLoop)
                {
                    FlagReLoop = false;

                    if (0 == (Status & BitStatus.PLAYING_REVERSE))
                    {                           /* Play foward */
                        if (FrameCountEnd < FrameCountNow)
                        {                       /* Frame-Over */
                                                /* Set Turn-Back */
                            Status |= BitStatus.PLAYING_REVERSE;

                            /* ReCalculate Frame */
                            TimeAnimation       -= TimeAnimationFull;
                            TimeAnimation        = TimeAnimationFull - TimeAnimation;
                            FrameCountNow        = (int)(TimeAnimation / TimeFramePerSecond);
                            flagTurnBackPingPong = true;

                            /* Force-Decode UserData */
                            Status |= BitStatus.DECODE_USERDATA;

                            /* Plural Loop Count Check */
                            FlagReLoop = ((TimeAnimationFull > TimeAnimation) && (0.0f <= TimeAnimation)) ? false : true;
                        }
                    }
                    else
                    {                           /* Play backwards */
                        if (0 > FrameCountNow)
                        {                       /* Frame-Over */
                            FlagLoop = true;

                            /* Loop-Count Check */
                            if (0 <= CountLoopRemain)
                            {                                   /* Limited-Count Loop */
                                CountLoopRemain--;
                                FlagLoop = (0 > CountLoopRemain) ? false : FlagLoop;
                            }

                            if (true == FlagLoop)
                            {                                   /* Loop */
                                countLoopThisTime++;

                                /* Set Turn-Back */
                                Status &= ~BitStatus.PLAYING_REVERSE;

                                /* ReCalculate Frame */
                                TimeAnimation       += TimeAnimationFull;
                                TimeAnimation        = TimeAnimationFull - TimeAnimation;
                                FrameCountNow        = (int)(TimeAnimation / TimeFramePerSecond);
                                flagTurnBackPingPong = true;

                                /* Set Instance Parts Restart Request */
                                Status |= BitStatus.REDECODE_INSTANCE;

                                /* Force-Decode UserData */
                                Status |= BitStatus.DECODE_USERDATA;

                                /* Plural Loop Count Check */
                                FlagReLoop = ((TimeAnimationFull > TimeAnimation) && (0.0f <= TimeAnimation)) ? false : true;
                            }
                            else
                            {                                   /* End */
                                TimeAnimation = 0.0f;
                                FrameCountNow = 0;
//								Status &= ~BitStatus.PLAYING;
                                Status    |= BitStatus.REQUEST_PLAYEND;
                                FlagReLoop = false;
                            }
                        }
                    }
                }
            }
            else
            {                   /* Style-Reverse */
                FlagReLoop = true;
                while (true == FlagReLoop)
                {
                    FlagReLoop = false;

                    if (0 != (Status & BitStatus.PLAYING_REVERSE))
                    {                           /* Play backwards */
                        if (0 > FrameCountNow)
                        {                       /* Frame-Over */
                                                /* Set Turn-Back */
                            Status &= ~BitStatus.PLAYING_REVERSE;

                            /* ReCalculate Frame */
                            TimeAnimation       += TimeAnimationFull;
                            TimeAnimation        = TimeAnimationFull - TimeAnimation;
                            FrameCountNow        = (int)(TimeAnimation / TimeFramePerSecond);
                            flagTurnBackPingPong = true;

                            /* Force-Decode UserData */
                            Status |= BitStatus.DECODE_USERDATA;

                            /* Plural Loop Count Check */
                            FlagReLoop = ((TimeAnimationFull > TimeAnimation) && (0.0f <= TimeAnimation)) ? false : true;
                        }
                    }
                    else
                    {                           /* Play foward */
                        if (FrameCountEnd < FrameCountNow)
                        {                       /* Frame-Over */
                            FlagLoop = true;

                            /* Loop-Count Check */
                            if (0 <= CountLoopRemain)
                            {                                   /* Limited-Count Loop */
                                CountLoopRemain--;
                                FlagLoop = (0 > CountLoopRemain) ? false : FlagLoop;
                            }

                            if (true == FlagLoop)
                            {                                   /* Loop */
                                countLoopThisTime++;

                                /* Set Turn-Back */
                                Status |= BitStatus.PLAYING_REVERSE;

                                /* ReCalculate Frame */
                                TimeAnimation       -= TimeAnimationFull;
                                TimeAnimation        = TimeAnimationFull - TimeAnimation;
                                FrameCountNow        = (int)(TimeAnimation / TimeFramePerSecond);
                                flagTurnBackPingPong = true;

                                /* Set Instance Parts Restart Request */
                                Status |= BitStatus.REDECODE_INSTANCE;

                                /* Force-Decode UserData */
                                Status |= BitStatus.DECODE_USERDATA;

                                /* Plural Loop Count Check */
                                FlagReLoop = ((TimeAnimationFull > TimeAnimation) && (0.0f <= TimeAnimation)) ? false : true;
                            }
                            else
                            {                                   /* End */
                                TimeAnimation = ((float)FrameCountEnd) * TimeFramePerSecond;
                                FrameCountNow = FrameCountEnd;
//								Status &= ~BitStatus.PLAYING;
                                Status    |= BitStatus.REQUEST_PLAYEND;
                                FlagReLoop = false;
                            }
                        }
                    }
                }
            }
        }

        /* Member-Valiables Update */
        int FrameNoNew = frameNoStart + FrameCountNow;

        if (FrameNoNew != frameNoNow)
        {
            Status |= BitStatus.DECODE_USERDATA;
        }
        frameNoPrevious = frameNoNow;
        frameNoNow      = FrameNoNew;

        /* Update User-CallBack */
        SpriteStudioData.UpdateUserData(frameNoNow, gameObject, this);

        /* Update GameObject */
        SpriteStudioData.UpdateGameObject(gameObject, frameNoNow, false);
    }
    protected void AppendExecUpdate()
    {
        if (null != SpriteStudioData)
        {
            if (null != ListInformationPlay)
            {
                if (0 != (Status & BitStatus.PLAYING))
                {
                    if (0 == (Status & BitStatus.PAUSING))
                    {
                        /* Get Frame Count */
                        if (-1 != frameNoPrevious)
                        {                               /* Not Update, Just Starting */
                            TimeAnimation += (Time.deltaTime * RateTimeAnimation);
                            Status        &= ~BitStatus.DECODE_USERDATA;
                        }
                        int FrameCountNow = (int)(TimeAnimation / TimeFramePerSecond);
                        int FrameCountEnd = frameNoEnd - frameNoStart;

                        if (0.0f <= RateTimeAnimation)
                        {                               /* Play normaly */
                            if (FrameCountEnd < FrameCountNow)
                            {                           /* Frame-Over */
                                                        /* Loop-Count Check */
                                bool FlagLoop = true;
                                if (0 <= CountLoopRemain)
                                {                                       /* Limited-Count Loop */
                                    CountLoopRemain--;
                                    if (0 > CountLoopRemain)
                                    {
                                        FlagLoop = false;
                                    }
                                }

                                /* ReCalculate Frame */
                                if (true == FlagLoop)
                                {                                       /* Loop */
                                    int FrameCountFull = FrameCountEnd + 1;
                                    TimeAnimation -= ((float)FrameCountFull * TimeFramePerSecond);
                                    FrameCountNow  = (int)(TimeAnimation / TimeFramePerSecond);
                                }
                                else
                                {                                       /* End */
                                    TimeAnimation = ((float)FrameCountEnd) * TimeFramePerSecond;
                                    FrameCountNow = FrameCountEnd;
                                    Status       |= BitStatus.REQUEST_PLAYEND;
                                }
                            }

                            /* Frame-No Set */
                            int FrameNoNew = frameNoStart + FrameCountNow;
                            if (FrameNoNew != frameNoNow)
                            {
                                Status |= BitStatus.DECODE_USERDATA;
                            }
                            frameNoPrevious = frameNoNow;
                            frameNoNow      = FrameNoNew;
                        }
                        else
                        {                               /* Play backwards */
                            if (0 > FrameCountNow)
                            {                           /* Frame-Over */
                                                        /* Loop-Count Check */
                                bool FlagLoop = true;
                                if (0 <= CountLoopRemain)
                                {                                       /* Limited-Count Loop */
                                    CountLoopRemain--;
                                    if (0 > CountLoopRemain)
                                    {
                                        FlagLoop = false;
                                    }
                                }

                                /* ReCalculate Frame */
                                if (true == FlagLoop)
                                {                                       /* Loop */
                                    int FrameCountFull = FrameCountEnd + 1;
                                    TimeAnimation += ((float)FrameCountFull * TimeFramePerSecond);
                                    FrameCountNow  = (int)(TimeAnimation / TimeFramePerSecond);
                                }
                                else
                                {                                       /* End */
                                    TimeAnimation = 0.0f;
                                    FrameCountNow = 0;
                                    Status       |= BitStatus.REQUEST_PLAYEND;
                                }
                            }

                            /* Frame-No Set */
                            int FrameNoNew = frameNoStart + FrameCountNow;
                            if (FrameNoNew != frameNoNow)
                            {
                                Status |= BitStatus.DECODE_USERDATA;
                            }
                            frameNoPrevious = frameNoNow;
                            frameNoNow      = FrameNoNew;
                        }

                        /* Update User-CallBack */
                        SpriteStudioData.UpdateUserData(frameNoNow, gameObject, this);

                        /* Update GameObject */
                        SpriteStudioData.UpdateGameObject(gameObject, frameNoNow);
                    }
                }
            }
        }
    }