Пример #1
0
    private int getSaveCount()
    {
        Transform    mainExit;
        ExitCollider script = new ExitCollider();

        GameObject[] exitList = GameObject.FindGameObjectsWithTag("exit");
        foreach (GameObject exit in exitList)
        {
            script = exit.GetComponent <ExitCollider>();
            if (script.open)
            {
                mainExit = exit.transform;
                break;
            }
        }

        return(script.saveCount);
    }
 private void OnCollisionExit2D(Collision2D other)
 {
     ExitCollider?.Invoke(other);
 }