/// <summary> /// Constructor of the <c>Armature</c> class. /// </summary> /// <param name="name">Name of the object.</param> /// <param name="textureName">Name of the texture that represents the object.</param> /// <param name="position">Position in the inventory.</param> /// <param name="isEquipped">true if the element is equipped, false otherwise.</param> /// <param name="defense">Amount of defense of the armature.</param> /// <param name="skill">Amount of skill of the armature.</param> /// <param name="type">Type of the armature.</param> public Armature(string name, string textureName, int position, bool isEquipped, int defense, int skill, ArmatureType type) : base(name, textureName, position, isEquipped) { _skill = skill; _defense = defense; _type = type; }
/** * @private */ protected override void _onClear() { foreach (var pair in bones) { pair.Value.ReturnToPool(); } foreach (var pair in slots) { pair.Value.ReturnToPool(); } foreach (var pair in skins) { pair.Value.ReturnToPool(); } foreach (var pair in animations) { pair.Value.ReturnToPool(); } foreach (var action in actions) { action.ReturnToPool(); } if (userData != null) { userData.ReturnToPool(); } frameRate = 0; type = ArmatureType.None; cacheFrameRate = 0; scale = 1.0f; name = null; aabb.Clear(); bones.Clear(); slots.Clear(); skins.Clear(); animations.Clear(); actions.Clear(); parent = null; _boneDirty = false; _slotDirty = false; _animationNames.Clear(); _sortedBones.Clear(); _sortedSlots.Clear(); _bonesChildren.Clear(); _defaultSkin = null; _defaultAnimation = null; }
protected override void _OnClear() { foreach (var action in this.defaultActions) { action.ReturnToPool(); } foreach (var action in this.actions) { action.ReturnToPool(); } foreach (var k in this.bones.Keys) { this.bones[k].ReturnToPool(); } foreach (var k in this.slots.Keys) { this.slots[k].ReturnToPool(); } foreach (var k in this.constraints.Keys) { this.constraints[k].ReturnToPool(); } foreach (var k in this.skins.Keys) { this.skins[k].ReturnToPool(); } foreach (var k in this.animations.Keys) { this.animations[k].ReturnToPool(); } if (this.canvas != null) { this.canvas.ReturnToPool(); } if (this.userData != null) { this.userData.ReturnToPool(); } this.type = ArmatureType.Armature; this.frameRate = 0; this.cacheFrameRate = 0; this.scale = 1.0f; this.name = ""; this.aabb.Clear(); this.animationNames.Clear(); this.sortedBones.Clear(); this.sortedSlots.Clear(); this.defaultActions.Clear(); this.actions.Clear(); this.bones.Clear(); this.slots.Clear(); this.constraints.Clear(); this.skins.Clear(); this.animations.Clear(); this.defaultSkin = null; this.defaultAnimation = null; this.canvas = null; this.userData = null; this.parent = null; // }