示例#1
0
    void Start()
    {
        Ball.nextAdditionalBallScore = 10000;
        //adjust for different screen sizes
        widthMultiplier  = (float)Screen.width / 1340f / (float)Screen.height * 754f;
        heightMultiplier = 1;

        playSpaceLeft   *= widthMultiplier;
        playSpaceRight  *= widthMultiplier;
        playSpaceTop    *= heightMultiplier;
        playSpaceBottom *= heightMultiplier;
        brickWidth      *= widthMultiplier;
        brickHeight     *= heightMultiplier;

        brickScale = new Vector3(widthMultiplier, heightMultiplier * .9f, 1);


        if (numBricks == 0)
        {
            numBricks = -1;
        }
        musicManager = FindObjectOfType <FlexibleMusicManager>();
        backgrounds  = Resources.LoadAll <Texture>("Backgrounds");
        levels       = Resources.LoadAll <Texture2D>("Levels");

        //for (int i = 1; i <= 19; i++) {
        //    string tag = "Level_" + i + ".time";
        //    StatisticsManager.instance.LogStats(tag);
        //}
    }
示例#2
0
 public void ResetGame()
 {
     if (current_level != 0)
     {
         ScoreManager.instance.Save();
     }
     current_level = 0;
     if (!musicManager)
     {
         musicManager = FindObjectOfType <FlexibleMusicManager>();
     }
     if (musicManager.CurrentTrackNumber() > 0)
     {
         musicManager.Rewind();
     }
 }
示例#3
0
    void Awake()
    {
        // if the singleton hasn't been initialized yet
        if (dontDestroyOnLoad)
        {
            if (_instance != null && _instance != this)
            {
                Debug.LogError("Duplicate singleton " + this.gameObject + " created; destroying it now");
                Destroy(this.gameObject);
            }

            if (_instance != this)
            {
                _instance = this;
                DontDestroyOnLoad(this.gameObject);
            }
        }
        else
        {
            _instance = this;
        }
    }