void OnDestroy() { if (hasAuthority) { ClientInstance.ReturnClientInstance().SetupAvatarRespawn(); } }
void Start() { if (isClient && hasAuthority) { ClientInstance ci = ClientInstance.ReturnClientInstance(); moneyBar = FindObjectOfType <UIManager>().GetMoneyCounter(ci); } }
public override void OnStartClient() { if (hasAuthority) { playerAtThisComputer = ClientInstance.ReturnClientInstance(); uim = FindObjectOfType <UIManager>(); rs = uim.GetRadarScreen(playerAtThisComputer); } }
int myIFFAllegiance; // OK to capture this because it won't change for the player. //public override void OnStartClient() private void Start() { if (hasAuthority) { ClientInstance ci = ClientInstance.ReturnClientInstance(); UIManager uim = FindObjectOfType <UIManager>(); cityCaptureSlider = uim.GetCityCaptureSlider(ci); cityNameTMP = uim.GetCityNameTMP(ci); //TODO implement city names. uim.GetCompassComponents(ci, out compassBG, out compassNeedle); cm = FindObjectOfType <CityManager>(); initialScale = compassNeedle.transform.localScale.x; myIFFAllegiance = GetComponent <IFF>().GetIFFAllegiance(); } }
void Start() { if (hasAuthority) { uim = FindObjectOfType <UIManager>(); ClientInstance ci = ClientInstance.ReturnClientInstance(); tpd = uim.GetTPD(ci); tpd.SetTurretMaker(this); SetOptionSpritesOnTPD(); SetOptionCostsOnTPD(); } myIFF = GetComponent <FactionLeader>().GetMasterIFFAllegiance(); mh = GetComponent <MoneyHolder>(); }
void Start() { if (hasAuthority) { playerAtThisComputer = ClientInstance.ReturnClientInstance(); uim = FindObjectOfType <UIManager>(); healthBar = uim.GetHealthBar(playerAtThisComputer); } sr = transform.root.GetComponentInChildren <SpriteRenderer>(); currentHealth = startingHealth; UpdateHealthBar(); if (canMove) { rb = transform.root.GetComponentInChildren <Rigidbody2D>(); } SelectDieSound(); }
//public Vector3 facingTargetPoint; protected virtual void Start() { move = GetComponentInChildren <Movement>(); if (TryGetComponent <NavMeshAgent>(out nma)) { nma.updateRotation = false; } IsRunningOnClient = isClient; IsRunningOnServer = isServer; if (IsRunningOnClient) { ci = ClientInstance.ReturnClientInstance(); } }
private void HookIntoLocalUISystems() { if (hasAuthority) { playerAtThisComputer = ClientInstance.ReturnClientInstance(); uim = FindObjectOfType <UIManager>(); shiftKnob = uim.GetShiftKnob(playerAtThisComputer); uim.GetShiftPositions(playerAtThisComputer, out gearShiftPositions[0], out gearShiftPositions[1], out gearShiftPositions[2]); tpd = uim.GetTPD(playerAtThisComputer); iff = GetComponent <IFF>(); int myIFF = playerAtThisComputer.GetComponent <FactionLeader>().GetMasterIFFAllegiance(); iff.SetIFFAllegiance(myIFF); flagImage = uim.GetFlagUIElement(playerAtThisComputer); flagImage.sprite = am.GetFlagOfAllegiance(myIFF); tm = playerAtThisComputer.GetComponent <TurretMaker>(); ct = GetComponentInChildren <CaptureTool>(); } }
private void AnnounceSpawned() { ClientInstance ci = ClientInstance.ReturnClientInstance(); ci.InvokeAvatarSpawned(gameObject); }