zl程序教程

您现在的位置是:首页 >  大数据

当前栏目

场景数据传递

数据 场景 传递
2023-09-14 08:57:07 时间
using UnityEngine;
using System.Collections;
using System.Collections.Generic;

public class TestSceneData : MonoBehaviour
{
    public string PlayerName = "";

    public static TestSceneData Instance;

    public List<string> m_List = new List<string>();

    void Awake()
    {
        if (Instance)
        {
            Destroy(gameObject);
        }
        else
        {
            DontDestroyOnLoad(gameObject);
            Instance = this;
        }
    }

}