Exemplo n.º 1
0
 public float GetAxis(string axisName)
 {
     if (player != PlayerNumber.PC)
     {
         return(Input.GetAxis(player.ToString() + axisName));
     }
     else
     {
         return(Input.GetAxis(axisName));
     }
 }
Exemplo n.º 2
0
 /// <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();
     }
 }
Exemplo n.º 4
0
 public void SetPlayerText(PlayerNumber playerNumberCheck, int Amount)
 {
     if (playerNumberCheck == playerReferenceNumber)
     {
         playerText.text = "Player " + playerReferenceNumber.ToString() + ": " + Amount;
     }
 }
Exemplo n.º 5
0
 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>();
 }
Exemplo n.º 6
0
 public string ToString(bool teamGame)
 {
     if (teamGame)
     {
         return(string.Format("T{0}:P{1}", TeamNumber, TeamPlayerNumber));
     }
     return(PlayerNumber.ToString(CultureInfo.InvariantCulture));
 }
Exemplo n.º 7
0
 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());
 }
Exemplo n.º 8
0
 public override void SetPeripheralString(PlayerNumber aPlayerNumber)
 {
     if (aPlayerNumber != PlayerNumber.God)
     {
         PeripheralString = "Joystick" + aPlayerNumber.ToString();
     }
     else
     {
         PeripheralString = "Joystick";
     }
 }
Exemplo n.º 9
0
	public override void SetPeripheralString(PlayerNumber aPlayerNumber)
	{
		if (aPlayerNumber != PlayerNumber.God)
		{
			PeripheralString = "Joystick" + aPlayerNumber.ToString();
		}
		else
		{
			PeripheralString = "Joystick";
		}
	}
Exemplo n.º 10
0
 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;
    }
Exemplo n.º 12
0
    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();
        }
    }
Exemplo n.º 14
0
        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);
 }
Exemplo n.º 16
0
 public override string ToString()
 {
     return(PlayerNumber.ToString());
 }
Exemplo n.º 17
0
 bool getOwnButtonDown(string i)
 {
     return(Input.GetButtonDown(playerNum.ToString() + i));
 }