public override void OnEnter()
        {
            avatar = ((GameObject)gameObject.Value).GetComponent <UMAAvatarBase> ();
            var asset = ScriptableObject.CreateInstance <UMATextRecipe>();

            asset.recipeString = recipe.Value;
            avatar.Load(asset);
            Finish();
        }
Example #2
0
    void Loading()
    {
        if (Application.isPlaying)
        {
            //	umaData = gameObject.GetComponent<UMAData>();

            var selectedTransform = transform;
            avatar = selectedTransform.GetComponent <UMAAvatarBase>();

            while (avatar == null && selectedTransform.parent != null)
            {
                selectedTransform = selectedTransform.parent;
                avatar            = selectedTransform.GetComponent <UMAAvatarBase>();
            }
            if (avatar != null)
            {
                var asset = ScriptableObject.CreateInstance <UMATextRecipe>();
                asset.recipeString = _StreamedUMA;

                if (avatar.umaData == null)
                {
                    avatar.umaData = gameObject.AddComponent <UMAData>();
                }
                if (avatar.umaData.umaRecipe == null)
                {
                    avatar.umaData.umaRecipe = new UMAData.UMARecipe();
                }

                avatar.Load(asset);
                Destroy(asset);
                Debug.Log("Auto Loading");
                //	Invoke ( "ApplyDNA", 3f );
                //	ApplyDNA();
            }
            //	if (  avatar.umaData != null ){
            //		ApplyDNA();
            //	}
        }
    }