Ejemplo n.º 1
0
 private void Awake()
 {
     _rigidbody = GetComponent <Rigidbody>();
     _move      = GetComponent <IMoveInput>();
     _rotate    = GetComponent <IRotationInput>();
     _transform = transform;
 }
Ejemplo n.º 2
0
        /// <summary>
        /// 操作キャラとしてセットアップ
        /// </summary>
        /// <param name="MoveInput">移動入力インタフェース</param>
        public void SetupAsLocalPlayer(IMoveInput MoveInput)
        {
            var Movement = new LocalPlayerMovement(MoveInput);

            AddCharacterComponent(Movement);
            AddCharacterComponent(new MoveReportSender());
        }
Ejemplo n.º 3
0
        public PlayerMover(IMovable movable, IMoveInput moveInput)
        {
            this.movable   = movable;
            this.moveInput = moveInput;

            disposable = this.moveInput.OnInputMoveObservable.Subscribe(SetMoving);
        }
    private void Awake()
    {
        if (playerRigidbody == null)
        {
            playerRigidbody = GetComponent <Rigidbody2D>();
        }

        moveInput = GetComponent <PlayerInput>();
    }
    private void Awake()
    {
        if (reverseTransform == null)
        {
            reverseTransform = GetComponent <Transform>();
        }

        moveInput = FindObjectOfType <PlayerInput>();
    }
Ejemplo n.º 6
0
    void Start()
    {
        if (rigid == null)
        {
            rigid = gameObject.GetComponent <Rigidbody>();
        }

        moveInput     = new KeyboardInput();
        rotationInput = new MouseInput();

        playerHeight = gameObject.GetComponentInChildren <Collider>().bounds.extents.y;
        //Debug.Log(playerHeight);
    }
Ejemplo n.º 7
0
    public void Init()
    {
        switch (_moveInputType)
        {
        case InputType.Keyboard:
            _moveInput = new KeyboradMoveInput();
            break;

        case InputType.Mouse:
            _moveInput = new MouseMoveInput(_transform);
            break;

        case InputType.StandartDrag:
            //WIP, not working
            _moveInput = _transform.gameObject.AddComponent <StandartDragMoveInput>();
            break;
        }

        _transformMover = new TransformMover(_moveInput, _transform, _sensivity);
    }
Ejemplo n.º 8
0
    public void Init()
    {
        if (PlayerPrefs.HasKey("ControlType"))
        {
            _moveInputType = (InputType)System.Enum.Parse(typeof(InputType), PlayerPrefs.GetString("ControlType"));
        }
        if (PlayerPrefs.HasKey("Sensitivity"))
        {
            _sensivity = PlayerPrefs.GetFloat("Sensitivity");
        }

        switch (_moveInputType)
        {
        case InputType.Keyboard:
            _moveInput = new KeyboradMoveInput();
            break;

        case InputType.Mouse:
            _moveInput = new MouseMoveInput(_transform);
            break;

        case InputType.DragMovement:
            DragMovement.Activate();
            _moveInput = (IMoveInput)DragMovement.Instance;
            break;

        case InputType.FloatingJoystick:
            FloatingJoystick.Activate();
            _moveInput = (IMoveInput)FloatingJoystick.Instance;
            break;

        case InputType.FixedJoystick:
            FixedJoystick.Activate();
            _moveInput = (IMoveInput)FixedJoystick.Instance;
            break;
        }

        PlayerPrefs.SetString("InputType", _moveInputType.ToString());
    }
Ejemplo n.º 9
0
 public FreeMovement(IMoveInput input, Settings settings, Rigidbody rb)
 {
     this.input    = input;
     this.settings = settings;
     this.rb       = rb;
 }
Ejemplo n.º 10
0
 private void Start()
 {
     _moveCommand = GetComponent <InputMoveCommand>();
     _move        = GetComponent <IMoveInput>();
     _animator    = GetComponent <Animator>();
 }
 public HumanSelectMoveAction(IMoveInput moveInput) => _moveInput = moveInput;
Ejemplo n.º 12
0
 protected override void Awake()
 {
     base.Awake();
     _movement = GetComponent <IMoveInput>();
 }
Ejemplo n.º 13
0
 /// <summary>
 /// コンストラクタ
 /// </summary>
 /// <param name="MoveInput">移動入力インタフェース</param>
 public LocalPlayerMovement(IMoveInput MoveInput)
 {
     MoveInput.OnInputMove
     .Subscribe((Value) => CurrentInput = Value);
 }
Ejemplo n.º 14
0
 private void Awake()
 {
     moveInput = new KeyboardInput();
 }
Ejemplo n.º 15
0
 public TransformMover(IMoveInput moveInput, Transform transform, float sensivity)
 {
     _moveInput = moveInput;
     _transform = transform;
     _sensivity = sensivity;
 }
Ejemplo n.º 16
0
 private void Awake()
 {
     _input     = GetComponent <IMoveInput>();
     _transform = GetComponent <Transform>();
     _animator  = GetComponent <Animator>();
 }
Ejemplo n.º 17
0
 // Use this for initialization
 void Start()
 {
     inputMove = new PlayerMoveInput();
 }