private void OnTriggerEnter(Collider other) { if (other.gameObject.layer.Equals(LayerMask.NameToLayer("BallDrop"))) { BallDrop ballDrop = other.GetComponent <BallDrop>(); characterInfo.playerScore += ballDrop.ballScore; Destroy(ballDrop.gameObject); } }
private void Start() { characterInfo = GetComponentInParent <CharacterInfo>(); ballDrop = ballDropPrefab.GetComponent <BallDrop>(); }