コード例 #1
0
    public override void OnGiveAuthority()
    {
        base.OnGiveAuthority();

        controller = NetIdentity.connectionToOwnerClient.GetPlayerController <ExamplePlayerController>(ownerPlayerControllerId);
        controller.GetPawn(this);
    }
コード例 #2
0
    public void PawnRequest(ExamplePlayerController controller)
    {
        ExamplePawn newPawn = Instantiate(GameManager.instance.pawnPrefab, SpawnPointManager.GetSpawnPoint(), Quaternion.identity);

        newPawn.ownerPlayerControllerId = controller.playerControllerId;
        newPawn.PlayerName = (controller).userName;

        serverManager.SpawnWithClientAuthority(newPawn.gameObject, controller.Conn);
    }
コード例 #3
0
    public override void OnStartAuthority()
    {
        base.OnStartAuthority();

        controller = TinyNetClient.instance.connToHost.GetPlayerController <ExamplePlayerController>(ownerPlayerControllerId);
        controller.GetPawn(this);

        cameraTransform = GameObject.FindGameObjectWithTag("MainCamera").transform;
    }
コード例 #4
0
	void Start ()
	{
		// store our var
		myController = GetComponent<ExamplePlayerController>();

		health = maxHealth;

		deadScreen.SetActive( false );
	}
コード例 #5
0
    public override void OnNetworkDestroy()
    {
        base.OnNetworkDestroy();

        if (hasAuthority)
        {
            controller.LosePawn();
            controller = null;
        }
    }