public void DisplayZone() { BombZone bomb = Instantiate(zone, transform.position, transform.rotation); Renderer rendererZ = bomb.GetComponent <Renderer>(); Color bombZoneColor = bombColor; bombZoneColor.a = 0.25f; rendererZ.material.SetColor("_TintColor", bombZoneColor); bomb.transform.parent = gameObject.transform; bomb.transform.localScale = Vector3.one * (expRadius * 2); isZoned = true; }
// Use this for initialization void Start() { zone = (BombZone)Resources.Load("Prefabs/BombZone", typeof(BombZone)); totaleDistanceToTarget = Vector3.Distance(transform.position, targetPosition); //Truc pour changer la couleur des bombes, a ranger ailleurs rendererB = GetComponent <Renderer> (); rendererB.material.SetColor("_Color", bombColor); Color bombColor2 = bombColor; bombColor2.a = 0.5f; rendererB.material.SetColor("_OutlineColor", bombColor2); InitializeBombCard(); rb.AddForce((targetPosition - transform.position).normalized * 2000, ForceMode.Acceleration); }