/// <summary> /// Refresh animation asset /// </summary> private void RefreshAnimationAsset() { if (this.internalModel != null && !string.IsNullOrEmpty(this.internalModel.AssetPath)) { this.Assets.UnloadAsset(this.internalModel.AssetPath); this.internalModel = null; } if (!string.IsNullOrEmpty(this.modelPath)) { this.internalModel = this.Assets.LoadAsset <InternalModel>(this.modelPath); if (this.internalModel != null) { this.hierarchyMapping = new NodeHierarchyMapping(this.internalModel, this.Owner); } if (string.IsNullOrEmpty(this.CurrentAnimation)) { this.CurrentAnimation = this.internalModel.Animations.Keys.ToArray()[0]; } this.RefreshAnimationTrack(); } if (this.PlayAutomatically && !string.IsNullOrEmpty(this.CurrentAnimation)) { this.PlayAnimation(this.CurrentAnimation, this.Loop); } }
/// <summary> /// Base initialzie clip /// </summary> /// <param name="hierarchyMapping">The hierarchy mapping</param> internal void BaseInitializeClip(NodeHierarchyMapping hierarchyMapping) { if (!this.isInitialized) { this.HierarchyMapping = hierarchyMapping; this.InitializeClip(); this.isInitialized = true; } }