コード例 #1
0
    // Update is called once per frame
    void Update()
    {
        if (Input.GetKeyDown("escape"))
        {
            SceneManager.LoadScene(0);
        }
        switch (state)
        {
        case GameState.Menu:
            break;

        case GameState.Game:
            GameLoop();
            break;

        case GameState.HackerWins:
            Debug.Log("Hacker Wins");
            HackerObj.ChangeFace(Player.Face.Normal);
            ItguyObj.ChangeFace(Player.Face.Surprised);
            StartCoroutine(HackerWin());
            break;

        case GameState.ItguyWins:
            Debug.Log("Itguy Wins");
            HackerObj.ChangeFace(Player.Face.Surprised);
            ItguyObj.ChangeFace(Player.Face.Normal);
            StartCoroutine(ITWin());
            break;

        default:
            break;
        }
    }
コード例 #2
0
 // Use this for initialization
 void Start()
 {
     wintext = GameObject.Find("WinText");
     wintext.SetActive(false);
     state     = GameState.Game;
     HackerObj = (Hacker)GameObject.Find("Hacker").GetComponent(typeof(Hacker));
     ItguyObj  = (Itguy)GameObject.Find("Itguy").GetComponent(typeof(Itguy));
     HackerObj.ChangeFace(Player.Face.Normal);
     ItguyObj.ChangeFace(Player.Face.Normal);
 }