Inheritance: MonoBehaviour
		/// <summary>Writes a <see cref="Vibration"/> structure to a stream.</summary>
		/// <param name="writer">The writer; must not be null.</param>
		/// <param name="vibration">A <see cref="Vibration"/> structure.</param>
		public static void Write( this BinaryWriter writer, Vibration vibration )
		{
			if( writer == null )
				throw new ArgumentNullException( "writer" );
			writer.Write( vibration.leftMotorSpeed );
			writer.Write( vibration.rightMotorSpeed );
		}
 public ExportAndImportViewModel(Factories factories, CloudProviderFactory cloudProviderFactory,
     Vibration vibration, Cloud cloud, MessageDialog messageDialog, CloudMessages cloudMessages,
     BackgroundWorkerFactory workerFactory)
 {
     this.factories = factories;
     exportAndImport = new ExportAndImportImpl(factories);
     this.cloudProviderFactory = cloudProviderFactory;
     this.vibration = vibration;
     this.cloud = cloud;
     this.messageDialog = messageDialog;
     this.cloudMessages = cloudMessages;
     this.workerFactory = workerFactory;
 }
 public void TestInitialize()
 {
     factories = Substitute.For<Factories>();
     cloudProviderFactory = Substitute.For<CloudProviderFactory>();
     cloudProvider = Substitute.For<CloudProvider>();
     cloudProviderFactory.Create().Returns(cloudProvider);
     settings = new Settings();
     factories.Settings.Returns(settings);
     vibration = Substitute.For<Vibration>();
     cloud = Substitute.For<Cloud>();
     messageDialog = Substitute.For<MessageDialog>();
     cloudMessages = new Fixture().Create<CloudMessages>();
     workerFactory = new BackgroundWorkerSyncFactory();
     sut = new ExportAndImportViewModel(factories, cloudProviderFactory, vibration, cloud, messageDialog,
         cloudMessages, workerFactory);
     cloudProvider.GetAcquiredToken().Returns(new CloudToken { Secret = "foo", Token = "bar" });
     cloudProvider.GetTokenAcquiringUrl(ExportAndImportViewModel.TOKEN_ACQUIRING_CALLBACK_URL).Returns("go");
     cloud.ListImports().Returns(new List<string>());
     navigatedTo = string.Empty;
     sut.NavigateInBrowser += (_, url) => { navigatedTo = url; };
 }
Esempio n. 4
0
 void Start()
 {
     vibration = objectToVibrate.GetComponent<Vibration>();
 }
Esempio n. 5
0
 public override void Reset()
 {
     vibration = null;
     milliseconds = new FsmInt { UseVariable = false, Value = 1000 };
 }
Esempio n. 6
0
        public ControllerX()
        {
            this.userIndex = new UserIndex();

            //trzeba dać wyjątki gdy nie podłączony żaden pad :D
            //            foreach (var deviceInstance in SlimDX.XInput.get.GetDevices(SlimDX.DirectInput.DeviceType.Gamepad, DeviceEnumerationFlags.AllDevices))
            //                this.joystickGuid = deviceInstance.InstanceGuid;

            this.joystick = new SlimDX.XInput.Controller(userIndex);
            this.vibration = new Vibration();
        }
 public void VibrateController( int a_iIndex , float a_iAmount , float fTime)
 {
     GamePad.SetVibration( (PlayerIndex)a_iIndex , a_iAmount , a_iAmount);
     Vibration v = new Vibration();
     v.index = a_iIndex;
     v.fTimeToStop = Time.timeSinceLevelLoad + fTime;
     lVibrations.Add(v);
 }
Esempio n. 8
0
        /// <summary>
        /// Initialization of the package; this method is called right after the package is sited, so this is the place
        /// where you can put all the initilaization code that rely on services provided by VisualStudio.
        /// </summary>
        protected override void Initialize()
        {
            base.Initialize();

            DTE2 dte = GetService(typeof(DTE)) as DTE2;
            if (dte != null)
            {
                Events = dte.Events.DebuggerEvents;
            }

            mResetVibration = new Vibration();
            mResetVibration.LeftMotorSpeed = 0;
            mResetVibration.RightMotorSpeed = 0;
        }
		public sealed override bool SetVibration( Vibration vibration )
		{
			if( base.Disabled || !( capabilities.HasLeftMotor || capabilities.HasRightMotor ) )
				return false;

			var errorCode = SafeNativeMethods.XInputSetState( base.Index, ref vibration );

			if( errorCode == (int)ErrorCode.NotConnected )
				base.IsDisconnected = true;

			return errorCode == 0;
		}