Beispiel #1
0
            public bool HasDependTexture(DependentTexture dstDepTex)
            {
                foreach (DependentTexture depTex in _dependTexList)
                {
                    if (depTex.IsSame(dstDepTex))
                    {
                        return(true);
                    }
                }

                return(false);
            }
Beispiel #2
0
            public bool AddDependTexture(string texAssetFile, string texPropertyName)
            {
                DependentTexture depTex = new DependentTexture();

                depTex.Asset        = texAssetFile;
                depTex.PropertyName = texPropertyName;

                if (!HasDependTexture(depTex))
                {
                    _dependTexList.Add(depTex);
                }

                return(true);
            }
Beispiel #3
0
            public static DependentTexture Load(SecurityElement e)
            {
                if (e.Tag != "DependentTexture")
                {
                    return(null);
                }

                DependentTexture depTex = new DependentTexture();

                depTex._asset        = StrParser.ParseStr(e.Attribute("Asset"), "");
                depTex._propertyName = StrParser.ParseStr(e.Attribute("PropertyName"), "");

                return(depTex);
            }
Beispiel #4
0
            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);
            }
Beispiel #5
0
        /// <summary>
        /// Gets the index of the asset dependent texture by index.
        /// </summary>
        /// <returns>
        /// The asset dependent texture by index.
        /// </returns>
        /// <param name='assetFile'>
        /// If set to <c>true</c> asset file.
        /// </param>
        /// <param name='index'>
        /// If set to <c>true</c> index.
        /// </param>
        /// <param name='texAsset'>
        /// If set to <c>true</c> texture asset.
        /// </param>
        /// <param name='texPropertyName'>
        /// If set to <c>true</c> texture property name.
        /// </param>
        public bool GetAssetDependTexByIndex(string assetFile, int index, out string texAsset, out string texPropertyName)
        {
            texAsset        = "";
            texPropertyName = "";

            Asset asset = GetAsset(assetFile);

            if (asset == null)
            {
                return(false);
            }

            DependentTexture depTex = asset.GetDependTexByIndex(index);

            if (depTex == null)
            {
                return(false);
            }

            texAsset        = depTex.Asset;
            texPropertyName = depTex.PropertyName;

            return(true);
        }
Beispiel #6
0
 public bool IsSame(DependentTexture depTex)
 {
     return(Asset.Equals(depTex.Asset) && PropertyName.Equals(depTex.PropertyName));
 }