Ejemplo n.º 1
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);
        }
Ejemplo n.º 2
0
        public void shoot(GameObject arrow, Ruler ruler)
        {
            SSAction action = ArrowShootAction.GetSSAction(arrow, ruler.getWind(), this);

            addAction(action);
        }