private void OnCollisionEnter2D(Collision2D collision) { if (collision.collider.gameObject.GetComponent <DisShader>()) { targetEffect = collision.collider.gameObject.GetComponent <DisShader>(); if (targetEffect != null) { didHit = true; point = collision.GetContact(0).point; targetEffect.Reset(); } } }
private void Start() { disValue = GetComponent <DisShader>(); lg = transform.root.GetComponent <LevelGenerator>(); }