/// <summary> /// Change Animator Layer Set /// </summary> public void ChangeAnimatorLayerSet(CharacterBodyType type, int layerType, bool setValue, Sprite icon) { switch (type) { case CharacterBodyType.Head: this.SelectedHeadIcon.sprite = icon; for (int i = 0; i < this.Head.layerCount; i++) { this.Head.SetLayerWeight(i, i == layerType ? 1.0f : 0.0f); } if (setValue) { this.CharacterEditPanel.CharacterConfig.HeadType = layerType; } break; case CharacterBodyType.Body: this.SelectedBodyIcon.sprite = icon; for (int i = 0; i < this.Body.layerCount; i++) { this.Body.SetLayerWeight(i, i == layerType ? 1.0f : 0.0f); } for (int i = 0; i < this.ArmBehind.layerCount; i++) { this.ArmBehind.SetLayerWeight(i, i == layerType ? 1.0f : 0.0f); } if (setValue) { this.CharacterEditPanel.CharacterConfig.BodyType = layerType; this.CharacterEditPanel.CharacterConfig.ArmBehindType = layerType; } break; case CharacterBodyType.Legs: this.SelectedLegsIcon.sprite = icon; for (int i = 0; i < this.Legs.layerCount; i++) { this.Legs.SetLayerWeight(i, i == layerType ? 1.0f : 0.0f); } if (setValue) { this.CharacterEditPanel.CharacterConfig.LegsType = layerType; } break; default: break; } for (int i = 0; i < this._CurrentObjectTabDisplays.Count; i++) { CharacterOutfitButton outfitButton = this._CurrentObjectTabDisplays[i].GetComponent <CharacterOutfitButton>(); if (outfitButton.CharacterBodyType != type) { continue; } if (outfitButton.BodyType != layerType) { outfitButton.ButtonToggle(true); } } }