Skip to content

Commit

Permalink
ver 2.0.0-beta.3
Browse files Browse the repository at this point in the history
  • Loading branch information
mimyquality committed Sep 21, 2024
1 parent 22debe9 commit f430090
Show file tree
Hide file tree
Showing 4 changed files with 63 additions and 3 deletions.
9 changes: 9 additions & 0 deletions Packages/com.mimylab.fukuroudon/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,12 @@

利用手順は[こちら](https://github.com/mimyquality/FukuroUdon/wiki)からご確認ください。

## [2.0.0-beta.3] - 2024/9/21

- **Fixed**
- ActiveRelay
- ActiveRelay to Componentに対象外のオブジェクト・コンポーネントをセットできなくなり、セットされていた場合除去されるようになりました。

## [2.0.0-beta.2] - 2024/9/14

- **Changed**
Expand Down Expand Up @@ -529,6 +535,9 @@
- 0.2.7バージョンで、later-joiner視点でjoin直後が非アクティブだと同期しなかったのを修正しました。
- 他人がピックアップした際にオブジェクトが一瞬跳ねる現象を低減しました。

[2.0.0-beta.3]: https://github.com/mimyquality/FukuroUdon/releases/tag/2.0.0-beta.3
[2.0.0-beta.2]: https://github.com/mimyquality/FukuroUdon/releases/tag/2.0.0-beta.2
[2.0.0-beta]: https://github.com/mimyquality/FukuroUdon/releases/tag/2.0.0-beta
[1.24.1]: https://github.com/mimyquality/FukuroUdon/releases/tag/1.24.1
[1.24.0]: https://github.com/mimyquality/FukuroUdon/releases/tag/1.24.0
[1.23.0]: https://github.com/mimyquality/FukuroUdon/releases/tag/1.23.0
Expand Down
2 changes: 1 addition & 1 deletion Packages/com.mimylab.fukuroudon/README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Fukuro Udon

かゆいところに手が届くU#ギミック詰め合わせVPMパッケージです。
[BOOTHで展開](https://mimyquality.booth.pm/item_lists/rdaT1p1m)しているU#アセット達が含まれます
[BOOTHで展開](https://mimyquality.booth.pm/item_lists/rdaT1p1m)していたU#アセット達はこちらに含まれ、メンテされるようになりました
詳細は[こちら](https://github.com/mimyquality/FukuroUdon/wiki)を参照してください。
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,23 @@ public class ActiveRelayToComponent : UdonSharpBehaviour
[SerializeField]
private bool _invert = false;

#if !COMPILER_UDONSHARP && UNITY_EDITOR
private void OnValidate()
{
var count = 0;
var tmp = new Object[_components.Length];
foreach (var component in _components)
{
if (ValidateComponentType(component))
{
tmp[count++] = component;
}
}
System.Array.Resize(ref tmp, count);
_components = tmp;
}
#endif

private void OnEnable()
{
if (_eventType == ActiveRelayEventType.ActiveAndInactive
Expand All @@ -43,14 +60,48 @@ private void OnDisable()
}
}

private bool ValidateComponentType(Object component)
{
if (!component) { return false; }

var type = component.GetType();
if (type == typeof(GameObject)) { return false; }
// Collider
else if (type == typeof(BoxCollider)) { return true; }
else if (type == typeof(SphereCollider)) { return true; }
else if (type == typeof(CapsuleCollider)) { return true; }
else if (type == typeof(MeshCollider)) { return true; }
else if (type == typeof(WheelCollider)) { return true; }
//else if (type == typeof(TerrainCollider)) { return true; }
// Renderer
else if (type == typeof(MeshRenderer)) { return true; }
else if (type == typeof(SkinnedMeshRenderer)) { return true; }
else if (type == typeof(LineRenderer)) { return true; }
else if (type == typeof(TrailRenderer)) { return true; }
else if (type == typeof(BillboardRenderer)) { return true; }
else if (type == typeof(SpriteRenderer)) { return true; }
//else if (type == typeof(UnityEngine.Tilemaps.TilemapRenderer)) { return true; }
else if (type == typeof(OcclusionPortal)) { return true; }
// Constraint
else if (type == typeof(AimConstraint)) { return true; }
else if (type == typeof(LookAtConstraint)) { return true; }
else if (type == typeof(ParentConstraint)) { return true; }
else if (type == typeof(PositionConstraint)) { return true; }
else if (type == typeof(RotationConstraint)) { return true; }
else if (type == typeof(ScaleConstraint)) { return true; }
// Camera
else if (type == typeof(Camera)) { return true; }

return false;
}

private void ToggleComponents(bool value)
{
foreach (var component in _components)
{
if (!component) continue;

var type = component.GetType();
//if (type == typeof(GameObject)) { var downCasted = (GameObject)component; downCasted.SetActive(value); }
if (type == typeof(GameObject)) { return; }
// Collider
else if (type == typeof(BoxCollider)) { var downCasted = (BoxCollider)component; downCasted.enabled = value; }
Expand Down
2 changes: 1 addition & 1 deletion Packages/com.mimylab.fukuroudon/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "com.mimylab.fukuroudon",
"displayName": "Fukuro Udon",
"version": "2.0.0-beta.2",
"version": "2.0.0-beta.3",
"description": "MimyLab's U# utilitiy pack for VPM.",
"unity": "2022.3",
"author": {
Expand Down

0 comments on commit f430090

Please sign in to comment.