public void OnHit() { WallParent parent = GetComponentInParent <WallParent>(); parent.DisableKinematicsAllBlock(); parent.Crashed = true; GameObject detonator = (GameObject)Instantiate(DetonatorPrefab); detonator.transform.position = this.transform.position; detonator.transform.parent = GameObject.FindWithTag(Tags.DetonatorParent).transform; }
void Awake() { gameController = GameObject.FindWithTag(Tags.GameController).GetComponent <GameController>(); wall = GetComponent <WallParent>(); }