// Start is called before the first frame update private void Awake() { theWalls = new GameObject[transform.childCount]; _wallManagerScript = GameObject.FindWithTag("WallController").GetComponent <WallManager>(); _thisWallChange = GetComponent <WallChange>(); for (int i = 0; i < theWalls.Length; i++) { theWalls[i] = transform.GetChild(i).gameObject; } }
public void IAmConnectedIMustConnect() { if (_isConnected) { _connectedWall = _wallManagerScript.SetConnectedWall(gameObject); } if (_connectedWall != null) { _connectedWallProprieties = _connectedWall.GetComponent <WallProprieties>(); _connectedWallChange = _connectedWall.GetComponent <WallChange>(); } }
//gère les dommages des murs connectés public void ConnectedtWallDammage(float myDammage, GameObject thisWall, WallProprieties connectedWallProprieties, WallChange connectedWallChange) { if (!connectedWallProprieties.GetIsIndestructible()) { connectedWallChange.SetDammageFromConnect(myDammage); } }