Ejemplo n.º 1
0
    IEnumerator Invisible()
    {
        yield return(new WaitForSeconds(invisibleTime));

        currentDissolveController.Dissolve(true);
        Destroy(gameObject);
    }
Ejemplo n.º 2
0
 private void OnTriggerEnter2D(Collider2D other)
 {
     if (other.transform.CompareTag("PickableItem") || other.transform.CompareTag("Enemy"))
     {
         trail.enabled          = false;
         spriteRenderer.enabled = false;
         rb_collider.enabled    = false;
         Debug.Log("pickable item");
         currentHit = other.gameObject;
         currentDissolveController = currentHit.GetComponent <DissolveController>();
         if (currentDissolveController != null)
         {
             currentDissolveController.Dissolve();
             StartCoroutine(Invisible());
         }
         velocity = Vector2.zero;
     }
     else if (other.transform.CompareTag("Ground"))
     {
         Destroy(gameObject);
     }
 }