public PlayerData(PlayerInputConfiguration input, int characterIndex, int playerIndex, PlayerSounds sounds) { this.input = input; this.characterIndex = characterIndex; this.playerIndex = playerIndex; this.sounds = sounds; }
PlayerInputConfiguration CreatePlayer(PlayerActions actions, CharacterSelectActions characterSelectActions) { if (players.Count < container.MAX_PLAYERS) { int index = container.GetAvailablePlayerIndex(); PlayerInputConfiguration player = new PlayerInputConfiguration(index, actions, players.Count + 1); players.Add(player); playerJoin.Join(index, characterSelectActions); return(player); } return(null); }
public CharacterSelection Initialize(int playerIndex, PlayerInputConfiguration input, Action lockInCallback) { this.playerIndex = playerIndex; text.sprite = playerTexts[playerIndex]; selectedPlayer = UnityEngine.Random.Range(0, 4); Select(); active = true; this.input = input; audioSource = GameObject.FindGameObjectWithTag("CSManager").GetComponent <AudioSource>(); audioSource.PlayOneShot(joinClip, 1f); this.lockInCallback = lockInCallback; return(this); }
private void Awake() { controller = GetComponent <CharacterController>(); player = GetComponent <Player>(); jump = GetComponent <JumpPlayer>(); attack = GetComponent <MainAttackPlayer>(); touchControl = FindObjectOfType <TouchControl>(); playerInputConfiguration = GetComponent <PlayerInputConfiguration>(); maxMoveSpeed = moveSpeed; InitializeInput(); camTransform = Camera.main.transform; }
void Awake() { controller = GetComponent <CharacterController>(); player = GetComponent <Player>(); attack = GetComponent <MainAttackPlayer>(); touchControl = GameObject.FindObjectOfType <TouchControl>(); playerInputConfiguration = GetComponent <PlayerInputConfiguration>(); InitializeInput(); slopeLimit = controller.slopeLimit; jumpSlopeLimit = Mathf.Clamp(controller.slopeLimit * 2, 0f, 90f); maxJumpCount = jumpCount; }
void Awake() { player = GetComponent <Player>(); playerInputConfiguration = GetComponent <PlayerInputConfiguration>(); touchControl = GameObject.FindObjectOfType <TouchControl>(); InitializeInput(); int i = 0; foreach (AttackCombo attack in attackCombo) { attack.attackId = i; attack.attack.AttackComboOrder = i; attack.attackRange = attackRange; attack.attackReactionPower = attackReactionPower; i++; } }
PlayerInput CreatePlayer(PlayerInputConfiguration configuration) { if (players.Count < maxPlayers) { var playerPosition = playerPositions[configuration.PlayerColorIndex]; var gameObject = (GameObject)Instantiate(playerPrefabs[configuration.PlayerColorIndex], playerPosition, Quaternion.identity); var swap = gameObject.GetComponent <SwapTexture> (); swap.swapColors = CharacterColors.GetPalette(configuration.PlayerColorIndex); var player = gameObject.GetComponent <PlayerInput>(); player.Actions = configuration.Actions; players.Add(player); gameObject.name = "Player" + configuration.PlayerSuffix; player.PlayerSuffix = configuration.PlayerSuffix; return(player); } return(null); }
void RemovePlayer(PlayerInputConfiguration player) { players.Remove(player); player.Actions = null; }
public PlayerInfo(Character character, PlayerInputConfiguration input) { this.character = character; this.input = input; }