/// <summary> /// Gets the asset dependent animation. /// </summary> /// <returns> /// The asset dependent animation. /// </returns> /// <param name='assetFile'> /// If set to <c>true</c> asset file. /// </param> /// <param name='animAssetFile'> /// If set to <c>true</c> animation asset file. /// </param> /// <param name='animAsset'> /// If set to <c>true</c> animation asset. /// </param> /// <param name='animName'> /// If set to <c>true</c> animation name. /// </param> /// <param name='animTransform'> /// If set to <c>true</c> animation transform. /// </param> public bool GetAssetDependAnim(string assetFile, string animAssetFile, out string animAsset, out string animName, out string animTransform) { animAsset = ""; animName = ""; animTransform = ""; Asset asset = GetAsset(assetFile); if (asset == null) { return(false); } DependentAnimation depAnim = asset.GetDependAnimation(animAssetFile); if (depAnim == null) { return(false); } animAsset = depAnim.Asset; animName = depAnim.AnimationName; animTransform = depAnim.TransformPath; return(true); }
public bool HasDependAnimation(DependentAnimation dstDepAnim) { foreach (DependentAnimation depAnim in _dependAnimList) { if (depAnim.IsSame(dstDepAnim)) { return(true); } } return(false); }
public static Asset Load(SecurityElement e) { if (e.Tag != "Asset") { return(null); } Asset asset = new Asset(); asset._file = StrParser.ParseStr(e.Attribute("File"), ""); asset._version = StrParser.ParseDecInt(e.Attribute("Version"), 0); asset._fromAsset = StrParser.ParseStr(e.Attribute("FromAsset"), ""); if (e.Children != null) { foreach (SecurityElement c in e.Children) { if (c.Tag == "DependentAnimation") { DependentAnimation depAnim = DependentAnimation.Load(c); if (depAnim != null && !asset.HasDependAnimation(depAnim)) { asset._dependAnimList.Add(depAnim); } } else if (c.Tag == "DependentMaterial") { DependentMaterial depMat = DependentMaterial.Load(c); if (depMat != null && !asset.HasDependMaterial(depMat)) { asset._dependMatList.Add(depMat); } } else if (c.Tag == "DependentTexture") { DependentTexture depTex = DependentTexture.Load(c); if (depTex != null && !asset.HasDependTexture(depTex)) { asset._dependTexList.Add(depTex); } } } } return(asset); }
public bool AddDependAnimaion(string animAssetFile, string animName, string transformPath) { DependentAnimation depAnim = new DependentAnimation(); depAnim.Asset = animAssetFile; depAnim.AnimationName = animName; depAnim.TransformPath = transformPath; if (!HasDependAnimation(depAnim)) { _dependAnimList.Add(depAnim); } return(true); }
public static DependentAnimation Load(SecurityElement e) { if (e.Tag != "DependentAnimation") { return(null); } DependentAnimation depAnim = new DependentAnimation(); depAnim._asset = StrParser.ParseStr(e.Attribute("Asset"), ""); depAnim._animationName = StrParser.ParseStr(e.Attribute("AnimationName"), ""); depAnim._transformPath = StrParser.ParseStr(e.Attribute("TransformPath"), ""); return(depAnim); }
public bool IsSame(DependentAnimation depAnim) { return(Asset.Equals(depAnim.Asset) && AnimationName.Equals(depAnim.AnimationName) && TransformPath.Equals(depAnim.TransformPath)); }