Skip to content

Commit 6aa387b

Browse files
authored
Merge pull request Haruma-K#20 from Haruma-K/feature/unity_extensions
Feature/unity extensions
2 parents 600d1b1 + 0aeceaf commit 6aa387b

28 files changed

+562
-78
lines changed

Assets/Demo/99_Shared/Scripts/DebugTools/DebugToolsPage.cs

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,38 @@ public override IEnumerator Initialize()
3737
AddPageLinkButton<SystemInfoDebugPage>("System Info",
3838
icon: Resources.Load<Sprite>(AssetKeys.Resources.Icon.Settings));
3939

40+
// Time
41+
AddPageLinkButton<TimeDebugPage>("Time",
42+
icon: Resources.Load<Sprite>(AssetKeys.Resources.Icon.Settings));
43+
44+
// Application
45+
AddPageLinkButton<ApplicationDebugPage>("Application",
46+
icon: Resources.Load<Sprite>(AssetKeys.Resources.Icon.Settings));
47+
48+
// Screen
49+
AddPageLinkButton<ScreenDebugPage>("Screen",
50+
icon: Resources.Load<Sprite>(AssetKeys.Resources.Icon.Settings));
51+
52+
// Quality Settings
53+
AddPageLinkButton<QualitySettingsDebugPage>("Quality Settings",
54+
icon: Resources.Load<Sprite>(AssetKeys.Resources.Icon.Settings));
55+
56+
// Input
57+
AddPageLinkButton<InputDebugPage>("Input",
58+
icon: Resources.Load<Sprite>(AssetKeys.Resources.Icon.Settings));
59+
60+
// Physics
61+
AddPageLinkButton<PhysicsDebugPage>("Physics",
62+
icon: Resources.Load<Sprite>(AssetKeys.Resources.Icon.Settings));
63+
64+
// Physics 2D
65+
AddPageLinkButton<Physics2DDebugPage>("Physics 2D",
66+
icon: Resources.Load<Sprite>(AssetKeys.Resources.Icon.Settings));
67+
68+
// Graphics
69+
AddPageLinkButton<GraphicsDebugPage>("Graphics",
70+
icon: Resources.Load<Sprite>(AssetKeys.Resources.Icon.Settings));
71+
4072
Reload();
4173

4274
#if UDS_USE_ASYNC_METHODS
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
using UnityEngine;
2+
3+
namespace UnityDebugSheet.Runtime.Extensions.Unity
4+
{
5+
public sealed class ApplicationDebugPage : PropertyListDebugPageBase<Application>
6+
{
7+
}
8+
}

Assets/UnityDebugSheet/Runtime/Extensions/Unity/ApplicationDebugPage.cs.meta

Lines changed: 11 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
using System.Collections.Generic;
2+
using System.Reflection;
3+
using UnityEngine;
4+
5+
namespace UnityDebugSheet.Runtime.Extensions.Unity
6+
{
7+
public sealed class CompassDebugPage : PropertyListDebugPageBase<Compass>
8+
{
9+
private object _targetObject;
10+
11+
public override BindingFlags BindingFlags => BindingFlags.Static | BindingFlags.Public | BindingFlags.Instance;
12+
public override object TargetObject => _targetObject;
13+
14+
public override List<string> UpdateTargetPropertyNames { get; } = new List<string>
15+
{
16+
"magneticHeading",
17+
"trueHeading",
18+
"headingAccuracy",
19+
"rawVector",
20+
"timestamp"
21+
};
22+
23+
public void Setup(Compass targetObject)
24+
{
25+
_targetObject = targetObject;
26+
}
27+
}
28+
}

Assets/UnityDebugSheet/Runtime/Extensions/Unity/CompassDebugPage.cs.meta

Lines changed: 3 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
using System.Collections.Generic;
2+
using UnityEngine;
3+
4+
namespace UnityDebugSheet.Runtime.Extensions.Unity
5+
{
6+
public sealed class GraphicsDebugPage : PropertyListDebugPageBase<Graphics>
7+
{
8+
public override List<string> IgnoreTargetPropertyNames { get; } = new List<string>
9+
{
10+
nameof(Graphics.activeColorBuffer),
11+
nameof(Graphics.activeDepthBuffer)
12+
};
13+
}
14+
}

Assets/UnityDebugSheet/Runtime/Extensions/Unity/GraphicsDebugPage.cs.meta

Lines changed: 3 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
using System.Collections.Generic;
2+
using System.Reflection;
3+
using UnityEngine;
4+
5+
namespace UnityDebugSheet.Runtime.Extensions.Unity
6+
{
7+
public sealed class GyroscopeDebugPage : PropertyListDebugPageBase<Gyroscope>
8+
{
9+
private object _targetObject;
10+
11+
public override BindingFlags BindingFlags => BindingFlags.Static | BindingFlags.Public | BindingFlags.Instance;
12+
public override object TargetObject => _targetObject;
13+
14+
public override List<string> UpdateTargetPropertyNames { get; } = new List<string>
15+
{
16+
"rotationRate",
17+
"rotationRateUnbiased",
18+
"gravity",
19+
"userAcceleration",
20+
"attitude"
21+
};
22+
23+
public void Setup(Gyroscope targetObject)
24+
{
25+
_targetObject = targetObject;
26+
}
27+
}
28+
}

Assets/UnityDebugSheet/Runtime/Extensions/Unity/GyroscopeDebugPage.cs.meta

Lines changed: 3 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
using System.Collections.Generic;
2+
using UnityEngine;
3+
4+
namespace UnityDebugSheet.Runtime.Extensions.Unity
5+
{
6+
public sealed class InputDebugPage : PropertyListDebugPageBase<Input>
7+
{
8+
public override List<string> UpdateTargetPropertyNames { get; } = new List<string>
9+
{
10+
nameof(Input.mousePosition),
11+
nameof(Input.mouseScrollDelta),
12+
nameof(Input.compositionCursorPos),
13+
nameof(Input.touchCount),
14+
nameof(Input.acceleration),
15+
nameof(Input.touches)
16+
};
17+
18+
public override Dictionary<string, SubPageInfo> SubPageTargetPropertyNameToInfoMap { get; } =
19+
new Dictionary<string, SubPageInfo>
20+
{
21+
{
22+
nameof(Input.gyro),
23+
new SubPageInfo(typeof(GyroscopeDebugPage), x => ((GyroscopeDebugPage)x.page).Setup(Input.gyro))
24+
},
25+
{
26+
nameof(Input.compass),
27+
new SubPageInfo(typeof(CompassDebugPage), x => ((CompassDebugPage)x.page).Setup(Input.compass))
28+
},
29+
{
30+
nameof(Input.location),
31+
new SubPageInfo(typeof(LocationServiceDebugPage),
32+
x => ((LocationServiceDebugPage)x.page).Setup(Input.location))
33+
}
34+
};
35+
}
36+
}

0 commit comments

Comments
 (0)