XRSessionUpdateParams.cs
1.81 KB
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
using System;
namespace UnityEngine.XR.ARSubsystems
{
/// <summary>
/// Update parameters for <see cref="XRSessionSubsystem.Update(XRSessionUpdateParams)"/>.
/// </summary>
public struct XRSessionUpdateParams : IEquatable<XRSessionUpdateParams>
{
/// <summary>
/// The current screen orientation
/// </summary>
public ScreenOrientation screenOrientation { get; set; }
/// <summary>
/// The current screen dimensions.
/// </summary>
public Vector2Int screenDimensions { get; set; }
public override int GetHashCode()
{
unchecked
{
var hash = ((int)screenOrientation).GetHashCode();
hash = hash * 486187739 + screenDimensions.GetHashCode();
return hash;
}
}
public override bool Equals(object obj)
{
if (!(obj is XRSessionUpdateParams))
return false;
return Equals((XRSessionUpdateParams)obj);
}
public override string ToString()
{
return string.Format("Screen Orientation: {0}, Screen Dimensions: {1}",
screenOrientation, screenDimensions);
}
public bool Equals(XRSessionUpdateParams other)
{
return
(screenOrientation == other.screenOrientation) &&
(screenDimensions.Equals(other.screenDimensions));
}
public static bool operator ==(XRSessionUpdateParams lhs, XRSessionUpdateParams rhs)
{
return lhs.Equals(rhs);
}
public static bool operator !=(XRSessionUpdateParams lhs, XRSessionUpdateParams rhs)
{
return !lhs.Equals(rhs);
}
}
}