Ejemplo n.º 1
0
    public void Initialize()
    {
        if (context == null)
        {
            context = UMAContext.FindInstance();
        }

        if (umaData == null)
        {
            umaData = GetComponent <UMAData>();
            if (umaData == null)
            {
                umaData = gameObject.AddComponent <UMAData>();
                if (umaGenerator != null && !umaGenerator.gameObject.activeInHierarchy)
                {
                    Debug.LogError("Invalid UMA Generator on Avatar.", gameObject);
                    Debug.LogError("UMA generators must be active scene objects!", umaGenerator.gameObject);
                    umaGenerator = null;
                }
            }
        }
        if (umaGenerator != null)
        {
            umaData.umaGenerator = umaGenerator;
        }
        if (CharacterCreated != null)
        {
            umaData.CharacterCreated = CharacterCreated;
        }
        if (CharacterDestroyed != null)
        {
            umaData.CharacterDestroyed = CharacterDestroyed;
        }
        if (CharacterUpdated != null)
        {
            umaData.CharacterUpdated = CharacterUpdated;
        }
    }
Ejemplo n.º 2
0
 void Awake()
 {
     if (space <= 0)
     {
         space = 1;
     }
     if (UMAContextBase == null)
     {
         UMAContextBase = UMAContext.Instance;
     }
     if (generator == null)
     {
         GameObject go = GameObject.Find("UMAGenerator");
         if (go != null)
         {
             generator = go.GetComponent <UMAGenerator>();
         }
         else
         {
             generator = UMAContextBase.GetComponent <UMAGenerator>();
         }
     }
 }
 public abstract void Prepare(UMAData _umaData, UMAGeneratorBase _umaGenerator);
Ejemplo n.º 4
0
 void init(UMAGeneratorBase generator, [InjectOptional] UMARecipe recipe)
 {
     this.umaGenerator = generator;
     this.umaRecipe    = recipe;
 }