public void characterCreated(UMAData umaCreated)
        {
            head = umaCreated.GetBoneGameObject("Head");

            MoveCamera();

            player = gameObject.GetComponentInChildren <UMAExpressionPlayer>();
            if (player == null)
            {
                Animator umaAnimator = GetComponentInChildren <Animator>();
                if (umaAnimator != null)
                {
                    player = umaAnimator.gameObject.AddComponent <UMAExpressionPlayer>();
                    player.overrideMecanimNeck = true;
                    player.overrideMecanimHead = true;
                    player.overrideMecanimJaw  = true;
                    player.overrideMecanimEyes = true;
                }

                umaAnimator.Rebind();
            }

            if (player != null)
            {
                if (expressionSet != null)
                {
                    player.expressionSet = expressionSet;
                }

                player.Initialize();
                guiValues = new float[UMAExpressionPlayer.PoseCount];
            }
        }
示例#2
0
		public void characterCreated(UMAData umaCreated)
		{
			head = umaCreated.GetBoneGameObject("Head");

			MoveCamera();

			player = gameObject.GetComponentInChildren<UMAExpressionPlayer>();
			if (player == null)
			{
				Animator umaAnimator = GetComponentInChildren<Animator>();
				if (umaAnimator != null)
				{
					player = umaAnimator.gameObject.AddComponent<UMAExpressionPlayer>();
					player.overrideMecanimNeck = true;
					player.overrideMecanimHead = true;
					player.overrideMecanimJaw = true;
					player.overrideMecanimEyes = true;
				}

#if !UNITY_4_3
				umaAnimator.Rebind();
#endif
			}

			if (player != null)
			{
				if (expressionSet != null)
				{
					player.expressionSet = expressionSet;
				}

				player.Initialize();
				guiValues = new float[UMAExpressionPlayer.PoseCount];
			}
		}
    //practical guide to UMA part 15 intercepting uma events https://youtu.be/_k-SZRCvgIk?t=4m17s
    void CharacterCreatedCallback(UMAData umaData)
    {
        //Debug.Log("UMA_Created");
        GrabStaff();

        // A Practical Guide To UMA - Part 17 - Using the Expression Player  https://youtu.be/nJI-kUYYuWE
        UMAExpressionSet expressionSet = umaData.umaRecipe.raceData.expressionSet;
        expressionPlayer = umaData.gameObject.AddComponent<UMAExpressionPlayer>();
        expressionPlayer.expressionSet = expressionSet;
        expressionPlayer.umaData = umaData;
        expressionPlayer.Initialize();
        // automated expressions to look life like
        expressionPlayer.enableBlinking = true;
        expressionPlayer.enableSaccades = true;
    }