public void OnEnable()
 {
     thisDCA = target as DynamicCharacterAvatar;
     if (thisDCA.context == null)
     {
         thisDCA.context = UMAContext.FindInstance();
         if (thisDCA.context == null)
         {
             thisDCA.context = thisDCA.CreateEditorContext();
         }
     }
     else if (thisDCA.context.gameObject.name == "UMAEditorContext")
     {
         //this will set also the existing Editorcontext if there is one
         thisDCA.CreateEditorContext();
     }
     else if (thisDCA.context.gameObject.transform.parent != null)
     {
         //this will set also the existing Editorcontext if there is one
         if (thisDCA.context.gameObject.transform.parent.gameObject.name == "UMAEditorContext")
         {
             thisDCA.CreateEditorContext();
         }
     }
     _racePropDrawer.thisDCA = thisDCA;
     _racePropDrawer.thisDynamicRaceLibrary = (DynamicRaceLibrary)thisDCA.context.raceLibrary as DynamicRaceLibrary;
     _wardrobePropDrawer.thisDCA            = thisDCA;
     _wardrobePropDrawer.thisDCS            = (DynamicCharacterSystem)thisDCA.context.dynamicCharacterSystem as DynamicCharacterSystem;
     _animatorPropDrawer.thisDCA            = thisDCA;
 }
Beispiel #2
0
 public void OnEnable()
 {
     baseColorNames.Clear();
     baseColorNames.AddRange(new string[] { "skin", "hair", "eyes" });
     thisDCA = target as DynamicCharacterAvatar;
     if (thisDCA.context == null)
     {
         thisDCA.context = UMAContextBase.Instance;
         if (thisDCA.context == null)
         {
             thisDCA.context = thisDCA.CreateEditorContext();
         }
     }
     else if (thisDCA.context.gameObject.name == "UMAEditorContext")
     {
         //this will set also the existing Editorcontext if there is one
         thisDCA.CreateEditorContext();
     }
     else if (thisDCA.context.gameObject.transform.parent != null)
     {
         //this will set also the existing Editorcontext if there is one
         if (thisDCA.context.gameObject.transform.parent.gameObject.name == "UMAEditorContext")
         {
             thisDCA.CreateEditorContext();
         }
     }
     _racePropDrawer.thisDCA     = thisDCA;
     _wardrobePropDrawer.thisDCA = thisDCA;
     _animatorPropDrawer.thisDCA = thisDCA;
 }
Beispiel #3
0
	public void OnEnable()
    {
        thisDCA = target as DynamicCharacterAvatar;
		var context = UMAContext.FindInstance();
		if(context == null)
		{
			context = thisDCA.CreateEditorContext();
		}
		//Set this DynamicCharacterAvatar for RaceSetter so if the user chages the race dropdown the race changes
		if (_racePropDrawer.thisDCA == null)
        {
            _racePropDrawer.thisDCA = thisDCA;
			//Set the raceLibrary for the race setter
			if (context)
			{
				var dynamicRaceLibrary = (DynamicRaceLibrary)context.raceLibrary as DynamicRaceLibrary;
				_racePropDrawer.thisDynamicRaceLibrary = dynamicRaceLibrary;
			}
        }
		if (_wardrobePropDrawer.thisDCS == null)
		{
			_wardrobePropDrawer.thisDCA = thisDCA;
            if (context)
			{
				var dynamicCharacterSystem = (DynamicCharacterSystem)context.dynamicCharacterSystem as DynamicCharacterSystem;
				_wardrobePropDrawer.thisDCS = dynamicCharacterSystem;
			}
		}
		if (_animatorPropDrawer.thisDCA == null)
		{
			_animatorPropDrawer.thisDCA = thisDCA;
		}
	}