コード例 #1
0
    // Use this for initialization
    void Awake()
    {
        DontDestroyOnLoad(this);

        if (roundManagerInstance == null)
        {
            roundManagerInstance = this;
        }
        else
        {
            Destroy(this.gameObject);
        }
        pp = FindObjectOfType <PlayerPlacer>();
        fs = FindObjectOfType <FurnitureSelector>();

        pp.InFurniture    = false;
        currentRoundState = RoundState.HidingPlayer;
    }
コード例 #2
0
    // Update is called once per frame
    void Update()
    {
        //EndGame();
        ControlDisplays(); //Second Monitor for Testing

        if (pp == null)
        {
            pp = FindObjectOfType <PlayerPlacer>();
        }
        if (fs == null)
        {
            fs = FindObjectOfType <FurnitureSelector>();
        }

        if (pp.InFurniture && pp.gameObject.GetComponent <Camera>().isActiveAndEnabled)
        {
            NextRound();
        }
        else if (roundTimer <= 0)
        {
            NextRound();
        }


        if (fs != null)
        {
            ForceNextRound();
            MinusTimer();
        }

        if (player1Score > 1)
        {
            player1Score = 1;
        }

        if (player2Score > 1)
        {
            player2Score = 1;
        }
    }