void Awake() { Debug.Assert(targetRef != null); input = GetComponent <IPlayerInput>(); Debug.Assert(input != null); }
public void Init(PlayerMovement ship) { var uiController = SpawnUI(); PlayerInput = CreatePlayerInput(); PlayerInput.Init(uiController); Clear(ship); }
private void Start() { if (!gameObject.CompareTag(Tags.GameManager)) { Debug.LogError("GameManager: has to be tagged as GameManager."); } _input = GameObject.FindWithTag(Tags.Input).GetComponent <IPlayerInput>(); }
public void AttachHero(IHero hero, IPlayerInput playerInput) { Hero = hero; var heroController = (HeroController)hero; heroController.AttachPlayerInput(playerInput); }
public TetrisBoard(IPieceGenerator generator, IPlayerInput playerInput) { PlayerInput = playerInput; PressTime = Enum.GetValues(typeof(InputButton)).OfType<InputButton>().ToDictionary(k => k, k => TimeSpan.Zero); State = TetrisGameState.NewGameState(generator); UpdateLevel(); }
public Board(IPlayerInput playerInput) { _playerInput = playerInput; Hits = 0; Misses = 0; Ships = new List <Ship>(); Coordinates = GenerateBoardCells(); }
private void Awake() { _characterController = GetComponent <CharacterController>(); PlayerInput = new PlayerInput(); _playerMoviment = new PlayerMoviment(this); _playerRotator = new PlayerRotator(this); PlayerInput.OnMoveModeTogglePressed += HandleMoveModeTogglePressed; }
public void Init(IPlayerInput input) { Input = input as SoldierPlayerInput; if (Input == null) { throw new ArgumentException("Player Input was not of type SoldierPlayerInput"); } }
public PlayerRotation(float desiredRotationSpeed, Transform playerTransform, Camera mainCam, IPlayerInput playerInput, Rigidbody playerRigidbody) { this.desiredRotationSpeed = desiredRotationSpeed; this.playerTransform = playerTransform; this.mainCam = mainCam; this.playerInput = playerInput; this.playerRigidbody = playerRigidbody; }
//private AudioManager _audioManager; //public FloatVal _health; //[SerializeField] private Item _prefabs; private void Awake() { _audioSource = GetComponent <AudioSource>(); _animator = GetComponent <Animator>(); _playerInput = GetComponent <IPlayerInput>(); _playerInput.OnFire += Fire; //_audioManager = new AudioManager(); }
internal PlayerController( IPlayerInput input, GameObject camera, IManagedPerson managedPerson) { _managedPerson = managedPerson; _input = input; _camera = camera.GetComponent <Camera>(); _pathMarkPool = new GameObjectsPool <PathMarksFabric>( new PathMarksFabric(), _marksPoolSize); }
void Awake() { _acitionView = FindObjectOfType <ActionView>() as IActionView; _inputManagerPlayer = new PlayerInputManager(); _human = new Player(_inputManagerPlayer); InitInputManagers(); InitGameManager(); }
public void Process(IPlayerInput inputCommand) { var o = inputCommand as PlayerNameInput; if (o != null) { state.Players[playerId].Name = o.Name; } }
void InitializePlayer(InteractiveStorage interactiveStorage, GameObjectFabric fabric, IPlayerInput playerInput) { var playerObject = fabric.GetPlayer(); PlayerView playerView = playerObject.GetComponent <PlayerView>(); playerView.SetInput(playerInput); interactiveStorage.Add(playerView); }
public Game(ILevelFactory levelFactory, IGameSettingLoader gameSettingLoader, IDisplay display, IMazeFactory mazeFactory, IPlayerInput playerInput) { _levelFactory = levelFactory; _gameSettingLoader = gameSettingLoader; _display = display; _mazeFactory = mazeFactory; _playerInput = playerInput; }
public void Awake() { var m = GetComponent <ICharacterSheet>().GetStat(StatType.MoveSpeed); this.moveSpeed = (m == null ? 0f : m.Value); characterController = GetComponent <CharacterController>(); animator = GetComponent <AnimationSystem>(); playerInput = GetComponent <IPlayerInput>(); }
private void Awake() { gameObject.name = "Player"; _audioSource = GetComponent <AudioSource>(); _animator = GetComponent <Animator>(); _playerInput = GetComponent <IPlayerInput>(); _playerInput.OnFire += Fire; _audioManager = new AudioManager(); }
public BaseCharacter(Texture2D sprite, MainGame.Tag tag, Vector2 spawnPosition, string name, MainGame game, IPlayerInput input) : base(sprite, tag, spawnPosition, name, game) { baseRectangle = new Rectangle(0, 0, 50, 50); velocity = Vector2.Zero; this.SpawnPosition = spawnPosition; this.input = input; Reset(); }
protected void Awake() { //Playerからの入力クラスを取得 PlayerInput = this.FindObjectOfInterface <IPlayerInput>(); PlayerInput.Accel.Subscribe(_ => { //transform.rotation *= Quaternion.Euler() }); }
// Start is called before the first frame update private void Start() { playerInput = GetComponent <IPlayerInput>(); Rb2D = GetComponent <Rigidbody2D>(); playerInput.MoveDirectionReactiveProperty .Skip(1) .Subscribe(x => Move(x)) .AddTo(gameObject); }
public void AttachPlayerInput(IPlayerInput playerInput) { UnsubscribeInputListeners(); _playerInput = playerInput; _playerInput.OnMoveEvent += OnMove; _playerInput.OnBombPlantEvent += OnBombPlant; }
void Awake() { _animator = GetComponent <Animator>(); _input = GameObject.FindWithTag(Tags.Input).GetComponent <IPlayerInput>(); _gameManeger = GameObject.FindWithTag(Tags.GameManager).GetComponent <GameManager>(); _gameManeger.GameFinishedEvent += () => _animator.SetBool(_isShootingParameterName, false); }
public PlayerMovement(Transform playerTransform, Camera mainCam, IPlayerInput playerInput, float speed, Rigidbody playerRigidbody, float jumpPower, Transform groundChecker) { this.playerTransform = playerTransform; this.mainCam = mainCam; this.playerInput = playerInput; this.speed = speed; this.playerRigidbody = playerRigidbody; this.jumpPower = jumpPower; this.groundChecker = groundChecker; }
public PlayerSprite(IPlayerInput activeInput, Color spriteColor, int playerNumber, int animationFrameCount, int animationFramesPerSecond, string animationStartName, float scale) : base(animationFrameCount, animationFramesPerSecond, animationStartName, scale) { SpriteColor = spriteColor; ActiveInput = activeInput; PlayerNumber = playerNumber; Position = Settings.Instance.ScreenCenter; base.Rotation = 0.0f; }
public PlayerMovement(Transform playerTransform, Camera mainCam, IPlayerInput playerInput, float speed, CharacterController playerController, float jumpPower, Transform groundChecker) { this.playerTransform = playerTransform; this.mainCam = mainCam; this.playerInput = playerInput; this.speed = speed; this.playerController = playerController; this.jumpPower = jumpPower; this.groundChecker = groundChecker; }
private void Awake() { _input = new MobileInput(); _mover = new MoverWithVelocity(this, moveSpeed); _animation = new CharacterAnimation(GetComponent <Animator>()); _flip = new FlipWithTransform(this); _onGround = GetComponent <IOnGround>(); _jump = new JumpMulti(GetComponent <Rigidbody2D>(), _onGround); _health = GetComponent <IHealth>(); }
public PlayerMovementState(IPlayerEntity playerController, IStateMachine stateMachine) : base(stateMachine) { _playerController = playerController; _rigidBody = playerController.RigidBody; _animator = playerController.Animator; _groundCollider = playerController.GroundCollider; _coyoteTimeBuffer = playerController.CoyoteTimeBuffer; _input = playerController.Input; _playerSettings = playerController.PlayerControllerSettings; }
public PlayerController(ICameraRay cameraRay, IPlayerInput playerInput) { _playerMoveSystem = new PlayerMoveSystem(); _playerLookSystem = new PlayerLookSystem(); _weaponSystem = new PlayerWeaponSystem(); _activitySystem = new PlayerActivitySystem(_weaponSystem); _cameraRay = cameraRay; _playerInput = playerInput; }
protected override void Awake() { base.Awake(); PlayerInput = new PlayerInput(); Health = new Health(3); Bank = new Bank(); TargetPos = transform.position; }
//Skills //Itens public Player(string name, IPlayerInput input) { Name = name; Stats = new PlayerStats (); Stats.InitialStats (Name); Portrait = Resources.Load<Sprite> ("Playable Characters/" + name); Input = input; }
//Skills //Itens public Player(string name, IPlayerInput input) { Name = name; Stats = new PlayerStats(); Stats.InitialStats(Name); Portrait = Resources.Load <Sprite> ("Playable Characters/" + name); Input = input; }
//bool _isAttack = false; private void Awake() { _input = new PcInput(); //!!!SpawnerMove değiştirmeyi unutma!!! _mover = new Mover(this, movespeed); _animation = new CharacterAnimation(GetComponent <Animator>()); _flip = new FlipWithTranform(this); _jump = new Jump(GetComponent <Rigidbody2D>()); _onGround = GetComponent <IOnground>(); _health = GetComponent <IHealth>(); _audioSource = GetComponent <AudioSource>(); }
protected override void PreSpawnPlayer(Entity playerEntity) { var controller = playerEntity.Get <SoldierController>(); if (controller != null) { Player = currentSoldier = controller; IPlayerInput input = playerEntity.Get <SoldierPlayerInput>(); Player.Init(input); } }
internal Game1(IPlayerInput playerInput, IWorldLoader worldLoader) { if (playerInput == null) throw new ArgumentNullException("playerInput"); if (worldLoader == null) throw new ArgumentNullException("worldLoader"); this.PlayerInput = playerInput; this.PlayerInput.GameInput = new GameInput(this); this._worldLoader = worldLoader; this._gdm = new GraphicsDeviceManager(this) { PreferredBackBufferWidth = RoomSizeWidth * ZoomWhilstWindowed, PreferredBackBufferHeight = RoomSizeHeight * ZoomWhilstWindowed }; this.Content.RootDirectory = "Content"; //this.TargetElapsedTime = new TimeSpan(this.TargetElapsedTime.Ticks * 4); this._lives = 2; this._score = 0; this._displayedScore = 0; this.SoundPlayer = new NullSoundPlayer(); }
public int SimulateUpDownOnGUI(int arrayIndex, IPlayerInput input, string direction, int numberButtons, int linhas, int i) { if (direction == "Vertical") { if (input.Axis.y < 0 && Unlockers[arrayIndex]) { int lastIndex = i; i++; if (i == numberButtons) { i = lastIndex; } Unlockers[arrayIndex] = false; } if (input.Axis.y > 0 && Unlockers[arrayIndex]) { int lastIndex = i; i--; if (i < 0) { i = lastIndex; } Unlockers[arrayIndex] = false; } if (input.Axis.y == 0 && !Unlockers[arrayIndex]) { Unlockers[arrayIndex] = true; } } if (direction == "Horizontal") { if (input.Axis.x < 0 && Unlockers[arrayIndex]) { int lastIndex = i; i--; if (i < 0) { i = lastIndex; } Debug.Log (i); Unlockers[arrayIndex] = false; } if (input.Axis.x > 0 && Unlockers[arrayIndex]) { int lastIndex = i; i++; if (i == numberButtons) { i = lastIndex; } Debug.Log (i); Unlockers[arrayIndex] = false; } if (input.Axis.x == 0 && !Unlockers[arrayIndex]) { Unlockers[arrayIndex] = true; } } if (direction == "Both") { int buttonsPorLinha = numberButtons / linhas; if (input.Axis.x < 0 && Unlockers[arrayIndex]) { int lastIndex = i; i--; if (i < 0) { i = lastIndex; } Unlockers[arrayIndex] = false; } if (input.Axis.x < 0 && Unlockers[arrayIndex]) { i++; if (i == numberButtons) { i = numberButtons - 1; } Unlockers[arrayIndex] = false; } if (input.Axis.y > 0 && Unlockers[arrayIndex]) { int lastIndex = i; i -= buttonsPorLinha; if (i < 0) { i = lastIndex; } Unlockers[arrayIndex] = false; } if (input.Axis.y < 0 && Unlockers[arrayIndex]) { int lastIndex = i; i += buttonsPorLinha; if (i >= numberButtons) { i = lastIndex; } Unlockers[arrayIndex] = false; } if ((input.Axis.x == 0 && input.Axis.y == 0) && !Unlockers[arrayIndex]) { Unlockers[arrayIndex] = true; } } return i; }
public Runner(Vector2 position, string name, MainGame game, IPlayerInput input) : base(runnerSprite, MainGame.Tag.Runner, position, name, game, input) { this.PlayerInput = null; speed_Walk = 550; }
public Bomber(Vector2 position, string name, MainGame game, IPlayerInput input) : base(bomberSprite, MainGame.Tag.Bomber, position, name, game, input) { baseColor = bomberColor; respawnTime = 0.85f; }
// PLAYERINPUT: public static void Write(this NetBuffer netbuffer, IPlayerInput input) { netbuffer.Write(input.Position); if (input.PendingStatus != null) { netbuffer.Write(true); netbuffer.Write((ushort)input.PendingStatus); } else { netbuffer.Write(false); } if (input.PendingShot != null) { netbuffer.Write(true); netbuffer.Write((Vector2)input.PendingShot); } else { netbuffer.Write(false); } }
public void ButtonControl(PointerEventData pointer, IPlayerInput input, Button[] buttons, int i) { ExecuteEvents.Execute(buttons[i].gameObject, pointer, ExecuteEvents.pointerEnterHandler); foreach (Button b in buttons) { if (b != buttons [i]) { ExecuteEvents.Execute(b.gameObject, pointer, ExecuteEvents.pointerExitHandler); } } if (input.Submit) { ExecuteEvents.Execute(buttons[i].gameObject, pointer, ExecuteEvents.submitHandler); } }