void OnTriggerExit2D(Collider2D other) { if (other.gameObject.CompareTag("Player")) { Wrap(other.transform); Player p = other.GetComponent <Player> (); if (p.hat.isCurrentlyAttached) { p.hat.transform.position = p.transform.position; } PlayerAnimationVFXController anim = p.GetComponentInChildren <PlayerAnimationVFXController>(); anim.ToggleFastFallTrail(true); } else if (other.gameObject.CompareTag("Hat")) { Hat h = other.GetComponent <Hat> (); Wrap(h.transform); if (h.isCurrentlyAttached) { h.owner.transform.position = h.transform.position; } } CameraFX.instance.ShakeCamera(0.1f, 0.05f, 1f); }
void Awake() { animController = GetComponent <PlayerAnimationVFXController>(); }