public static RegisterPlayer ( string _netID, Player _player ) : void | ||
_netID | string | |
_player | Player | |
Résultat | void |
// Use this for initialization void Start() { scoreText = GetComponentInChildren <Text> (); if (isLocalPlayer) { playerColor = new Color(Random.value, Random.value, Random.value); GetComponent <Renderer> ().material.color = playerColor; //gameObject.layer = LayerMask.NameToLayer ("LocalPlayer"); scoreText.text = "0"; } else { //gameObject.layer = LayerMask.NameToLayer ("RemotePlayer"); DisableComponents(); SetScore(); } transform.name = "Player " + id; damageScreen.SetActive(false); damageScreenMat = damageScreen.GetComponent <Renderer> ().material; originalDamageColor = damageScreenMat.color; id = GetComponent <NetworkIdentity> ().netId.ToString(); transform.name = "Player " + id; gameManager = GameObject.FindObjectOfType <GameManager> (); gameManager.RegisterPlayer(id); }
public override void OnStartClient() { string _netID = GetComponent <NetworkIdentity>().netId.ToString(); PlayerClass _player = GetComponent <PlayerClass>(); GameManager.RegisterPlayer(_netID, _player); }
// Start is called before the first frame update void Start() { player = GetComponent <Player>(); player.Setup(); //Debug.Log("Name of Player " + player.p_name); GameManager.RegisterPlayer(player); }
private void ManageJoinGame() { if (Input.GetAxis(steerAxis) != 0 || Input.GetAxis(accelerateAxis) != 0) { gameManager.RegisterPlayer(this.playerNumber); } }
public override void OnStartClient() { base.OnStartClient(); _ID = GetComponent <NetworkIdentity>().netId.ToString(); player = GetComponent <PlayerHealth>(); GameManager.RegisterPlayer(_ID, player); }
public override void OnStartClient() { base.OnStartClient(); PlayerManager playerManager = GetComponent <PlayerManager>(); GameManager.RegisterPlayer(netId.ToString(), playerManager); }
private void RegisterPlayer() { string id = GetComponent <NetworkIdentity>().netId.ToString(); var player = GetComponent <Player>(); GameManager.RegisterPlayer(id, player); }
public override void OnStartClient() { base.OnStartClient(); GameManager.RegisterPlayer(GetComponent <NetworkIdentity>().netId, GetComponent <Player>()); }
private void RegisterThisPlayer() { string _netID = GetComponent <NetworkIdentity>().netId.ToString(); Player _player = GetComponent <Player>(); GameManager.RegisterPlayer(_netID, _player); }
void RegisterPlayer() { string _netID = GetComponent <NetworkIdentity>().netId.ToString(); Player _player = GetComponent <Player>(); GameManager.RegisterPlayer(AppManager.instance.User.nickname, _player); }
public override void OnStartClient() { base.OnStartClient(); string _netID = GetComponent <NetworkIdentity>().netId.ToString(); GameManager.RegisterPlayer(_netID, GetComponent <PlayerState>()); }
public override void OnStartClient() //override values for parent class { base.OnStartClient(); //parent class,here it is same as child class string _netID = GetComponent <NetworkIdentity>().netId.ToString(); Player _player = GetComponent <Player>(); GameManager.RegisterPlayer(_netID, _player); }
public void RpcSetID(int _playerID) { if (!isServer) { gamePlayer.playerID = _playerID; GameManager.RegisterPlayer(gamePlayer); } }
public override void OnStartClient() { base.OnStartClient(); string netId = GetComponent <NetworkIdentity>().netId.ToString(); Player player = GetComponent <Player>(); GameManager.RegisterPlayer(netId, player); }
public override void OnStartClient() //Вызов при подключении к хосту { base.OnStartClient(); string _netID = GetComponent <NetworkIdentity>().netId.ToString(); //Берем ID из NetworkIdentity(при спавне игрока) Player _player = GetComponent <Player>(); //Берем скрипт Player(компонент) из префаба GameManager.RegisterPlayer(_netID, _player); }
public override void OnStartClient()//this function will run when each client connects { base.OnStartClient(); string netID = GetComponent <NetworkIdentity>().netId.ToString();//set the net id to the corrosponding network id PlayerManager player = GetComponent <PlayerManager>(); GameManager.RegisterPlayer(netID, player);//register the player into the player dictionary }
public override void OnStartClient() { base.OnStartClient(); _ID = gameObject.GetComponent <NetworkIdentity>().netId.ToString(); Player _player = GetComponent <Player>(); GameManager.RegisterPlayer(_ID, _player); }
public override void OnStartClient() //Built method on the networkbehaviour class called everytime the client is setup locally, { base.OnStartClient(); string _netID = GetComponent <NetworkIdentity>().netId.ToString(); Player _player = GetComponent <Player>(); GameManager.RegisterPlayer(_netID, _player);//calls registerplayer written in gamemanager.cs and gives inputs }
public override void OnStartClient() { base.OnStartClient(); string _netID = GetComponent <NetworkIdentity>().netId + ""; Player _player = GetComponent <Player>(); GameManager.RegisterPlayer(_netID, _player); }
public override void OnStartClient() { base.OnStartClient(); string _netID = GetComponent <NetworkIdentity>().netId.ToString(); Player _player = GetComponent <Player>(); GameManager.RegisterPlayer(_netID, _player); //GameManager.instance.SetSceneCameraActive(false); }
//method already in network behaviour class, called when a client is setup locally public override void OnStartClient() { base.OnStartClient(); //will have network id always since class derives from NetworkBehaviour, and we require player string _netID = GetComponent <NetworkIdentity>().netId.ToString(); Player _player = GetComponent <Player>(); GameManager.RegisterPlayer(_netID, _player); }
public override void OnStartClient() { base.OnStartClient(); _netId = GetComponent <NetworkIdentity>().netId.ToString(); var tankManager = GetComponent <TankManager>(); GameManager.RegisterPlayer(_netId, tankManager); tankManager.username = PayerTag + _netId; tankManager.instance.transform.name = PayerTag + _netId; }
public override void OnStartClient() // called every time a client is set up locally { base.OnStartClient(); string _netID = GetComponent <NetworkIdentity>().netId.ToString(); Player _player = GetComponent <Player>(); GameManager.RegisterPlayer(_netID, _player); }
public override void OnStartClient() { base.OnStartClient(); string _netID = GetComponent <NetworkIdentity>().netId.ToString(); Player _player = GetComponent <Player>(); GameManager.RegisterPlayer(_netID, _player); CmdchangeColorAllPlayers(); }
public override void OnStartClient() { base.OnStartClient(); string _netID = GetComponent <NetworkIdentity>().netId.ToString(); Debug.Log(_netID + " is the net ID"); Player _player = GetComponent <Player>(); GameManager.RegisterPlayer(_netID, _player); }
public override void OnStartClient() { base.OnStartClient(); NetworkIdentity netIdent = GetComponent <NetworkIdentity>(); string _netID = netIdent.netId.ToString(); NetworkServer.FindLocalObject(new NetworkInstanceId(1)); Player _player = GetComponent <Player>(); GameManager.RegisterPlayer(_netID, _player); }
public void SetupPlayer() { // color //seatNo seatNo = GameManager.GetEmptySeat(); string _id = GameManager.GetEmptyId().ToString(); GameManager.RegisterPlayer(_id, GetComponent <Player>()); GameManager.instance.fakePlayers++; }
public override void OnStartClient() { Debug.Log("OnStartClient"); base.OnStartClient(); string netID = GetComponent <NetworkIdentity>().netId.ToString(); PlayerSetupNetwork player = GetComponent <PlayerSetupNetwork>(); GameManager.RegisterPlayer(netID, player); }
protected override void OnInitialize() { Equip = Actor.AddComponent <Equip>(); PlayerInput = Actor.AddComponent <PlayerInput>(); Rigidbody = Actor.GetComponent <Rigidbody>(); AnimatedComponent = Actor.GetComponent <AnimatedTextureRegionComponent>(); Transform = Actor.GetComponent <Transform2>(); Rectangle rec = AnimatedComponent.animations[0].GetKeyframe(0).sourceRectangle; Size = new Vector2(20, 20); GameManager.RegisterPlayer(this); }
public override void OnStartServer() { base.OnStartServer(); if (!isServer) { return; } Debug.Log("OnStartServer"); string _netID = GetComponent <NetworkIdentity>().netId.ToString(); Player _player = GetComponent <Player>(); GameManager.RegisterPlayer(_netID, _player); _player.MiniSetup(); }