示例#1
0
 // Start is called before the first frame update
 public void change_scene()
 {
     key_info = GameObject.FindGameObjectWithTag("key_info");
     kis      = key_info.GetComponent <key_info_script>();
     kis.add_key();
     SceneManager.LoadScene(5);
 }
示例#2
0
 // Start is called before the first frame update
 void Start()
 {
     rb       = gameObject.GetComponent <Rigidbody2D>();
     anim     = gameObject.GetComponent <Animator>();
     speed    = 2;
     key_info = GameObject.FindGameObjectWithTag("key_info");
     kis      = key_info.GetComponent <key_info_script>();
 }
示例#3
0
    // Start is called before the first frame update
    void Start()
    {
        if (instanceRef == null)
        {
            instanceRef = this;
            DontDestroyOnLoad(gameObject);
        }

        else
        {
            DestroyImmediate(gameObject);
        }
    }