コード例 #1
0
    private void Awake()
    {
        if (instance == null)
        {
            Debug.Log("CREANTE INSTANE");
            instance = this;
        }
        else if (instance != this)
        {
            Destroy(gameObject);
        }

        DontDestroyOnLoad(gameObject);
    }
コード例 #2
0
    // Use this for initialization
    void Start()
    {
        scoreSingelton = FindObjectOfType <ScoreSingelton>();

        text.SetText("Super!\n\nYou opened\n\n" + ScoreSingelton.instance.GetDestroyedPrestentScore() + "\n\npresents in the right order!");
    }