首页 > 代码库 > 场景数据传递

场景数据传递

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;        }    }}

 

场景数据传递