Exemplo n.º 1
0
    IEnumerator Up(Collider2D other)
    {
        yield return(new WaitForSeconds(0.2f));

        transform.position = new Vector3(transform.position.x, transform.position.y + 0.01f, transform.position.z);

        spring.connectedBody = other.gameObject.GetComponent <Rigidbody2D>();
        transform.position   = other.transform.position;
        GetComponent <Rigidbody2D>().isKinematic = true;
        spring.enabled = true;
        rayToMouse     = new Ray(other.transform.position, Vector3.zero);

        central_script.Shoot();
        Debug.Log("Catch");
        panicable = true;
        // Now do your thing here
    }