1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
|
C++RAW
#include "UnityPrefix.h"
#include "Configuration/UnityConfigure.h"
#include "Runtime/Mono/MonoBehaviour.h"
#include "Runtime/Input/InputManager.h"
#include "Runtime/Input/GetInput.h"
#include "Runtime/Input/LocationService.h"
#include "Runtime/Misc/BuildSettings.h"
#include "Runtime/Scripting/ScriptingUtility.h"
#include "Runtime/Scripting/Scripting.h"
#if SUPPORT_REPRODUCE_LOG
#include "Runtime/Misc/ReproductionLog.h"
#endif
using namespace Unity;
using namespace std;
CSRAW
using System;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
using System.Collections;
using UnityEngineInternal;
namespace UnityEngine
{
// Describes phase of a finger touch.
ENUM TouchPhase
// A finger touched the screen.
Began = 0,
// A finger moved on the screen.
Moved = 1,
// A finger is touching the screen but hasn't moved.
Stationary = 2,
// A finger was lifted from the screen. This is the final phase of a touch.
Ended = 3,
// The system cancelled tracking for the touch, as when (for example) the user puts the device to her face or more than five touches happened simultaneously. This is the final phase of a touch.
Canceled = 4
END
// Controls IME input
ENUM IMECompositionMode
// Enable IME input only when a text field is selected (default).
Auto = 0,
// Enable IME input.
On = 1,
// Disable IME input.
Off = 2
END
// Structure describing status of a finger touching the screen.
STRUCT Touch
CSRAW
private int m_FingerId;
private Vector2 m_Position;
private Vector2 m_RawPosition;
#if ENABLE_NEW_EVENT_SYSTEM
private Vector2 m_OldPosition;
private Vector2 m_PositionDelta;
private Vector2 m_ScrollDelta;
private Vector3 m_WorldPosition;
private float m_TimeDelta;
private int m_TapCount;
private TouchPhase m_Phase;
private IntPtr m_Hover;
private IntPtr m_Press;
#else
private Vector2 m_PositionDelta;
private float m_TimeDelta;
private int m_TapCount;
private TouchPhase m_Phase;
#endif
// The unique index for touch.
CSRAW public int fingerId { get { return m_FingerId; } }
// The position of the touch.
CSRAW public Vector2 position { get { return m_Position; } }
// Raw Position of the touch (taken from os without tweaking)
CSRAW public Vector2 rawPosition { get { return m_RawPosition; } }
// The position delta since last change.
CSRAW public Vector2 deltaPosition { get { return m_PositionDelta; } }
// The scroll delta position. X = horizontal, Y = vertical.
CONDITIONAL ENABLE_NEW_EVENT_SYSTEM
CSRAW public Vector2 deltaScroll { get { return m_ScrollDelta; } }
// The world position of the touch (raycast into the screen hitting a collider).
CONDITIONAL ENABLE_NEW_EVENT_SYSTEM
public Vector3 worldPosition { get { return m_WorldPosition; } }
// Amount of time passed since last change.
CSRAW public float deltaTime { get { return m_TimeDelta; } }
// Number of taps.
CSRAW public int tapCount { get { return m_TapCount; } }
// Describes the phase of the touch.
CSRAW public TouchPhase phase { get { return m_Phase; } }
CUSTOM static private GameObject Internal_GetPtr (IntPtr ptr) { return Scripting::ScriptingWrapperFor((GameObject*)ptr); }
// The object the mouse is hovering over (only works for mouse events)
CONDITIONAL ENABLE_NEW_EVENT_SYSTEM
CSRAW public GameObject hoveredObject { get { return Internal_GetPtr(m_Hover); } }
// The object this mouse or touch has pressed on
CONDITIONAL ENABLE_NEW_EVENT_SYSTEM
CSRAW public GameObject pressedObject { get { return Internal_GetPtr(m_Press); } }
END
// Describes physical orientation of the device as determined by the OS.
ENUM DeviceOrientation
// The orientation of the device cannot be determined.
Unknown = 0,
// The device is in portrait mode, with the device held upright and the home button at the bottom.
Portrait = 1,
// The device is in portrait mode but upside down, with the device held upright and the home button at the top.
PortraitUpsideDown = 2,
// The device is in landscape mode, with the device held upright and the home button on the right side.
LandscapeLeft = 3,
// The device is in landscape mode, with the device held upright and the home button on the left side.
LandscapeRight = 4,
// The device is held parallel to the ground with the screen facing upwards.
FaceUp = 5,
// The device is held parallel to the ground with the screen facing downwards.
FaceDown = 6
END
// Structure describing acceleration status of the device.
STRUCT AccelerationEvent
CSRAW private Vector3 m_Acceleration;
CSRAW private float m_TimeDelta;
// Value of acceleration.
CSRAW public Vector3 acceleration { get { return m_Acceleration; } }
// Amount of time passed since last accelerometer measurement.
CSRAW public float deltaTime { get { return m_TimeDelta; } }
END
// Interface into the Gyroscope.
CLASS Gyroscope
CSRAW internal Gyroscope(int index) {
m_GyroIndex = index;
}
CSRAW private int m_GyroIndex;
CUSTOM private static Vector3 rotationRate_Internal(int idx) { return GetGyroRotationRate(idx); }
CUSTOM private static Vector3 rotationRateUnbiased_Internal(int idx) { return GetGyroRotationRateUnbiased(idx); }
CUSTOM private static Vector3 gravity_Internal(int idx) { return GetGravity(idx); }
CUSTOM private static Vector3 userAcceleration_Internal(int idx) { return GetUserAcceleration(idx); }
CUSTOM private static Quaternion attitude_Internal(int idx) { return GetAttitude(idx); }
CUSTOM private static bool getEnabled_Internal(int idx) { return IsGyroEnabled(idx); }
CUSTOM private static void setEnabled_Internal(int idx, bool enabled) { SetGyroEnabled(idx, enabled); }
CUSTOM private static float getUpdateInterval_Internal(int idx) { return GetGyroUpdateInterval(idx); }
CUSTOM private static void setUpdateInterval_Internal(int idx, float interval) { SetGyroUpdateInterval(idx, interval); }
// Returns rotation rate as measured by the device's gyroscope.
CSRAW public Vector3 rotationRate { get { return rotationRate_Internal(m_GyroIndex); } }
// Returns unbiased rotation rate as measured by the device's gyroscope.
CSRAW public Vector3 rotationRateUnbiased { get { return rotationRateUnbiased_Internal(m_GyroIndex); } }
// Returns the gravity acceleration vector expressed in the device's reference frame.
CSRAW public Vector3 gravity { get { return gravity_Internal(m_GyroIndex); } }
// Returns the acceleration that the user is giving to the device.
CSRAW public Vector3 userAcceleration { get { return userAcceleration_Internal(m_GyroIndex); } }
// Returns the attitude of the device.
CSRAW public Quaternion attitude { get { return attitude_Internal(m_GyroIndex); } }
// Sets or retrieves status of this gyroscope.
CSRAW public bool enabled { get { return getEnabled_Internal(m_GyroIndex); } set { setEnabled_Internal(m_GyroIndex, value); } }
// Sets or retrieves gyroscope interval in seconds.
CSRAW public float updateInterval { get { return getUpdateInterval_Internal(m_GyroIndex); } set { setUpdateInterval_Internal(m_GyroIndex, value); } }
END
// Structure describing device location.
STRUCT LocationInfo
CSRAW private double m_Timestamp;
CSRAW private float m_Latitude;
CSRAW private float m_Longitude;
CSRAW private float m_Altitude;
CSRAW private float m_HorizontalAccuracy;
CSRAW private float m_VerticalAccuracy;
// Geographical device location latitude
CSRAW public float latitude { get { return m_Latitude; } }
// Geographical device location latitude
CSRAW public float longitude { get { return m_Longitude; } }
// Geographical device location altitude
CSRAW public float altitude { get { return m_Altitude; } }
// Horizontal accuracy of the location
CSRAW public float horizontalAccuracy { get { return m_HorizontalAccuracy; } }
// Vertical accuracy of the location
CSRAW public float verticalAccuracy { get { return m_VerticalAccuracy; } }
// Timestamp (in seconds since 1970) when location was last time updated
CSRAW public double timestamp { get { return m_Timestamp; } }
END
// Describes location service status.
ENUM LocationServiceStatus
// Location service is stopped.
Stopped = 0,
// Location service is initializing, some time later it will switch to
Initializing = 1,
// Location service is running and locations could be queried.
Running = 2,
// Location service failed (user denied access to location service).
Failed = 3
END
// Interface into location functionality.
CLASS LocationService
// Specifies whether location service is enabled in user settings.
CUSTOM_PROP bool isEnabledByUser
{
return LocationService::IsServiceEnabledByUser ();
}
// Returns location service status.
CUSTOM_PROP LocationServiceStatus status
{
return LocationService::GetLocationStatus ();
}
// Last measured device geographical location.
CUSTOM_PROP LocationInfo lastData
{
if (LocationService::GetLocationStatus () != kLocationServiceRunning)
printf_console ("Location service updates are not enabled. Check Handheld.locationServiceStatus before querying last location.\n");
return LocationService::GetLastLocation ();
}
// Starts location service updates. Last location coordinates could be
CUSTOM void Start (float desiredAccuracyInMeters = 10f, float updateDistanceInMeters = 10f)
{
LocationService::SetDesiredAccuracy (desiredAccuracyInMeters);
LocationService::SetDistanceFilter (updateDistanceInMeters);
LocationService::StartUpdatingLocation ();
}
// Stops location service updates. This could be useful for saving battery
CUSTOM void Stop ()
{
LocationService::StopUpdatingLocation ();
}
END
// Interface into compass functionality.
CLASS Compass
// The heading in degrees relative to the magnetic North Pole.
CUSTOM_PROP public float magneticHeading
{
return LocationService::GetLastHeading().magneticHeading;
}
// The heading in degrees relative to the geographic North Pole.
CUSTOM_PROP public float trueHeading
{
return LocationService::GetLastHeading().trueHeading;
}
// The raw geomagnetic data measured in microteslas. (RO)
CUSTOM_PROP public Vector3 rawVector
{
return LocationService::GetLastHeading().raw;
}
// Timestamp (in seconds since 1970) when the heading was last time updated. (RO)
CUSTOM_PROP public double timestamp
{
return LocationService::GetLastHeading().timestamp;
}
// Used to enable or disable compass. Note, that if you want @@Input.compass.trueHeading@@ property to contain a valid value, you must also enable location updates by calling @@Input.location.Start()@@.
CUSTOM_PROP public bool enabled
{
return LocationService::IsHeadingUpdatesEnabled();
}
{
LocationService::SetHeadingUpdatesEnabled(value);
}
END
// Interface into the Input system.
CLASS Input
CUSTOM private static int mainGyroIndex_Internal() { return GetGyro(); }
CONDITIONAL ENABLE_MONO || UNITY_WINRT
CSRAW private static Gyroscope m_MainGyro = null;
CUSTOM private static bool GetKeyInt (int key)
{
if (key > 0 && key < kKeyAndJoyButtonCount)
return GetInputManager ().GetKey (key);
else if (key == 0)
return false;
else
{
Scripting::RaiseMonoException ("Invalid KeyCode enum.");
return false;
}
}
CUSTOM private static bool GetKeyString (string name)
{
string cname = name;
int key = StringToKey (cname);
if (key != 0)
return GetInputManager ().GetKey (key);
else
{
Scripting::RaiseMonoException ("Input Key named: %s is unknown", cname.c_str());
return false;
}
}
CUSTOM private static bool GetKeyUpInt (int key)
{
if (key > 0 && key < kKeyAndJoyButtonCount)
return GetInputManager ().GetKeyUp (key);
else if (key == 0)
return false;
else
{
Scripting::RaiseMonoException ("Invalid KeyCode enum.");
return false;
}
}
CUSTOM private static bool GetKeyUpString (string name)
{
string cname = name;
int key = StringToKey (cname);
if (key != 0)
return GetInputManager ().GetKeyUp (key);
else
{
Scripting::RaiseMonoException ("Input Key named: %s is unknown", cname.c_str());
return false;
}
}
CUSTOM private static bool GetKeyDownInt (int key)
{
if (key > 0 && key < kKeyAndJoyButtonCount)
return GetInputManager ().GetKeyDown (key);
else if (key == 0)
return false;
else
{
Scripting::RaiseMonoException ("Invalid KeyCode enum.");
return false;
}
}
CUSTOM private static bool GetKeyDownString (string name)
{
string cname = name;
int key = StringToKey (cname);
if (key != 0)
return GetInputManager ().GetKeyDown (key);
else
{
Scripting::RaiseMonoException ("Input Key named: %s is unknown", cname.c_str());
return false;
}
}
C++RAW
static void CheckInputAxis (const string& name, bool button)
{
#if !GAMERELEASE
if (!GetInputManager ().HasAxisOrButton (name))
{
if (button)
Scripting::RaiseMonoException ("Input Button %s is not setup.\n To change the input settings use: Edit -> Project Settings -> Input", name.c_str());
else
Scripting::RaiseMonoException ("Input Axis %s is not setup.\n To change the input settings use: Edit -> Project Settings -> Input", name.c_str());
}
#endif
}
// Returns the value of the virtual axis identified by /axisName/.
CUSTOM static float GetAxis (string axisName)
{
string name = axisName;
CheckInputAxis (name, false);
return GetInputManager ().GetAxis (name);
}
// Returns the value of the virtual axis identified by /axisName/ with no smoothing filtering applied.
CUSTOM static float GetAxisRaw (string axisName)
{
string name = axisName;
CheckInputAxis (name, false);
return GetInputManager ().GetAxisRaw (name);
}
// Returns true while the virtual button identified by /buttonName/ is held down.
CUSTOM static bool GetButton (string buttonName)
{
string name = buttonName;
CheckInputAxis (name, true);
return GetInputManager ().GetButton (name);
}
// This property controls if input sensors should be compensated for screen orientation.
CUSTOM_PROP static bool compensateSensors { return IsCompensatingSensors(); } { SetCompensatingSensors(value); }
OBSOLETE warning isGyroAvailable property is deprecated. Please use SystemInfo.supportsGyroscope instead.
CUSTOM_PROP static bool isGyroAvailable { return IsGyroAvailable(); }
// Returns default gyroscope.
CONDITIONAL ENABLE_MONO || UNITY_WINRT
CSRAW public static Gyroscope gyro { get { if (m_MainGyro == null) m_MainGyro = new Gyroscope(mainGyroIndex_Internal()); return m_MainGyro; } }
// Returns true during the frame the user pressed down the virtual button identified by /buttonName/.
CUSTOM static bool GetButtonDown (string buttonName)
{
string name = buttonName;
CheckInputAxis (name, true);
return GetInputManager ().GetButtonDown (name);
}
// Returns true the first frame the user releases the virtual button identified by /buttonName/.
CUSTOM static bool GetButtonUp (string buttonName)
{
string name = buttonName;
CheckInputAxis (name, true);
return GetInputManager ().GetButtonUp (name);
}
// Returns true while the user holds down the key identified by /name/. Think auto fire.
CSRAW public static bool GetKey (string name)
{
return GetKeyString(name);
}
// Returns true while the user holds down the key identified by the /key/ [[KeyCode]] enum parameter.
CSRAW public static bool GetKey (KeyCode key)
{
return GetKeyInt((int)key);
}
// Returns true during the frame the user starts pressing down the key identified by /name/.
CSRAW public static bool GetKeyDown (string name)
{
return GetKeyDownString(name);
}
// Returns true during the frame the user starts pressing down the key identified by the /key/ [[KeyCode]] enum parameter.
CSRAW public static bool GetKeyDown (KeyCode key)
{
return GetKeyDownInt((int)key);
}
// Returns true during the frame the user releases the key identified by /name/.
CSRAW public static bool GetKeyUp (string name)
{
return GetKeyUpString(name);
}
// Returns true during the frame the user releases the key identified by the /key/ [[KeyCode]] enum parameter.
CSRAW public static bool GetKeyUp (KeyCode key)
{
return GetKeyUpInt((int)key);
}
// Returns an array of strings describing the connected joysticks.
CONDITIONAL ENABLE_MONO || UNITY_METRO
CUSTOM static string[] GetJoystickNames()
{
std::vector<std::string> names;
GetJoystickNames(names);
return Scripting::StringVectorToMono(names);
}
// Returns whether the given mouse button is held down.
CUSTOM static bool GetMouseButton (int button)
{
return GetInputManager ().GetMouseButton (button);
}
// Returns true during the frame the user pressed the given mouse button.
CUSTOM static bool GetMouseButtonDown (int button)
{
return GetInputManager ().GetMouseButtonDown (button);
}
// Returns true during the frame the user releases the given mouse button.
CUSTOM static bool GetMouseButtonUp (int button)
{
return GetInputManager ().GetMouseButtonUp (button);
}
// Resets all input. After ResetInputAxes all axes return to 0 and all buttons return to 0 for one frame.
CUSTOM static void ResetInputAxes () { ResetInput(); }
// The current mouse position in pixel coordinates. (RO)
CUSTOM_PROP static Vector3 mousePosition
{
Vector2f p = GetInputManager ().GetMousePosition();
return Vector3f (p.x, p.y, 0.0F);
}
CUSTOM_PROP static bool mousePresent
{
#if UNITY_METRO
return GetMousePresent();
#else
return true;
#endif
}
CUSTOM_PROP static bool simulateMouseWithTouches
{
return GetInputManager ().GetSimulateMouseWithTouches();
}
{
GetInputManager ().SetSimulateMouseWithTouches(value);
}
// Is any key or mouse button currently held down? (RO)
CUSTOM_PROP static bool anyKey { return GetInputManager ().GetAnyKey (); }
// Returns true the first frame the user hits any key or mouse button. (RO)
CUSTOM_PROP static bool anyKeyDown { return GetInputManager ().GetAnyKeyThisFrame (); }
// Returns the keyboard input entered this frame. (RO)
CUSTOM_PROP static string inputString { return scripting_string_new(GetInputManager ().GetInputString ()); }
// Last measured linear acceleration of a device in three-dimensional space. (RO)
CUSTOM_PROP static Vector3 acceleration { return GetAcceleration (); }
// Returns list of acceleration measurements which occurred during the last frame. (RO) (Allocates temporary variables)
CSRAW public static AccelerationEvent[] accelerationEvents { get {
int count = accelerationEventCount;
AccelerationEvent[] events = new AccelerationEvent[count];
for (int q = 0; q < count; ++q)
events[q] = GetAccelerationEvent (q);
return events;
}
}
// Returns specific acceleration measurement which occurred during last frame. (Does not allocate temporary variables)
CUSTOM static AccelerationEvent GetAccelerationEvent (int index)
{
Acceleration acc;
if (index >= 0 && index < GetAccelerationCount ())
GetAcceleration (index, acc);
else
Scripting::RaiseMonoException ("Index out of bounds.");
return acc;
}
// Number of acceleration measurements which occurred during last frame.
CUSTOM_PROP static int accelerationEventCount { return GetAccelerationCount (); }
// Returns list of objects representing status of all touches during last frame. (RO) (Allocates temporary variables)
CSRAW public static Touch[] touches { get {
int count = touchCount;
Touch[] touches = new Touch[count];
for (int q = 0; q < count; ++q)
touches[q] = GetTouch (q);
return touches;
}
}
// Returns object representing status of a specific touch. (Does not allocate temporary variables)
CUSTOM static Touch GetTouch (int index)
{
#if ENABLE_NEW_EVENT_SYSTEM
if (index >= 0 && index < GetTouchCount ())
{
Touch* t = GetTouch(index);
if (t != NULL)
{
return *t;
}
else
{
Scripting::RaiseMonoException ("GetTouch() failed!");
}
}
else
{
Scripting::RaiseMonoException ("Index specified to GetTouch() is out of bounds! Must be less than Touch.touchCount.");
}
Touch dummy;
return dummy;
#else
Touch touch;
if (index >= 0 && index < GetTouchCount ())
{
if (!GetTouch (index, touch))
Scripting::RaiseMonoException ("Internal error.");
}
else
Scripting::RaiseMonoException ("Index out of bounds.");
return touch;
#endif //ENABLE_NEW_EVENT_SYSTEM
}
// Number of touches. Guaranteed not to change throughout the frame. (RO)
CUSTOM_PROP static int touchCount { return GetTouchCount (); }
OBSOLETE warning eatKeyPressOnTextFieldFocus property is deprecated, and only provided to support legacy behavior.
// Property indicating whether keypresses are eaten by a textinput if it has focus (default true).
CUSTOM_PROP static bool eatKeyPressOnTextFieldFocus { return GetInputManager().GetEatKeyPressOnTextFieldFocus(); } { return GetInputManager().SetEatKeyPressOnTextFieldFocus(value); }
// Property indicating whether the system handles multiple touches.
CONDITIONAL !UNITY_FLASH && !UNITY_WEBGL
CUSTOM_PROP static bool multiTouchEnabled { return IsMultiTouchEnabled (); } { return SetMultiTouchEnabled (value); }
CSRAW private static LocationService locationServiceInstance;
// Property for accessing device location (handheld devices only). (RO)
CSRAW public static LocationService location { get {
if (locationServiceInstance == null)
locationServiceInstance = new LocationService ();
return locationServiceInstance;
}
}
CSRAW private static Compass compassInstance;
// Property for accessing compass (handheld devices only). (RO)
CSRAW public static Compass compass { get {
if (compassInstance == null)
compassInstance = new Compass();
return compassInstance;
}
}
// Device physical orientation as reported by OS. (RO)
CUSTOM_PROP static DeviceOrientation deviceOrientation { return GetOrientation(); }
OBSOLETE error Use ps3 move API instead
CSRAW public static Quaternion GetRotation (int deviceID) { return Quaternion.identity; }
OBSOLETE error Use ps3 move API instead
CSRAW public static Vector3 GetPosition (int deviceID) { return Vector3.zero; }
// Controls enabling and disabling of IME input composition.
CUSTOM_PROP static IMECompositionMode imeCompositionMode
{ return GetInputManager().GetIMECompositionMode(); }
{ GetInputManager().SetIMECompositionMode (value); }
// The current IME composition string being typed by the user.
CUSTOM_PROP static string compositionString { return scripting_string_new(GetInputManager ().GetCompositionString ()); }
// Indicates if the user has an IME keyboard input source selected.
CUSTOM_PROP static bool imeIsSelected { return (GetInputManager().GetIMEIsSelected()); }
// The current text input position used by IMEs to open windows.
CUSTOM_PROP static Vector2 compositionCursorPos
{ return GetInputManager().GetTextFieldCursorPos (); }
{ GetInputManager().GetTextFieldCursorPos () = value; }
// Information about the current mouse or touch event, available during OnInput* series of callbacks.
//CONDITIONAL ENABLE_NEW_EVENT_SYSTEM
//CUSTOM_PROP static Touch currentTouch { return GetInputManager().GetCurrentTouch(); }
END
CSRAW }
|