Ejemplo n.º 1
0
    // Use this for initialization
    void Start()
    {
        sharemgr          = shareData.Instance;
        sharemgr.scoreNum = 0;

        score   = GameObject.Find("score");
        gamemsg = GameObject.Find("gamemsg");
        timer   = GameObject.Find("time");
        camera  = GameObject.Find("Main Camera");
        larrow  = GameObject.Find("larrow");
        rarrow  = GameObject.Find("rarrow");


        scoretxt   = score.GetComponent <Text>();
        gamemsgtxt = gamemsg.GetComponent <Text>();
        timetxt    = timer.GetComponent <Text>();

        isPlay    = false;
        time      = 60.0f;
        countDown = 3;
        isEnd     = false;
        endtimer  = 0.0f;
        counter   = 0.0f;

        score.active = false;
        timer.active = false;

        larrow.active = false;
        rarrow.active = false;
    }
Ejemplo n.º 2
0
    // Use this for initialization
    void Start()
    {
        animemode  = 0;
        animetime  = 0.0f;
        score1st   = 0;
        score2nd   = 0;
        score3rd   = 0;
        updatemode = 0;

        sharemgr = shareData.Instance;

        bg       = GameObject.Find("bg");
        basemask = GameObject.Find("base");
        score    = GameObject.Find("score");
        ranking  = GameObject.Find("ranking");
        first    = GameObject.Find("1st");
        second   = GameObject.Find("2nd");
        third    = GameObject.Find("3rd");
        msg1     = GameObject.Find("msg1");
        msg2     = GameObject.Find("msg2");
        button   = GameObject.Find("Button");

        baseimg = basemask.GetComponent <Image>();

        score.active   = false;
        first.active   = false;
        second.active  = false;
        third.active   = false;
        ranking.active = false;
        msg1.active    = false;
        msg2.active    = false;
        button.active  = false;

        // UI/Imageだと画面と同じサイズであるにも関わらずサイズにズレがでる。
        // そのためSpriteとして扱いピッタリのサイズで扱えるようにする

        /*
         * Image bgimg = bg.GetComponent<Image>();
         * bgimg.sprite = Sprite.Create(sharemgr.gamebg, new Rect(0, 0, sharemgr.gamebg.width, sharemgr.gamebg.height), Vector2.zero);
         *
         * RectTransform t = bg.GetComponent<RectTransform>();
         *
         * // 設定
         * Vector2 sizeDelta = t.sizeDelta;
         * sizeDelta = new Vector2(Screen.width, Screen.height);
         * t.sizeDelta = sizeDelta;
         */

        Vector2        pivot = new Vector2(0.5f, 0.5f);
        SpriteRenderer bgimg = bg.GetComponent <SpriteRenderer>();

        bgimg.sprite = Sprite.Create(sharemgr.gamebg, new Rect(0, 0, sharemgr.gamebg.width, sharemgr.gamebg.height), pivot);

        bg.GetComponent <dynamicSprite>().FillScreen();

        LoadHighScore();
    }
Ejemplo n.º 3
0
    void Awake()
    {
        if (Instance != null)
        {
            Destroy(gameObject);
            return;
        }
        Instance = this;
        DontDestroyOnLoad(gameObject);

        scoreNum = 0;
        gamebg   = new Texture2D(Screen.width, Screen.height, TextureFormat.RGB24, false);
    }
Ejemplo n.º 4
0
    // Use this for initialization
    void Start()
    {
        timer = GameObject.Find("time");
        score = GameObject.Find("score");

        timertxt = timer.GetComponent <Text>();
        scoretxt = score.GetComponent <Text>();

        timertxt.text = countDown.ToString();

        candyList = new List <GameObject>();

        gage               = GameObject.Find("gage");
        gageimg            = gage.GetComponent <Image>();
        gageimg.fillAmount = 0.0f;

        sharemgr          = shareData.Instance;
        sharemgr.scoreNum = 0;

        endtimer = 0.0f;

        bgm = GameObject.Find("bgm");
    }