private void updateAvatar() { if (character == null) { character = new GameObject(); } character.SetActive(true); mainPaperdoll = character.GetComponent <Paperdoll>(); if (mainPaperdoll == null) { mainPaperdoll = character.AddComponent <Paperdoll>(); } KFAnimation kf = animationNif.getActiveAnimation(); string animString = kf.sequencename; if (kf.sequencename.StartsWith("mount")) { animString = kf.sequencename; } else { if (kf.sequencename.Contains("mount_")) { animString = kf.sequencename.Substring(kf.sequencename.IndexOf("mount")); } } Debug.Log("setting avatar animation to:" + animString); mainPaperdoll.animOverride = animString; mainPaperdoll.setKFBPostFix("mount"); mainPaperdoll.setGender("male"); mainPaperdoll.setRace("human"); mainPaperdoll.animSpeed = this.animationNif.animSpeed; character.transform.parent = this.nifmodel.transform; character.transform.localPosition = new Vector3(0, 0, 0); character.transform.localRotation = Quaternion.identity; mainPaperdoll.transform.localRotation = Quaternion.identity; //mainPaperdoll.setAppearenceSet(1044454339); int key = ProgramSettings.get("MOUNT_AVATAR_KEY", 736798136); // mainPaperdoll.setAppearenceSet(key); mainPaperdoll.zeroFrame(); this.animationNif.zeroFrame(); }
public void updateAnimationSet() { string animSet = animationSetDropdown.options[animationSetDropdown.value].text; if (animSet.Equals("unarmed")) { animSet = ""; } paperDoll.setKFBPostFix(animSet); ClothingItemRenderer[] renderers = panelUpdater.getPanelRenderers(); foreach (ClothingItemRenderer r in renderers) { if (r.previewPaperdoll != null) { r.previewPaperdoll.setKFBPostFix(animSet); r.refresh(); } } // reapply the costume changeAppearance(); }