fix prefab current mesh bug

This commit is contained in:
2016-09-10 18:41:50 +07:00
parent 5bce0db290
commit 811bd73fa1

View File

@@ -121,6 +121,7 @@ namespace FlashTools {
// ---------------------------------------------------------------------
public void UpdateAllProperties() {
ClearCache();
clip = _clip;
sequence = _sequence;
currentFrame = _currentFrame;
@@ -128,6 +129,13 @@ namespace FlashTools {
sortingOrder = _sortingOrder;
}
void ClearCache() {
_meshFilter = GetComponent<MeshFilter>();
_meshRenderer = GetComponent<MeshRenderer>();
_curSequence = null;
_curPropBlock = null;
}
void ChangeClip() {
if ( _meshRenderer ) {
_meshRenderer.enabled = !!clip;
@@ -212,10 +220,6 @@ namespace FlashTools {
// ---------------------------------------------------------------------
void Awake() {
_meshFilter = GetComponent<MeshFilter>();
_meshRenderer = GetComponent<MeshRenderer>();
_curSequence = null;
_curPropBlock = null;
UpdateAllProperties();
}