예제 #1
0
        void Awake()
        {
            Director director = Director.getInstance();

            director.setFPS(60);
            director.currentSceneController = this;

            judgement = Judge.getInstance();
            ruler     = Ruler.getInstance();

            loadInitSetting();
            actionManager = this.gameObject.AddComponent <SSActionManager>();
            actionManager.setCallback(this);

            this.gameObject.AddComponent <UserGUI>();
            director.currentSceneController.LoadResources();
        }
예제 #2
0
        private void OnGUI()
        {
            float screenWidth  = UnityEngine.Screen.width;
            float screenHeight = UnityEngine.Screen.height;

            //Add Button and click event
            float buttonWidth  = 100;
            float buttonHeight = 50;

            if (GUI.Button(new Rect(0, (screenHeight - buttonHeight), buttonWidth, buttonHeight), "Back"))
            {
                action.back();
            }

            //Add Score Lable
            float    scoreWidth     = 100;
            float    scoreHeight    = 30;
            GUIStyle scoreFontStyle = new GUIStyle();

            scoreFontStyle.alignment        = TextAnchor.MiddleCenter;
            scoreFontStyle.fontSize         = 20;
            scoreFontStyle.normal.textColor = Color.red;
            GUI.Label(new Rect((screenWidth - scoreWidth), 0, scoreWidth, scoreHeight), "Score: " + judgement.getScore(), scoreFontStyle);

            float windWidth  = 320;
            float windHeight = 50;

            GUI.Label(new Rect((screenWidth - windWidth), scoreHeight, windWidth, windHeight), Ruler.getInstance().display(), scoreFontStyle);
        }