public void AsignarTipo(string t) { if (t[0] == '0') { tipo = TipoPlaneta.solido; int a = int.Parse(t[1] + ""); gradienteBN = coloresSolidos[Random.Range(3 * a, 3 * a + 3)]; } else if (t[0] == '1') { tipo = TipoPlaneta.habitable; int a = int.Parse(t[1] + ""); probabilidadTierra = (a + 0f) * pDef; material.SetTexture("_BumpMap", null); hacerPolo = (Random.Range(0f, 1f) > 0.5f); } else if (t[0] == '2') { tipo = TipoPlaneta.gaseoso; } else if (t[0] == '3') { tipo = TipoPlaneta.luna; } }
public void AsignarTipo(TipoPlaneta t) { recursoEnergía = Random.Range(0.2f, 0.4f); recursoGas = Random.Range(0.2f, 0.4f); recursoMineral = Random.Range(0.2f, 0.4f); switch (t) { case TipoPlaneta.gaseoso: recursoGas = Random.Range(0.5f, 0.9f); break; case TipoPlaneta.solido: recursoMineral = Random.Range(0.5f, 0.9f); break; case TipoPlaneta.habitable: recursoEnergía = Random.Range(0.5f, 0.9f); break; case TipoPlaneta.luna: break; default: break; } }