コード例 #1
0
 public void Init(IInputInterface inputInterface)
 {
     _health         = 250;
     _input          = inputInterface;
     _initiallized   = true;
     MovementEnabled = true;
     GrabEnabled     = true;
 }
コード例 #2
0
    void Awake()
    {
        m_Animator = m_Player.GetComponent<IAnimator> ();
        m_PlayerController = m_Player.GetComponent<PlayerController> ();

        m_InputSource = GetComponent<InputJoyStick> ();
        m_InputSource.SetController (m_Animator, m_PlayerController);
    }
コード例 #3
0
 /// <summary>
 /// プラットフォーム判断し、インターフェースの実装しているスクリプトでそれぞれの挙動を記述する
 /// </summary>
 private void Start()
 {
     if (Application.platform == RuntimePlatform.Android || Application.platform == RuntimePlatform.IPhonePlayer)
     {
         iInputInterface = new InputOnMobile();
     }
     else if (Application.platform == RuntimePlatform.WindowsPlayer || Application.platform == RuntimePlatform.WindowsEditor)
     {
         iInputInterface = new InputOnPC();
     }
     else
     {
         iInputInterface = new InputOnPC();
     }
 }
コード例 #4
0
        /// <summary>
        /// Create Racing game
        /// </summary>
        public RacingGameManager(INetInterface netCl, string uid, StartUpParameters sup)
            : base("Virutal Bicycle")
        {
            inputInterface = InterfaceFactory.Instance.GetInput();
            player         = new Player(new Vector3(0, 0, 0));

            // Start playing the menu music
            //Sound.Play(Sound.Sounds.MenuMusic);
            localUID     = uid;
            startUpParam = sup;

            netClient = netCl;
            for (int i = 0; i < sup.Players.Length; i++)
            {
                if (sup.Players[i].ID == uid)
                {
                    LocalPlayerCarColor = sup.Players[i].CarColor;
                    LocalPlayerName     = sup.Players[i].Name;
                    break;
                }
            }
        }
コード例 #5
0
 /// <summary>
 ///  注册一个输入接口,代替默认接口
 /// </summary>
 /// <param name="i"></param>
 public void RegisterNewInput(IInputInterface i)
 {
     currentInputInterface = i;
 }
コード例 #6
0
 private InterfaceFactory()
 {
     currentInputInterface = new KeyboardInterface();
     currentNetInterface   = new DebugNetInterface();
 }
コード例 #7
0
 public void Setup(IInputInterface inputInterface, IGameController gameController)
 {
     m_inputInterface = inputInterface;
     m_gameController = gameController;
 }
コード例 #8
0
ファイル: Player.cs プロジェクト: ColinJWatts/GoblinBall
 public Player()
 {
     _input = new BasicInput();
 }
コード例 #9
0
 public void SetInputInterface(IInputInterface inInputInterface)
 {
     InputInterface = inInputInterface;
 }
コード例 #10
0
        public void SetNullInputInterface_ThrowsException()
        {
            IInputInterface inputInterface = null;

            Assert.Throws <ArgumentNullException>(() => _inputBinderComponent.SetInputInterface(inputInterface));
        }
コード例 #11
0
 // IInputBinderInterface
 public void SetInputInterface(IInputInterface inInputInterface)
 {
     UnregisterForInputEvents();
     _inputInterface = inInputInterface;
     RegisterForInputEvents();
 }
コード例 #12
0
 protected void Awake()
 {
     _registeredInputHandlers = new List <InputHandler>();
     _inputInterface          = null;
 }