Exemplo n.º 1
0
 /// <summary>
 /// 停止
 /// </summary>
 public void Stop()
 {
     spritePartsRoot.AnimationStop();
 }
Exemplo n.º 2
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();
                }
            }
        }
    }