private void OnTriggerEnter2D(Collider2D collision)
    {
        CheckPoint ctl = collision.GetComponent <CheckPoint>();

        if (ctl != null)
        {
            if (ctl.priority > last_checkpoint_priority)
            {
                last_checkpoint = ctl.GetComponent <Rigidbody2D>().position;
            }
        }
    }
Exemple #2
0
    public void PlaceOnCP(CheckPoint cp, bool instant = false)
    {
        StopCoroutine("PlacingOnCP");

        traveling       = false;
        controllable    = true;
        ignoredCollider = cp.GetComponent <Collider2D>();

        if (instant)
        {
            transform.position = cp.transform.position;
        }
        else
        {
            StartCoroutine("PlacingOnCP", cp.transform.position);
        }
    }
 private void OnEnable()
 {
     A      = (CheckPoint)target;
     A.Coll = A.GetComponent <SphereCollider>();
 }