Advertisement
JonneOpettaja

TitleScreen skriptin lisäykset

Feb 16th, 2018
192
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.79 KB | None | 0 0
  1. using System.Collections;
  2. using System.Collections.Generic;
  3. using UnityEngine.SceneManagement;
  4. using UnityEngine;
  5.  
  6. public class TitleScreen : MonoBehaviour {
  7.  
  8.     public Texture titleTexture;
  9.  
  10.  
  11.     private void Start()
  12.     {
  13.  
  14.  
  15.     }
  16.  
  17.     private void OnGUI()
  18.     {
  19.         GUI.DrawTexture(new Rect(0, 0, Screen.width, Screen.height), titleTexture);
  20.         if (GUI.Button(new Rect(Screen.width / 2 - 200, Screen.height / 4, 200, 50), "Start Game"))
  21.         {
  22.             SceneManager.LoadScene("Scene1");
  23.         }
  24.         GUI.skin.label.fontSize = 20;
  25.         GUI.skin.label.alignment = TextAnchor.UpperCenter;
  26.  //       GUI.Label(new Rect(Screen.width / 2 - 400 / 2, Screen.height / 2 - 200 / 2, 400, 200),
  27.    //         hiscores.GetComponent<Hiscores>().GetTimes());
  28.     }
  29.  
  30. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement