public float GetAxis(string axisName) { if (player != PlayerNumber.PC) { return(Input.GetAxis(player.ToString() + axisName)); } else { return(Input.GetAxis(axisName)); } }
/// <summary> /// Called when the round is over /// </summary> private void PostRound(PlayerNumber playerNumber) { startScreen.SetActive(false); inGameUI.SetActive(false); roundOverText.SetActive(true); roundOverText.GetComponentInChildren <Text>().text = "Player " + playerNumber.ToString() + " Wins!"; }
protected void setChosenCharacter(s_ChooseGameAndPlayerType.character val) { if (ChosenCharacter != null) { ChosenCharacter.text = "Player " + Player.ToString().ToLower() + " is " + val.ToString().ToLower(); } }
public void SetPlayerText(PlayerNumber playerNumberCheck, int Amount) { if (playerNumberCheck == playerReferenceNumber) { playerText.text = "Player " + playerReferenceNumber.ToString() + ": " + Amount; } }
private void SetupVariables() { _handController = this.GetComponent <HandMovement>(); _controlsCycleRight = Constants.CONTROLS_CYCLE_RIGHT + PlayerNumber.ToString(); _controlsCycleLeft = Constants.CONTROLS_CYCLE_LEFT + PlayerNumber.ToString(); _controlsOven = Constants.CONTROLS_OVEN_X + PlayerNumber.ToString(); _animator = this.GetComponentInChildren <Animator>(); }
public string ToString(bool teamGame) { if (teamGame) { return(string.Format("T{0}:P{1}", TeamNumber, TeamPlayerNumber)); } return(PlayerNumber.ToString(CultureInfo.InvariantCulture)); }
public void ResetBeforeNextLevel() { foreach (Bullet bullet in Bullets) { SpaceShipManager.Remove(bullet); bullet.Dispose(); } Bullets.Clear(); Position = InitPosition; ScoreAsText.Text = string.Format("Player {0} Score : {1}", PlayerNumber.ToString(), Score.ToString()); }
public override void SetPeripheralString(PlayerNumber aPlayerNumber) { if (aPlayerNumber != PlayerNumber.God) { PeripheralString = "Joystick" + aPlayerNumber.ToString(); } else { PeripheralString = "Joystick"; } }
private string GenerateArgumentsOrFilter(string basestring) { return(basestring .Replace("{Executable}", Engine.PlayerExecutable) .Replace("{EnginePath}", Engine.GetPlayerExecutableDirectory()) .Replace("{ModPath}", Mod.Path) .Replace("{SavePath}", Mod.SavePath) .Replace("{Password}", Password) .Replace("{GameCode}", Code) .Replace("{TurnNumber}", TurnNumber.ToString()) .Replace("{PlayerNumber}", PlayerNumber.ToString()) .Replace("{PlayerNumber2}", PlayerNumber.ToString("00")) .Replace("{PlayerNumber3}", PlayerNumber.ToString("000")) .Replace("{PlayerNumber4}", PlayerNumber.ToString("0000"))); }
private void Start() { horizontal = "LeftStickHorizontal" + playerNumber.ToString().Substring(playerNumber.ToString().Length - 1); vertical = "LeftStickVertical" + playerNumber.ToString().Substring(playerNumber.ToString().Length - 1); rotation = "RightStickHorizontal" + playerNumber.ToString().Substring(playerNumber.ToString().Length - 1); attack = "RightTrigger" + playerNumber.ToString().Substring(playerNumber.ToString().Length - 1); interact = "AButton" + playerNumber.ToString().Substring(playerNumber.ToString().Length - 1); animator = GetComponent <Animator>(); meshRenderer = GetComponentInChildren <SkinnedMeshRenderer>(); areaLight = GetComponentInChildren <Light>(); capsule = GetComponent <CapsuleCollider>(); rigidBody = GetComponent <Rigidbody>(); audioSource = GetComponent <AudioSource>(); claws = GetComponentInChildren <MonsterClaws>(); totemStillSpawning = true; totemOff = false; ps = GetComponentInChildren <ParticleSystem>(); DisablePS(); dissolveSurface = GetComponent <DissolveSurface>(); if (dissolveSurface == null) { Debug.Log("dissolve Surface is null"); } GameObject deathIconObject = GameObject.Find("MonsterDeathIcon" + playerNumber.ToString().Substring(playerNumber.ToString().Length - 1)); if (deathIconObject != null) { deathIcon = deathIconObject.GetComponent <SetDeathMarker>(); deathIcon.SetMonsterUI(minimapIcon); } else { deathIcon = null; } lastHealth = health; allowTransitionToIdle = false; }
public void deploy(float carica) { if (energy >= minimumEnergy) { //calculate how long the button has been pressed if (carica < minimumTransmitterSize) { carica = minimumTransmitterSize; } if (carica >= energy) { Debug.Log("Capped to max"); carica = energy; } if (carica >= maximumTransmitterSize) { carica = maximumTransmitterSize; } carica *= multEnergy; energy -= (carica * multCost); //Generate Transmitter GameObject spanwedTransmitter = Instantiate(transmitter, this.transform.position, Quaternion.identity) as GameObject; spanwedTransmitter.GetComponent <Transmitter>().setCaricaArma(carica); spanwedTransmitter.GetComponent <Transmitter>().setTempo(carica); spanwedTransmitter.GetComponent <Transmitter>().setSphereColliderRadius(carica); spanwedTransmitter.GetComponent <Transmitter>().setPlayerNumber(playerNumber.ToString()); //Debug.Log("Deployed on " + joystickNumber); } else { // Debug.Log("Could not deploy on " + joystickNumber); } isCharging = false; }
public void FixedUpdate() { if (EnableAudio) { if (Input.GetButtonDown("Horn" + Number.ToString())) { GetComponent <Horn>().Play(); if (!raceManager.bRaceComplete) { GetComponent <Tracker>().Horn(); } } } if (!bIsActive) { return; } motor.motor = Input.GetAxis("Accel" + Number.ToString()) + Input.GetAxis("Brake" + Number.ToString()); motor.steering = Input.GetAxis("Horizontal" + Number.ToString()); if (transform.position.y > 2) { float WantRot = Input.GetAxis("Horizontal" + Number.ToString()); transform.Rotate(Vector3.up, WantRot * 50 * Time.deltaTime); if (Mathf.Abs(WantRot) > 0.25f) { body.angularVelocity = Vector3.zero; } } if (Input.GetButtonDown("Boost" + Number.ToString())) { Fart(); } if (Input.GetButtonDown("Flip" + Number.ToString()) && CanFlip) { Flip(); } }
public override string ToString() { string retString = PlayerName + " is number " + PlayerNumber.ToString() + " and plays " + PlayerSport + " at position " + PlayerPosition; return(retString); }
private void Start() { ready = false; trigger = "RightTrigger" + playerNumber.ToString().Substring(playerNumber.ToString().Length - 1); }
public override string ToString() { return(PlayerNumber.ToString()); }
bool getOwnButtonDown(string i) { return(Input.GetButtonDown(playerNum.ToString() + i)); }