public void Init(IInputInterface inputInterface) { _health = 250; _input = inputInterface; _initiallized = true; MovementEnabled = true; GrabEnabled = true; }
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); }
/// <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(); } }
/// <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; } } }
/// <summary> /// 注册一个输入接口,代替默认接口 /// </summary> /// <param name="i"></param> public void RegisterNewInput(IInputInterface i) { currentInputInterface = i; }
private InterfaceFactory() { currentInputInterface = new KeyboardInterface(); currentNetInterface = new DebugNetInterface(); }
public void Setup(IInputInterface inputInterface, IGameController gameController) { m_inputInterface = inputInterface; m_gameController = gameController; }
public Player() { _input = new BasicInput(); }
public void SetInputInterface(IInputInterface inInputInterface) { InputInterface = inInputInterface; }
public void SetNullInputInterface_ThrowsException() { IInputInterface inputInterface = null; Assert.Throws <ArgumentNullException>(() => _inputBinderComponent.SetInputInterface(inputInterface)); }
// IInputBinderInterface public void SetInputInterface(IInputInterface inInputInterface) { UnregisterForInputEvents(); _inputInterface = inInputInterface; RegisterForInputEvents(); }
protected void Awake() { _registeredInputHandlers = new List <InputHandler>(); _inputInterface = null; }