コード例 #1
0
 void OnCollisionStay(Collision other)
 {
     if (other.gameObject.tag == "Player")
     {
         FirstSceneController.getInstance().setGameOver(-1);
     }
 }
コード例 #2
0
ファイル: Patrol.cs プロジェクト: MapleLai/Homework6
 void Start()
 {
     player    = FirstSceneController.getInstance().player;
     minX      = this.transform.position.x - 2.5f;
     minZ      = this.transform.position.z - 2.5f;
     patroling = true;
     time      = 3f;
 }
コード例 #3
0
ファイル: UserInterface.cs プロジェクト: MapleLai/Homework6
    void FixedUpdate()
    {
        if (FirstSceneController.getInstance().gameOver != 0)
        {
            return;
        }

        float translationX = Input.GetAxis("Horizontal") * 6;
        float translationZ = Input.GetAxis("Vertical") * 6;

        translationX *= Time.deltaTime;
        translationZ *= Time.deltaTime;
        this.transform.Translate(translationX, 0, 0);
        this.transform.Translate(0, 0, translationZ);
    }
コード例 #4
0
ファイル: Patrol.cs プロジェクト: MapleLai/Homework6
    void FixedUpdate()
    {
        if (FirstSceneController.getInstance().gameOver != 0)
        {
            return;
        }

        if (patroling)
        {
            GoAhead();
        }
        else
        {
            Follow();
        }
    }
コード例 #5
0
 void OnGUI()
 {
     if (FirstSceneController.getInstance().gameOver == -1)
     {
         GUIStyle style = new GUIStyle();
         style.normal.background = null;
         style.normal.textColor  = new Color(0, 0, 0);
         style.fontSize          = 40;
         GUI.TextField(new Rect(200, 150, 300, 50), "Player2 Wins!", style);
     }
     if (FirstSceneController.getInstance().gameOver == 1)
     {
         GUIStyle style = new GUIStyle();
         style.normal.background = null;
         style.normal.textColor  = new Color(0, 0, 0);
         style.fontSize          = 40;
         GUI.TextField(new Rect(200, 150, 300, 50), "Player1 Wins!", style);
     }
 }
コード例 #6
0
ファイル: SSDirector.cs プロジェクト: MapleLai/Homework6
 void Start()
 {
     firstSceneController = FirstSceneController.getInstance();
 }
コード例 #7
0
 void CmdAddPlayer()
 {
     FirstSceneController.getInstance().addPlayer();
 }