void OnCollisionEnter2D(Collision2D col) { if (col.gameObject == pico) { playerSelect.ZoomOut(); } }
// Update is called once per frame void Update() { Vector3 localScale = timer.rectTransform.localScale; localScale.x = Mathf.Sign(transform.lossyScale.x) * Mathf.Abs(localScale.x); timer.rectTransform.localScale = localScale; TTL -= Time.deltaTime; timer.text = dead ? "" : TTL.ToString("F1"); if (dead) { if (Time.time - timeOfDeath > TTD) { toggle.ZoomOut(); } else { Vector3 to = transform.parent.position; transform.position = Vector3.Lerp(deathPos, to, (Time.time - timeOfDeath) / TTD); } } else if (TTL < 0) { //Die(); } }
void OnCollisionEnter2D(Collision2D col) { if (col.collider.tag == "Lava") { player.canMove = false; player.canCollide = false; rigidbody2D.isKinematic = true; fading = true; TogglePlayer tp = FindObjectOfType <TogglePlayer>(); if (tp.currentCharacter == Character.PICO) { tp.ZoomOut(); } } }