Пример #1
0
 public void AddPointForPlayer(PlayerController.PlayerNumber playerNumber)
 {
     if (playerNumber == PlayerController.PlayerNumber.LEFT)
     {
         playerLeftPoints++;
     }
     else
     {
         playerRightPoints++;
     }
 }
 public void Init(PlayerController.PlayerNumber pNum)
 {
     if (pNum == PlayerController.PlayerNumber.p1)
     {
         gamePlayerId = PlayerSelect.S.p1Controller;
     }
     else
     {
         //p2
         gamePlayerId = PlayerSelect.S.p2Controller;
     }
 }
Пример #3
0
 public void PointFor(PlayerController.PlayerNumber playerNumber)
 {
     if (playerNumber == PlayerController.PlayerNumber.LEFT)
     {
         leftDoor.Find("door").transform.Rotate(Vector3.up * 90);
     }
     else
     {
         rightDoor.Find("door").transform.Rotate(Vector3.up * -90);
     }
     GlobalController.instance.AddPointForPlayer(playerNumber);
 }
Пример #4
0
 public void GoodKnock(PlayerController.PlayerNumber player)
 {
     if (player == PlayerController.PlayerNumber.LEFT)
     {
         leftGoodKnocks++;
         leftGoodKnocksText.text = "Good knocks\n" + leftGoodKnocks.ToString();
     }
     else
     {
         rightGoodKnocks++;
         rightGoodKnocksText.text = "Good knocks\n" + rightGoodKnocks.ToString();
     }
 }
Пример #5
0
 public void AnnounceWinner(PlayerController.PlayerNumber playerNumber)
 {
     if (playerNumber == PlayerController.PlayerNumber.LEFT)
     {
         Debug.Log("WINNER IS LEFT");
         winnerTextLeft.gameObject.SetActive(true);
     }
     else
     {
         Debug.Log("WINNER IS RIGHT");
         winnerTextRight.gameObject.SetActive(true);
     }
 }
Пример #6
0
    public void Knock(PlayerController.PlayerNumber playerNumber)
    {
        if (moduleClosed || !isOn)
        {
            return;
        }
        Vector3 residentPosition = resident.transform.position;

        GlobalController.instance.hud.GoodKnock(playerNumber);
        if (residentPosition.x >= endPointRight.x)
        {
            //RIGHT
            flat.PointFor(PlayerController.PlayerNumber.RIGHT);
            moduleClosed = true;
            turnOff();
            GlobalController.instance.InstantStartNewFlat();
            return;
        }
        else if (residentPosition.x <= endPointLeft.x)
        {
            //LEFT
            flat.PointFor(PlayerController.PlayerNumber.LEFT);
            moduleClosed = true;
            turnOff();
            GlobalController.instance.InstantStartNewFlat();
            return;
        }

        if (playerNumber == PlayerController.PlayerNumber.LEFT)
        {
            residentPosition.x -= stepSize;
        }
        else
        {
            residentPosition.x += stepSize;
        }
        resident.SetTargetPos(residentPosition);
    }
Пример #7
0
 public void Knock(PlayerController.PlayerNumber playerNumber)
 {
     knockCounter++;
     flatModule.Knock(playerNumber);
 }