public void Init(ClientConnectionsComponent connHolder)
 {
     //Debug.Log("ClientGameComponent::Init Called");
     connectionsComponent = connHolder;
     clientGameSend       = GetComponent <ClientGameSend>();
     clientGameData       = GetComponent <ClientGameDataComponent>();
 }
Beispiel #2
0
    public void Init(ClientGameDataComponent _clientGameDataComponent, int objectId, bool isOwner)
    {
        clientGameDataComponent = _clientGameDataComponent;
        data = new FPSPlayerData();
        data.SetObjectId(objectId);
        data.SetFpsPlayer(this);

        // Debugging code to get objects out of each other's way
        transform.position = new Vector3(objectId * 2, 0, objectId * 2);
        data.SetPlayerPosn(transform.position);

        if (!isOwner)
        {
            // Since the player doesn't control this, remove input. Also remove camera
            Destroy(GetComponent <FPSPlayerInput>());
            Destroy(GetComponent <FPSLook>());
            Destroy(GetComponent <FPSMove>());
            Destroy(transform.Find("Camera").gameObject);
        }

        isOwnedByThisClient = isOwner;
    }
Beispiel #3
0
 public void Init(ClientGameDataComponent _client)
 {
     client = _client;
 }