Beispiel #1
0
    void Start()
    {
        numberDrawer = GameObject.Find("Numbers");
        numberTxt    = numberDrawer.GetComponent <NumberTexture> ();
        scale        = 2.0f;
        numberScale  = 4.0f;

        medalManager = GameObject.Find("Medal");
        medalComp    = medalManager.GetComponent <MedalManager> ();
    }
Beispiel #2
0
    public Texture GetTexture(int number, bool circle)
    {
        NumberTexture tex = null;

        if (mTextures == null)
        {
            GenerateDictionnary();
        }
        if (mTextures.TryGetValue(number, out tex))
        {
            if (circle)
            {
                return(tex.Circle);
            }
            return(tex.Normal);
        }
        return(null);
    }
Beispiel #3
0
    void Awake()
    {
        this.scoreLabelTexture = (Texture2D)Resources.Load("UI/score");
        this.stageLabelTexture = (Texture2D)Resources.Load("UI/stage");
        this.gameOverTexture = (Texture2D)Resources.Load("UI/gameover");
        this.brokenTexture = (Texture2D)Resources.Load("UI/broken");
        this.outerTexture = (Texture2D)Resources.Load("UI/outer");
        this.lifeTexture = (Texture2D)Resources.Load ("UI/life");
        this.continueTexture = (Texture2D)Resources.Load ("UI/continue");
        this.scoreNumberTexture = new NumberTexture("UI/numbers", 37, 50);
        this.stageNumberTexture = new NumberTexture("UI/numbers", 37, 50);
        this.audio.volume = this.maxVolume;

        this.state = GameState.Start;
        this.levelManager = GameObject.FindWithTag("LevelManager");
        this.currentLevel = this.initialLevel;
        this.audioPlayer = GameObject.Find("AudioPlayer").GetComponent<AudioSource>();
        this.initialLevel = this.currentLevel;
        this.lives[0] = this.initialLife;
        this.lives[1] = this.initialLife;
        this.startAnimation = new Animation2D(new Rect((Screen.width - 800) / 2, (Screen.height - 600) / 2, 800, 600), "UI/Start/start", 57);
        this.destroyedEnemies = new List<Enemy>();
        this.Replay();
    }