/// <private/>
        public void DBClear()
        {
            bonesRoot = null;
            if (_armature != null)
            {
                _armature = null;
                if (_disposeProxy)
                {
                    UnityFactoryHelper.DestroyUnityObject(gameObject);
                }
            }

            _disposeProxy = true;
            _armature     = null;
            unityData     = null;
            armatureName  = null;
            animationName = null;
            isUGUI        = false;
            addNormal     = false;
            unityBones    = null;
            boneHierarchy = false;

            _colorTransform.Identity();
            _sortingMode      = SortingMode.SortByZ;
            _sortingLayerName = "Default";
            _sortingOrder     = 0;
            _playTimes        = 0;
            _timeScale        = 1.0f;
            _zSpace           = 0.0f;
            _flipX            = false;
            _flipY            = false;
            _sortedSlots      = null;

            _hasSortingGroup = false;
        }
Пример #2
0
 /**
  * @private
  */
 protected override void _DisposeDisplay(object value, bool isRelease)
 {
     if (!isRelease)
     {
         UnityFactoryHelper.DestroyUnityObject(value as GameObject);
     }
 }
Пример #3
0
        /// <summary>
        /// Parse the raw data to a DragonBonesData instance and cache it to the factory.
        /// </summary>
        /// <param name="dragonBonesJSONPath">The path of dragonBones data in Resources. (other forms of loading can be extended by themselves)</param>
        /// <param name="name">Specify a cache name for the instance so that the instance can be obtained through this name. (If not set, use the instance name instead)</param>
        /// <param name="scale">Specify a scaling value for all armatures. (Default does not scale)</param>
        /// <returns>DragonBonesData instance</returns>
        /// <version>DragonBones 4.5</version>
        /// <language>en_US</language>

        /// <summary>
        /// 将原始数据解析为 DragonBonesData 实例,并缓存到工厂中。
        /// </summary>
        /// <param name="dragonBonesJSONPath">龙骨数据在 Resources 中的路径。(其他形式的加载可自行扩展)</param>
        /// <param name="name">为该实例指定一个缓存名称,以便可以通过此名称获取该实例。 (如果未设置,则使用该实例中的名称)</param>
        /// <param name="scale">为所有的骨架指定一个缩放值。 (默认不缩放)</param>
        /// <returns>龙骨数据</returns>
        /// <version>DragonBones 4.5</version>
        /// <language>zh_CN</language>
        public DragonBonesData LoadDragonBonesData(string dragonBonesJSONPath, string name = "", float scale = 0.01f)
        {
            dragonBonesJSONPath = UnityFactoryHelper.CheckResourecdPath(dragonBonesJSONPath);

            TextAsset dragonBonesJSON = Resources.Load <TextAsset>(dragonBonesJSONPath);

            DragonBonesData dragonBonesData = LoadDragonBonesData(dragonBonesJSON, name);

            return(dragonBonesData);
        }
Пример #4
0
        void Start()
        {
            _unityArmature = GetComponent <UnityArmatureComponent>();
            if (_unityArmature.isUGUI)
            {
                UnityFactoryHelper.DestroyUnityObject(gameObject);
                return;
            }

            _mesh           = new Mesh();
            _mesh.hideFlags = HideFlags.DontSaveInEditor | HideFlags.DontSaveInBuild;
            _mesh.MarkDynamic();
            if (_unityArmature.armature != null)
            {
                UpdateMesh();
            }
        }
Пример #5
0
        /**
         * @private
         */
        protected override void _OnClear()
        {
            base._OnClear();

            if (_disposeEnabled && texture != null)
            {
                UnityFactoryHelper.DestroyUnityObject(texture);
            }

            if (_disposeEnabled && uiTexture != null)
            {
                UnityFactoryHelper.DestroyUnityObject(uiTexture);
            }

            _disposeEnabled = false;
            texture         = null;
            uiTexture       = null;
        }
Пример #6
0
        protected override void _OnClear()
        {
            base._OnClear();

            foreach (var key in this._cacheBlendModeMats.Keys)
            {
                var mat = this._cacheBlendModeMats[key];
                if (mat != null)
                {
                    UnityFactoryHelper.DestroyUnityObject(mat);
                }

                //this._cacheBlendModeMats[key] = null;
            }

            //
            this._cacheBlendModeMats.Clear();
        }
Пример #7
0
        public void Dispose()
        {
            if (this.sharedMesh != null)
            {
                UnityFactoryHelper.DestroyUnityObject(this.sharedMesh);
            }

            this.combineSlots.Clear();
            this.name              = string.Empty;
            this.sharedMesh        = null;
            this.vertexCount       = 0;
            this.rawVertextBuffers = null;
            this.uvBuffers         = null;
            this.vertexBuffers     = null;
            this.color32Buffers    = null;
            this.vertexDirty       = false;
            this.enabled           = false;
        }
        /// <private/>
        public void DBClear()
        {
            if (this._armature != null)
            {
                this._armature = null;
                if (this._disposeProxy)
                {
                    try
                    {
                        var go = gameObject;
                        UnityFactoryHelper.DestroyUnityObject(gameObject);
                    }
                    catch (System.Exception e)
                    {
                        AndroidUtil.Log(e.Message);
                    }
                }
            }

            this.unityData     = null;
            this.armatureName  = null;
            this.animationName = null;
            this.isUGUI        = false;
            this.debugDraw     = false;

            this._disposeProxy = true;
            this._armature     = null;
            this._colorTransform.Identity();
            this._sortingMode      = SortingMode.SortByZ;
            this._sortingLayerName = "Default";
            this._sortingOrder     = 0;
            this._playTimes        = 0;
            this._timeScale        = 1.0f;
            this._zSpace           = 0.0f;
            this._flipX            = false;
            this._flipY            = false;

            this._hasSortingGroup = false;

            this._debugDrawer = null;

            this._armatureZ         = 0;
            this._closeCombineMeshs = false;
        }
        /**
         * @language zh_CN
         * 加载、解析并添加贴图集数据。
         * @param path 贴图集数据在 Resources 中的路径。(其他形式的加载可自行扩展,使用 factory.ParseTextureAtlasData(JSONObject, Material))
         * @param name 为数据指定一个名称,以便可以通过这个名称获取数据,如果未设置,则使用数据中的名称。
         * @param scale 为贴图集设置一个缩放值。
         * @returns 贴图集数据
         * @see #ParseTextureAtlasData()
         * @see #GetTextureAtlasData()
         * @see #AddTextureAtlasData()
         * @see #RemoveTextureAtlasData()
         * @see DragonBones.UnityTextureAtlasData
         */
        public UnityTextureAtlasData LoadTextureAtlasData(string textureAtlasJSONPath, string name = null, float scale = 1.0f, bool isUGUI = false)
        {
            textureAtlasJSONPath = UnityFactoryHelper.CheckResourecdPath(textureAtlasJSONPath);

            UnityTextureAtlasData textureAtlasData = null;

            if (_pathTextureAtlasDataMap.ContainsKey(textureAtlasJSONPath))
            {
                textureAtlasData = _pathTextureAtlasDataMap[textureAtlasJSONPath] as UnityTextureAtlasData;
                _RefreshTextureAtlas(textureAtlasData, isUGUI);
            }
            else
            {
                //if (string.IsNullOrEmpty(name))
                //{
                //    name = UnityFactoryHelper.GetTextureAtlasNameByPath(textureAtlasJSONPath);
                //}

                TextAsset textureAtlasJSON = Resources.Load <TextAsset>(textureAtlasJSONPath);
                if (textureAtlasJSON != null)
                {
                    Dictionary <string, object> textureJSONData = (Dictionary <string, object>)MiniJSON.Json.Deserialize(textureAtlasJSON.text);
                    textureAtlasData = ParseTextureAtlasData(textureJSONData, null, name, scale) as UnityTextureAtlasData;

                    if (textureAtlasData != null)
                    {
                        //if (!string.IsNullOrEmpty(name))
                        //{
                        //    textureAtlasData.name = name;
                        //}

                        textureAtlasData.imagePath = UnityFactoryHelper.GetTextureAtlasImagePath(textureAtlasJSONPath, textureAtlasData.imagePath);

                        _RefreshTextureAtlas(textureAtlasData, isUGUI);

                        _pathTextureAtlasDataMap[textureAtlasJSONPath] = textureAtlasData;
                    }
                }
            }

            return(textureAtlasData);
        }
Пример #10
0
        /**
         * @language zh_CN
         * 加载、解析并添加龙骨数据。
         * @param path 龙骨数据在 Resources 中的路径。(其他形式的加载可自行扩展)
         * @param name 为数据提供一个名称,以便可以通过这个名称获取数据,如果未设置,则使用数据中的名称。
         * @param scale 为所有骨架设置一个缩放值。
         * @returns 龙骨数据
         * @see #ParseDragonBonesData()
         * @see #GetDragonBonesData()
         * @see #AddDragonBonesData()
         * @see #RemoveDragonBonesData()
         * @see DragonBones.DragonBonesData
         */
        public DragonBonesData LoadDragonBonesData(string dragonBonesJSONPath, string name = null, float scale = 0.01f)
        {
            dragonBonesJSONPath = UnityFactoryHelper.CheckResourecdPath(dragonBonesJSONPath);

            if (_pathDragonBonesDataMap.ContainsKey(dragonBonesJSONPath))
            {
                return(_pathDragonBonesDataMap[dragonBonesJSONPath]);
            }

            TextAsset dragonBonesJSON = Resources.Load <TextAsset>(dragonBonesJSONPath);

            DragonBonesData dragonBonesData = LoadDragonBonesData(dragonBonesJSON, name);

            if (dragonBonesData != null)
            {
                _pathDragonBonesDataMap[dragonBonesJSONPath] = dragonBonesData;
            }

            return(dragonBonesData);
        }
Пример #11
0
        /**
         * @private
         */
        protected override void _OnClear()
        {
            base._OnClear();

            if (_mesh != null)
            {
                UnityFactoryHelper.DestroyUnityObject(_mesh);
            }

            _skewed        = false;
            _proxy         = null;
            _renderDisplay = null;
            _mesh          = null;
            _uvs           = null;
            _vertices      = null;
            _vertices2     = null;
            _normals       = null;
            _colors        = null;

            _currentBlendMode = BlendMode.Normal;
        }
Пример #12
0
        /// <private/>
        protected override Armature _BuildArmature(BuildArmaturePackage dataPackage)
        {
            var armature          = BaseObject.BorrowObject <Armature>();
            var armatureDisplay   = _armatureGameObject == null ? new GameObject(dataPackage.armature.name) : _armatureGameObject;
            var armatureComponent = armatureDisplay.GetComponent <UnityArmatureComponent>();

            if (armatureComponent == null)
            {
                armatureComponent        = armatureDisplay.AddComponent <UnityArmatureComponent>();
                armatureComponent.isUGUI = _isUGUI;

                if (armatureComponent.isUGUI)
                {
                    armatureComponent.transform.localScale = Vector2.one * (1.0f / dataPackage.armature.scale);
                }
            }
            else
            {
                //compatible slotRoot
                var slotRoot = armatureDisplay.transform.Find("Slots");
                if (slotRoot != null)
                {
                    for (int i = slotRoot.transform.childCount; i > 0; i--)
                    {
                        var childSlotDisplay = slotRoot.transform.GetChild(i - 1);
                        childSlotDisplay.transform.SetParent(armatureDisplay.transform, false);
                    }

                    UnityFactoryHelper.DestroyUnityObject(slotRoot.gameObject);
                }
            }

            armatureComponent._armature = armature;
            Debug.Log("Yes");
            armature.Init(dataPackage.armature, armatureComponent, armatureDisplay, this._dragonBones);
            _armatureGameObject = null;

            return(armature);
        }
Пример #13
0
        /// <summary>
        /// Parse the textureAtlas json data to a UnityTextureAtlasData instance and cache it to the factory.
        /// </summary>
        /// <param name="textureAtlasJSONPath">The path of dragonBones data in Resources. (other forms of loading can be extended by themselves. use factory.ParseTextureAtlasData(JSONObject, Material))</param>
        /// <param name="name">Specify a cache name for the instance so that the instance can be obtained through this name. (If not set, use the instance name instead)</param>
        /// <param name="scale">Specify a scaling value for textureAtlas. (Default does not scale)</param>
        /// <param name="isUGUI"></param>
        /// <returns></returns>
        /// <version>DragonBones 4.5</version>
        /// <language>en_US</language>

        /// <summary>
        /// 将贴图集json数据解析为UnityTextureAtlasData,并缓存到工厂中。
        /// </summary>
        /// <param name="textureAtlasJSONPath">贴图集数据在 Resources 中的路径。(其他形式的加载可自行扩展,使用 factory.ParseTextureAtlasData(JSONObject, Material))</param>
        /// <param name="name">为数据指定一个名称,以便可以通过这个名称获取数据,如果未设置,则使用数据中的名称。</param>
        /// <param name="scale">为贴图集设置一个缩放值。</param>
        /// <param name="isUGUI"></param>
        /// <returns>贴图集数据</returns>
        /// <version>DragonBones 4.5</version>
        /// <language>zh_CN</language>
        public UnityTextureAtlasData LoadTextureAtlasData(string textureAtlasJSONPath, string name = "", float scale = 1.0f, bool isUGUI = false)
        {
            textureAtlasJSONPath = UnityFactoryHelper.CheckResourecdPath(textureAtlasJSONPath);

            TextAsset textureAtlasJSON = Resources.Load <TextAsset>(textureAtlasJSONPath);

            //
            if (textureAtlasJSON != null)
            {
                Dictionary <string, object> textureJSONData  = (Dictionary <string, object>)MiniJSON.Json.Deserialize(textureAtlasJSON.text);
                UnityTextureAtlasData       textureAtlasData = ParseTextureAtlasData(textureJSONData, null, name, scale) as UnityTextureAtlasData;

                if (textureAtlasData != null)
                {
                    textureAtlasData.imagePath = UnityFactoryHelper.GetTextureAtlasImagePath(textureAtlasJSONPath, textureAtlasData.imagePath);

                    _RefreshTextureAtlas(textureAtlasData, isUGUI);
                }

                return(textureAtlasData);
            }

            return(null);
        }
        /// <private/>
        void Awake()
        {
#if UNITY_EDITOR
            if (_IsPrefab())
            {
                return;
            }
#endif

            if (slotsRoot == null)
            {
                var slotsContainer = transform.Find("Slots");
                if (slotsContainer == null)
                {
                    GameObject go = new GameObject("Slots");
                    go.transform.SetParent(transform);
                    go.transform.localPosition = Vector3.zero;
                    go.transform.localRotation = Quaternion.identity;
                    go.transform.localScale    = Vector3.one;
                    slotsRoot = go;
                }
                else
                {
                    slotsRoot = slotsContainer.gameObject;
                }
            }

            List <UnityEngine.Transform> destroySlots = new List <UnityEngine.Transform>();
            for (int i = 0; i < slotsRoot.transform.childCount; ++i)
            {
                destroySlots.Add(slotsRoot.transform.GetChild(i));
            }
            for (int i = 0; i < destroySlots.Count; ++i)
            {
                UnityFactoryHelper.DestroyUnityObject(destroySlots[i].gameObject);
            }
            destroySlots.Clear();
            destroySlots = null;


            if (unityData != null && unityData.dragonBonesJSON != null && unityData.textureAtlas != null)
            {
                var dragonBonesData = UnityFactory.factory.LoadData(unityData, isUGUI);
                if (dragonBonesData != null && !string.IsNullOrEmpty(armatureName))
                {
                    UnityFactory.factory.BuildArmatureComponent(armatureName, unityData.dataName, null, null, gameObject, isUGUI);
                    if (!string.IsNullOrEmpty(armatureBaseName))
                    {
                        ArmatureData baseData = UnityFactory.factory.GetArmatureData(armatureBaseName, unityData.dataName);
                        UnityFactory.factory.ReplaceAnimation(armature, baseData);
                    }
                }
            }

            if (_armature != null)
            {
#if UNITY_5_6_OR_NEWER
                if (!isUGUI)
                {
                    _sortingGroup = GetComponent <UnityEngine.Rendering.SortingGroup>();
                }
#endif
                _UpdateSlotsSorting();

                _armature.flipX = _flipX;
                _armature.flipY = _flipY;

                _armature.animation.timeScale = _timeScale;

                if (!string.IsNullOrEmpty(animationName))
                {
                    _armature.animation.Play(animationName, _playTimes);
                }
            }
            CollectBones();
        }
Пример #15
0
        /// <private/>
        protected void _RefreshTextureAtlas(UnityTextureAtlasData textureAtlasData, bool isUGUI, bool isEditor = false)
        {
            Material material = null;

            if (isUGUI && textureAtlasData.uiTexture == null)
            {
                if (isEditor)
                {
#if UNITY_EDITOR
                    if (!Application.isPlaying)
                    {
                        material = AssetDatabase.LoadAssetAtPath <Material>(textureAtlasData.imagePath + "_UI_Mat.mat");
                    }
#endif
                }
                else
                {
                    material = Resources.Load <Material>(textureAtlasData.imagePath + "_UI_Mat");
                }

                if (material == null)
                {
                    Texture2D textureAtlas = null;

                    if (isEditor)
                    {
#if UNITY_EDITOR
                        if (!Application.isPlaying)
                        {
                            textureAtlas = AssetDatabase.LoadAssetAtPath <Texture2D>(textureAtlasData.imagePath + ".png");
                        }
#endif
                    }
                    else
                    {
                        textureAtlas = Resources.Load <Texture2D>(textureAtlasData.imagePath);
                    }

                    material = UnityFactoryHelper.GenerateMaterial(defaultUIShaderName, textureAtlas.name + "_UI_Mat", textureAtlas);
                    if (textureAtlasData.width < 2)
                    {
                        textureAtlasData.width = (uint)textureAtlas.width;
                    }

                    if (textureAtlasData.height < 2)
                    {
                        textureAtlasData.height = (uint)textureAtlas.height;
                    }

                    textureAtlasData._disposeEnabled = true;
#if UNITY_EDITOR
                    if (!Application.isPlaying)
                    {
                        string path = AssetDatabase.GetAssetPath(textureAtlas);
                        path = path.Substring(0, path.Length - 4);
                        AssetDatabase.CreateAsset(material, path + "_UI_Mat.mat");
                        AssetDatabase.SaveAssets();
                    }
#endif
                }

                //
                textureAtlasData.uiTexture = material;
            }
            else if (!isUGUI && textureAtlasData.texture == null)
            {
                if (isEditor)
                {
#if UNITY_EDITOR
                    if (!Application.isPlaying)
                    {
                        material = AssetDatabase.LoadAssetAtPath <Material>(textureAtlasData.imagePath + "_Mat.mat");
                    }
#endif
                }
                else
                {
                    material = Resources.Load <Material>(textureAtlasData.imagePath + "_Mat");
                }

                if (material == null)
                {
                    Texture2D textureAtlas = null;
                    if (isEditor)
                    {
#if UNITY_EDITOR
                        if (!Application.isPlaying)
                        {
                            textureAtlas = AssetDatabase.LoadAssetAtPath <Texture2D>(textureAtlasData.imagePath + ".png");
                        }
#endif
                    }
                    else
                    {
                        textureAtlas = Resources.Load <Texture2D>(textureAtlasData.imagePath);
                    }

                    material = UnityFactoryHelper.GenerateMaterial(defaultShaderName, textureAtlas.name + "_Mat", textureAtlas);
                    if (textureAtlasData.width < 2)
                    {
                        textureAtlasData.width = (uint)textureAtlas.width;
                    }

                    if (textureAtlasData.height < 2)
                    {
                        textureAtlasData.height = (uint)textureAtlas.height;
                    }

                    textureAtlasData._disposeEnabled = true;
#if UNITY_EDITOR
                    if (!Application.isPlaying)
                    {
                        string path = AssetDatabase.GetAssetPath(textureAtlas);
                        path = path.Substring(0, path.Length - 4);
                        AssetDatabase.CreateAsset(material, path + "_Mat.mat");
                        AssetDatabase.SaveAssets();
                    }
#endif
                }

                textureAtlasData.texture = material;
            }
        }
Пример #16
0
        /// <summary>
        /// 用特定的显示对象数据替换特定插槽当前的显示对象数据。
        /// </summary>
        /// <param name="dragonBonesName">The DragonBonesData instance cache name</param>
        /// <param name="armatureName">The armature data name</param>
        /// <param name="slotName">The slot data name</param>
        /// <param name="displayName">The display data name</param>
        /// <param name="slot">The slot</param>
        /// <param name="texture">The new texture</param>
        /// <param name="material">The new material</param>
        /// <param name="isUGUI">is ugui。</param>
        /// <param name="displayIndex">The index of the display data that is replaced. (If it is not set, replaces the current display data)</param>
        /// <version>DragonBones 4.5</version>
        /// <language>zh_CN</language>

        /// <summary>
        /// 用特定的显示对象数据替换特定插槽当前的显示对象数据。
        /// </summary>
        /// <param name="dragonBonesName">指定的龙骨数据名称。</param>
        /// <param name="armatureName">指定的骨架名称。</param>
        /// <param name="slotName">指定的插槽名称。</param>
        /// <param name="displayName">指定的显示对象名称。</param>
        /// <param name="slot">指定的插槽实例。</param>
        /// <param name="texture">新的贴图。</param>
        /// <param name="material">新的材质。</param>
        /// <param name="isUGUI">是否为ugui。</param>
        /// <param name="displayIndex">被替换的显示对象数据的索引。 (如果未设置,则替换当前的显示对象数据)。</param>
        /// <version>DragonBones 4.5</version>
        /// <language>zh_CN</language>
        public void ReplaceSlotDisplay(
            string dragonBonesName, string armatureName, string slotName, string displayName,
            Slot slot, Texture2D texture, Material material = null,
            bool isUGUI = false, int displayIndex = -1)
        {
            var armatureData = this.GetArmatureData(armatureName, dragonBonesName);

            if (armatureData == null || armatureData.defaultSkin == null)
            {
                return;
            }

            var displays = armatureData.defaultSkin.GetDisplays(slotName);

            if (displays == null)
            {
                return;
            }

            DisplayData prevDispalyData = null;

            foreach (var displayData in displays)
            {
                if (displayData.name == displayName)
                {
                    prevDispalyData = displayData;
                    break;
                }
            }

            if (prevDispalyData == null || !((prevDispalyData is ImageDisplayData) || (prevDispalyData is MeshDisplayData)))
            {
                return;
            }

            TextureData prevTextureData = null;

            if (prevDispalyData is ImageDisplayData)
            {
                prevTextureData = (prevDispalyData as ImageDisplayData).texture;
            }
            else
            {
                prevTextureData = (prevDispalyData as MeshDisplayData).texture;
            }

            UnityTextureData newTextureData = new UnityTextureData();

            newTextureData.CopyFrom(prevTextureData);
            newTextureData.rotated       = false;
            newTextureData.region.x      = 0.0f;
            newTextureData.region.y      = 0.0f;
            newTextureData.region.width  = texture.width;
            newTextureData.region.height = texture.height;
            newTextureData.frame         = newTextureData.region;
            newTextureData.name          = prevTextureData.name;
            newTextureData.parent        = new UnityTextureAtlasData();
            newTextureData.parent.width  = (uint)texture.width;
            newTextureData.parent.height = (uint)texture.height;
            newTextureData.parent.scale  = prevTextureData.parent.scale;

            //
            if (material == null)
            {
                if (isUGUI)
                {
                    material = UnityFactoryHelper.GenerateMaterial(defaultUIShaderName, texture.name + "_UI_Mat", texture);
                }
                else
                {
                    material = UnityFactoryHelper.GenerateMaterial(defaultShaderName, texture.name + "_Mat", texture);
                }
            }

            if (isUGUI)
            {
                (newTextureData.parent as UnityTextureAtlasData).uiTexture = material;
            }
            else
            {
                (newTextureData.parent as UnityTextureAtlasData).texture = material;
            }

            material.mainTexture = texture;

            DisplayData newDisplayData = null;

            if (prevDispalyData is ImageDisplayData)
            {
                newDisplayData      = new ImageDisplayData();
                newDisplayData.type = prevDispalyData.type;
                newDisplayData.name = prevDispalyData.name;
                newDisplayData.path = prevDispalyData.path;
                newDisplayData.transform.CopyFrom(prevDispalyData.transform);
                newDisplayData.parent = prevDispalyData.parent;
                (newDisplayData as ImageDisplayData).pivot.CopyFrom((prevDispalyData as ImageDisplayData).pivot);
                (newDisplayData as ImageDisplayData).texture = newTextureData;
            }
            else if (prevDispalyData is MeshDisplayData)
            {
                newDisplayData      = new MeshDisplayData();
                newDisplayData.type = prevDispalyData.type;
                newDisplayData.name = prevDispalyData.name;
                newDisplayData.path = prevDispalyData.path;
                newDisplayData.transform.CopyFrom(prevDispalyData.transform);
                newDisplayData.parent = prevDispalyData.parent;
                (newDisplayData as MeshDisplayData).texture = newTextureData;

                (newDisplayData as MeshDisplayData).vertices.inheritDeform = (prevDispalyData as MeshDisplayData).vertices.inheritDeform;
                (newDisplayData as MeshDisplayData).vertices.offset        = (prevDispalyData as MeshDisplayData).vertices.offset;
                (newDisplayData as MeshDisplayData).vertices.data          = (prevDispalyData as MeshDisplayData).vertices.data;
                (newDisplayData as MeshDisplayData).vertices.weight        = (prevDispalyData as MeshDisplayData).vertices.weight;
            }

            ReplaceDisplay(slot, newDisplayData, displayIndex);
        }