public void Respawn(WSB_Player _p) { if (_p.GetComponent <WSB_Ban>() && checkPointBan) { _p.transform.position = checkPointBan.transform.position; } else if (_p.GetComponent <WSB_Lux>() && checkpointLux) { _p.transform.position = checkpointLux.transform.position; } }
private void Awake() { // Checks owner, destroy itself if not found if (!owner) { Debug.LogError($"Erreur, component Wsb_Player manquant sur {transform.name} parent"); Destroy(this); } // Checks Image components, destroy itself if not found if (!images[0] || !images[1] || !images[2] || !images[3]) { Debug.LogError($"Erreur, component Image manquant sur {transform.name} parent"); Destroy(this); } // Checks TMP_Text components, destroy itself if not found if (!texts[0] || !texts[1] || !texts[2] || !texts[3]) { Debug.LogError($"Erreur, component TMP_Text manquant sur {transform.name} parent"); Destroy(this); } // Sets the correct tags for each players if (owner.GetComponent <WSB_Ban>()) { images[3].tag = "Earth"; images[0].tag = "Wind"; images[1].tag = "Light"; images[2].tag = "Shrink"; } else { currentSpell = 3; images[3].tag = "Carnivore"; images[0].tag = "Ladder"; images[1].tag = "Bridge"; images[2].tag = "Trampoline"; } }