public override void generateGOCard() { BoxCollider colidCarte = gameObject.AddComponent <BoxCollider> (); colidCarte.size = new Vector3(1.5f, .1f, 2f); colidCarte.center = new Vector3(0, .15f, 0); GameObject goCartePlanete = new GameObject("CartePlanete_" + id); goCartePlanete.transform.SetParent(gameObject.transform); goCartePlanete.transform.localPosition = new Vector3(0, 0.1f, 0); goCartePlanete.transform.localRotation = Quaternion.identity; TextMesh txtPseudo = GenerateObjectUtils.createText("pseudo", new Vector3(0, 0.01f, .75f), Quaternion.identity, new Vector3(2f, 1, .5f), 14, goCartePlanete); txtPseudo.text = this.pseudo; //TODO remplacer par image GameObject goImage = GameObject.CreatePrimitive(PrimitiveType.Plane); goImage.name = "Avatar_" + id; goImage.transform.SetParent(goCartePlanete.transform); goImage.transform.localPosition = new Vector3(0, 0.01f, 0); goImage.transform.localRotation = Quaternion.identity; goImage.transform.localScale = new Vector3(.2f, 1, .1f); txtPointVie = GenerateObjectUtils.createText("pointVie", new Vector3(0, 0.01f, -.75f), Quaternion.identity, new Vector3(2f, 1, .5f), 14, goCartePlanete); txtPointVie.text = "PV - " + pointVie; }
public void Start() { txtEtat = GenerateObjectUtils.createText("boutonEtat", new Vector3(0, 0.51f, 0), Quaternion.identity, Vector3.one, 14, gameObject); CmdSetEtatBouton(enumEtatBouton.enAttente); onChangeEtatBouton(enumEtatBouton.enAttente); }