/** * @private */ protected override void _DisposeDisplay(object value, bool isRelease) { if (!isRelease) { UnityFactoryHelper.DestroyUnityObject(value as GameObject); } }
/// <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; }
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(); } }
/** * @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; }
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(); }
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; }
/** * @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; }
/// <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); }
/// <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(); }