Esempio n. 1
0
    //Devuelve un ejemplo de como debe estar colocado y escalado un alimento
    public static Transform GetFoodExample(enAlimentos name)
    {
        GameObject Alimento = GameObject.FindGameObjectWithTag("AlimentoExamples");

        Debug.Log(name.ToString() + "s");
        Transform child   = Alimento.transform.Find(name.ToString() + "s");
        Transform example = child.GetComponentInChildren <FoodComponent>().transform;

        return(example);
    }
Esempio n. 2
0
    public static GameObject GetAlimentoPrefab(enAlimentos name)
    {
        Debug.Log(name.ToString());
        GameObject alimento = (GameObject)Resources.Load(name.ToString(), typeof(GameObject));

        //AJUSTAMOS LA ESCALA Y ROTACION DEL GAMEOBJECT (ES DECIR COPIAMOS EL TRANSFORM)
        alimento.transform.localScale = Alimento.GetFoodExample(name).lossyScale;
        alimento.transform.rotation   = Alimento.GetFoodExample(name).rotation;
        Debug.Log(alimento.ToString());
        return(alimento);
    }