示例#1
0
    void Awake()
    {
        if (instance == null)
        {
            instance = this;
            gameObject.SetActive(false);
            if (dontDestroyOnLoad)
            {
                DontDestroyOnLoad(instance.gameObject);
            }

            texture = CreateTexture(new Color(1f, 1f, 1f, 1f));
        }
        else
        {
            Destroy(gameObject);
        }
    }
示例#2
0
    void Awake()
    {
        if( instance == null ){
            instance=  this;
            gameObject.SetActive( false );
            if( dontDestroyOnLoad ){
                DontDestroyOnLoad( instance.gameObject );
            }

            texture = CreateTexture( new Color( 1f,1f,1f,1f ) );
        }
        else{
            Destroy( gameObject );
        }
    }