private bool IsTargetCollider(Collider target) { bool isTarget = false; GameObject targetObj = target.gameObject; if (targetObj.name.Equals("PickUpSystem", StringComparison.OrdinalIgnoreCase)) { if (targetObj.TryGetComponent(out PickUpItems cartPickUp)) { cartPickUpSystem = cartPickUp; isTarget = true; } } return(isTarget); }
private void Start() { sfx = GameObject.FindGameObjectWithTag("SoundManager").GetComponent <SoundManager>(); pickUpItems = GameObject.FindGameObjectWithTag("Player").GetComponent <PickUpItems>(); this.inventory = GameManager.instance.inventory; }
void Awake() { instance = this; }