-
Notifications
You must be signed in to change notification settings - Fork 436
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1206 from ousttrue/fix/first_person_setup_async
[1.0] FirstPerson 初期化を整理
- Loading branch information
Showing
23 changed files
with
2,599 additions
and
93 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
37 changes: 37 additions & 0 deletions
37
Assets/VRM10/Runtime/Components/FirstPerson/Vrm10FirstPersonLayerSettings.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
using UnityEngine; | ||
|
||
namespace UniVRM10 | ||
{ | ||
public static class Vrm10FirstPersonLayerSettings | ||
{ | ||
public const int DEFAULT_FIRSTPERSON_ONLY_LAYER = 9; | ||
public const string FIRSTPERSON_ONLY_LAYER_NAME = "VRMFirstPersonOnly"; | ||
|
||
public const int DEFAULT_THIRDPERSON_ONLY_LAYER = 10; | ||
public const string THIRDPERSON_ONLY_LAYER_NAME = "VRMThirdPersonOnly"; | ||
|
||
public static int GetLayer(int? arg, string name, int fallback) | ||
{ | ||
if (arg.HasValue) | ||
{ | ||
return arg.Value; | ||
} | ||
var layer = LayerMask.NameToLayer(name); | ||
if (layer != -1) | ||
{ | ||
return layer; | ||
} | ||
return fallback; | ||
} | ||
|
||
public static int GetFirstPersonOnlyLayer(int? arg) | ||
{ | ||
return GetLayer(arg, FIRSTPERSON_ONLY_LAYER_NAME, DEFAULT_FIRSTPERSON_ONLY_LAYER); | ||
} | ||
|
||
public static int GetThirdPersonOnlyLayer(int? arg) | ||
{ | ||
return GetLayer(arg, THIRDPERSON_ONLY_LAYER_NAME, DEFAULT_THIRDPERSON_ONLY_LAYER); | ||
} | ||
} | ||
} |
11 changes: 11 additions & 0 deletions
11
Assets/VRM10/Runtime/Components/FirstPerson/Vrm10FirstPersonLayerSettings.cs.meta
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
22 changes: 22 additions & 0 deletions
22
Assets/VRM10/Samples/VRM10FirstPersonSample/VRM10CanvasManager.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
using System.Linq; | ||
using UnityEngine; | ||
using UnityEngine.UI; | ||
|
||
|
||
namespace UniVRM10.FirstPersonSample | ||
{ | ||
public class VRM10CanvasManager : MonoBehaviour | ||
{ | ||
[SerializeField] | ||
public Button LoadVRMButton; | ||
|
||
[SerializeField] | ||
public Button LoadBVHButton; | ||
|
||
private void Reset() | ||
{ | ||
LoadVRMButton = GameObject.FindObjectsOfType<Button>().FirstOrDefault(x => x.name == "LoadVRM"); | ||
LoadBVHButton = GameObject.FindObjectsOfType<Button>().FirstOrDefault(x => x.name == "LoadBVH"); | ||
} | ||
} | ||
} |
11 changes: 11 additions & 0 deletions
11
Assets/VRM10/Samples/VRM10FirstPersonSample/VRM10CanvasManager.cs.meta
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Oops, something went wrong.