Exemple #1
0
 void ClearCache(bool allow_to_create_components)
 {
     _meshFilter   = SwfUtils.GetComponent <MeshFilter>  (gameObject, allow_to_create_components);
     _meshRenderer = SwfUtils.GetComponent <MeshRenderer>(gameObject, allow_to_create_components);
     _sortingGroup = SwfUtils.GetComponent <SortingGroup>(gameObject, allow_to_create_components);
     _dirtyMesh    = true;
     _curSequence  = null;
     _curPropBlock = null;
 }
 void ClearCache()
 {
     _meshFilter   = SwfUtils.GetOrCreateComponent <MeshFilter>(gameObject);
     _meshRenderer = SwfUtils.GetOrCreateComponent <MeshRenderer>(gameObject);
         #if UNITY_5_6_OR_NEWER
     _sortingGroup = SwfUtils.GetOrCreateComponent <SortingGroup>(gameObject);
         #endif
     _dirtyMesh    = true;
     _curSequence  = null;
     _curPropBlock = null;
 }
 void ChangeSequence()
 {
     _curSequence = null;
     if (clip && clip.Sequences != null)
     {
         if (!string.IsNullOrEmpty(sequence))
         {
             for (int i = 0, e = clip.Sequences.Count; i < e; ++i)
             {
                 var clip_sequence = clip.Sequences[i];
                 if (clip_sequence != null && clip_sequence.Name == sequence)
                 {
                     _curSequence = clip_sequence;
                     break;
                 }
             }
             if (_curSequence == null)
             {
                 Debug.LogWarningFormat(this,
                                        "<b>[FlashTools]</b> Sequence '{0}' not found",
                                        sequence);
             }
         }
         if (_curSequence == null)
         {
             for (int i = 0, e = clip.Sequences.Count; i < e; ++i)
             {
                 var clip_sequence = clip.Sequences[i];
                 if (clip_sequence != null)
                 {
                     _sequence    = clip_sequence.Name;
                     _curSequence = clip_sequence;
                     break;
                 }
             }
         }
     }
     ChangeCurrentFrame();
 }