コード例 #1
0
 // Start is called before the first frame update
 void Start()
 {
     shipController = FindObjectOfType <ShipController>();
     finalObject    = GameObject.FindGameObjectWithTag("final_object");
     scoreTracker   = FindObjectOfType <ScoreTracker>();
     planetManager  = FindObjectOfType <PlanetManager>();
     gameManager    = FindObjectOfType <GameManager>();
     winScreen      = FindObjectOfType <WinScreenUI>();
 }
コード例 #2
0
    private void Awake()
    {
        Instance = this;

        transform.Find("restartBtn").GetComponent <Button>().onClick.AddListener(() => {
            GameSceneManager.Load("Level1");
        });
        transform.Find("quitBtn").GetComponent <Button>().onClick.AddListener(() => {
            GameSceneManager.Load("MainMenuScene");
            PlayerPrefs.SetInt("CurrentScore", 0);
        });

        Hide();
    }
コード例 #3
0
ファイル: WinScreenUI.cs プロジェクト: robbie932/LudumDare48
 private void Awake()
 {
     instance = this;
     gameObject.SetActive(true);
 }