Esempio n. 1
0
 protected void OnUmaAvatarDataChange(bool isInit, UmaAvatarData avatarData)
 {
     if (CharacterModel is AnimatorCharacterModelUMA)
     {
         AnimatorCharacterModelUMA animatorCharacterModelUma = CharacterModel as AnimatorCharacterModelUMA;
         if (animatorCharacterModelUma == null)
         {
             return;
         }
         animatorCharacterModelUma.ApplyUmaAvatar(avatarData);
     }
 }
Esempio n. 2
0
        public override void ConvertToNewerCharacterModel()
        {
            if (animatorType != AnimatorType.Animator)
            {
                Debug.LogError("[Character Model UMA] only animator can be converted");
                return;
            }
            AnimatorCharacterModelUMA model = gameObject.GetComponent <AnimatorCharacterModelUMA>();

            if (!model)
            {
                model = gameObject.AddComponent <AnimatorCharacterModelUMA>();
            }
            model.skinnedMeshRenderer = skinnedMeshRenderer;
            model.weaponAnimations    = weaponAnimations;
            model.skillAnimations     = skillAnimations;
            model.defaultAnimations   = new DefaultAnimations()
            {
                idleClip                  = defaultAnimatorData.idleClip,
                moveClip                  = defaultAnimatorData.moveClip,
                moveBackwardClip          = defaultAnimatorData.moveBackwardClip,
                moveLeftClip              = defaultAnimatorData.moveLeftClip,
                moveRightClip             = defaultAnimatorData.moveRightClip,
                moveForwardLeftClip       = defaultAnimatorData.moveForwardLeftClip,
                moveForwardRightClip      = defaultAnimatorData.moveForwardRightClip,
                moveBackwardLeftClip      = defaultAnimatorData.moveBackwardLeftClip,
                moveBackwardRightClip     = defaultAnimatorData.moveBackwardRightClip,
                jumpClip                  = defaultAnimatorData.jumpClip,
                fallClip                  = defaultAnimatorData.fallClip,
                hurtClip                  = defaultAnimatorData.hurtClip,
                deadClip                  = defaultAnimatorData.deadClip,
                rightHandAttackAnimations = defaultAttackAnimations,
                leftHandAttackAnimations  = defaultAttackAnimations,
                rightHandReloadAnimation  = defaultReloadAnimation,
                leftHandReloadAnimation   = defaultReloadAnimation,
                skillCastClip             = defaultSkillCastClip,
                skillActivateAnimation    = defaultSkillActivateAnimation,
            };
            model.hiddingObjects      = hiddingObjects;
            model.hiddingRenderers    = hiddingRenderers;
            model.fpsHiddingObjects   = fpsHiddingObjects;
            model.fpsHiddingRenderers = fpsHiddingRenderers;
            model.effectContainers    = effectContainers;
            model.equipmentContainers = equipmentContainers;
            EditorUtility.SetDirty(model);
            EditorUtility.DisplayDialog("Character Model Conversion", "New Character Model component has been added.\n\nThe old component doesn't removed yet to let you check values.\n\nThen, you have to remove the old one.", "OK");
        }