场景数据传递

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

}

 

posted @ 2014-10-20 22:18  ing...  阅读(127)  评论(0)    收藏  举报