Exemple #1
0
    public void SetInputType(LocalInputType.InputType inputtype)
    {
        switch (inputtype)
        {
        case LocalInputType.InputType.NONE:
            inputController = null;
            break;

        case LocalInputType.InputType.HUMAN:
            inputController = new LocalInputHuman();
            break;

        case LocalInputType.InputType.AI:
            inputController = new LocalInputAI();
            break;

        case LocalInputType.InputType.SCRIPTED:
            inputController = new LocalInputScripted();
            break;
        }

        if (inputController != null)
        {
            inputController.SetOwner(this);
        }

        subAllInputTypeChanged.NotifyObs(this, inputtype);
    }
    public static void SetInputType(int idPlayer, LocalInputType.InputType inputtype)
    {
        if (PhotonNetwork.IsMasterClient == false)
        {
            return;                                        //Only allow the master to do modifications for controller params
        }
        ExitGames.Client.Photon.Hashtable hashNewProperties = new ExitGames.Client.Photon.Hashtable()
        {
            { GetInputTypeKey(idPlayer), inputtype }
        };

        PhotonNetwork.CurrentRoom.SetCustomProperties(hashNewProperties);
    }