示例#1
0
    /*void Update()
     * {
     *  if (isFirstUpdate)
     *  {
     *      isFirstUpdate = false;
     *      sceneManager = GameObject.FindGameObjectWithTag("Scene");
     *      sceneScript = sceneManager.GetComponent<SceneManagerScript>();
     *  }
     * }*/

    void OnTriggerStay2D(Collider2D other)
    {
        //if (other.gameObject.tag == "Player" && Input.GetKey(KeyCode.X))
        if (other.gameObject.tag == "Player" && Input.GetButtonDown("Portal"))
        {
            sceneScript.ChangeScene(sceneName, true, transformID, transformDirect);
        }
    }