Skip to content

Commit

Permalink
Add logging when resetting magazine
Browse files Browse the repository at this point in the history
  • Loading branch information
DerpyNewbie committed Jan 22, 2025
1 parent 4ed436d commit 238b49d
Show file tree
Hide file tree
Showing 2 changed files with 85 additions and 14 deletions.
94 changes: 80 additions & 14 deletions Packages/org.centurioncc.system/Runtime/Gun/MagazineManager.asset
Original file line number Diff line number Diff line change
Expand Up @@ -44,25 +44,25 @@ MonoBehaviour:
Data:
- Name:
Entry: 12
Data: 3
Data: 4
- Name:
Entry: 7
Data:
- Name: $k
Entry: 1
Data: magazineVariants
Data: logger
- Name: $v
Entry: 7
Data: 2|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor
- Name: <Name>k__BackingField
Entry: 1
Data: magazineVariants
Data: logger
- Name: <UserType>k__BackingField
Entry: 7
Data: 3|System.RuntimeType, mscorlib
- Name:
Entry: 1
Data: CenturionCC.System.Gun.DataStore.MagazineVariantDataStore[], CenturionCC.System
Data: DerpyNewbie.Logger.NewbieLogger, DerpyNewbie.Logger
- Name:
Entry: 8
Data:
Expand All @@ -71,7 +71,7 @@ MonoBehaviour:
Data: 4|System.RuntimeType, mscorlib
- Name:
Entry: 1
Data: UnityEngine.Component[], UnityEngine.CoreModule
Data: VRC.Udon.UdonBehaviour, VRC.Udon
- Name:
Entry: 8
Data:
Expand Down Expand Up @@ -116,16 +116,82 @@ MonoBehaviour:
Data:
- Name: $k
Entry: 1
Data: sourceMagazine
Data: magazineVariants
- Name: $v
Entry: 7
Data: 7|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor
- Name: <Name>k__BackingField
Entry: 1
Data: sourceMagazine
Data: magazineVariants
- Name: <UserType>k__BackingField
Entry: 7
Data: 8|System.RuntimeType, mscorlib
- Name:
Entry: 1
Data: CenturionCC.System.Gun.DataStore.MagazineVariantDataStore[], CenturionCC.System
- Name:
Entry: 8
Data:
- Name: <SystemType>k__BackingField
Entry: 7
Data: 9|System.RuntimeType, mscorlib
- Name:
Entry: 1
Data: UnityEngine.Component[], UnityEngine.CoreModule
- Name:
Entry: 8
Data:
- Name: <SyncMode>k__BackingField
Entry: 7
Data: System.Nullable`1[[UdonSharp.UdonSyncMode, UdonSharp.Runtime]], mscorlib
- Name:
Entry: 6
Data:
- Name:
Entry: 8
Data:
- Name: <IsSerialized>k__BackingField
Entry: 5
Data: true
- Name: _fieldAttributes
Entry: 7
Data: 10|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], mscorlib
- Name:
Entry: 12
Data: 1
- Name:
Entry: 7
Data: 11|UnityEngine.SerializeField, UnityEngine.CoreModule
- Name:
Entry: 8
Data:
- Name:
Entry: 13
Data:
- Name:
Entry: 8
Data:
- Name:
Entry: 8
Data:
- Name:
Entry: 8
Data:
- Name:
Entry: 7
Data:
- Name: $k
Entry: 1
Data: sourceMagazine
- Name: $v
Entry: 7
Data: 12|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor
- Name: <Name>k__BackingField
Entry: 1
Data: sourceMagazine
- Name: <UserType>k__BackingField
Entry: 7
Data: 13|System.RuntimeType, mscorlib
- Name:
Entry: 1
Data: UnityEngine.GameObject, UnityEngine.CoreModule
Expand All @@ -134,7 +200,7 @@ MonoBehaviour:
Data:
- Name: <SystemType>k__BackingField
Entry: 9
Data: 8
Data: 13
- Name: <SyncMode>k__BackingField
Entry: 7
Data: System.Nullable`1[[UdonSharp.UdonSyncMode, UdonSharp.Runtime]], mscorlib
Expand All @@ -149,13 +215,13 @@ MonoBehaviour:
Data: true
- Name: _fieldAttributes
Entry: 7
Data: 9|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], mscorlib
Data: 14|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], mscorlib
- Name:
Entry: 12
Data: 1
- Name:
Entry: 7
Data: 10|UnityEngine.SerializeField, UnityEngine.CoreModule
Data: 15|UnityEngine.SerializeField, UnityEngine.CoreModule
- Name:
Entry: 8
Data:
Expand All @@ -179,13 +245,13 @@ MonoBehaviour:
Data: _spawnedMagazines
- Name: $v
Entry: 7
Data: 11|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor
Data: 16|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor
- Name: <Name>k__BackingField
Entry: 1
Data: _spawnedMagazines
- Name: <UserType>k__BackingField
Entry: 7
Data: 12|System.RuntimeType, mscorlib
Data: 17|System.RuntimeType, mscorlib
- Name:
Entry: 1
Data: VRC.SDK3.Data.DataList, VRCSDK3
Expand All @@ -194,7 +260,7 @@ MonoBehaviour:
Data:
- Name: <SystemType>k__BackingField
Entry: 9
Data: 12
Data: 17
- Name: <SyncMode>k__BackingField
Entry: 7
Data: System.Nullable`1[[UdonSharp.UdonSyncMode, UdonSharp.Runtime]], mscorlib
Expand All @@ -209,7 +275,7 @@ MonoBehaviour:
Data: false
- Name: _fieldAttributes
Entry: 7
Data: 13|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], mscorlib
Data: 18|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], mscorlib
- Name:
Entry: 12
Data: 0
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
using System;
using CenturionCC.System.Gun.DataStore;
using DerpyNewbie.Common;
using DerpyNewbie.Logger;
using JetBrains.Annotations;
using UdonSharp;
using UnityEngine;
Expand All @@ -11,6 +12,9 @@ namespace CenturionCC.System.Gun
[UdonBehaviourSyncMode(BehaviourSyncMode.Manual)]
public class MagazineManager : UdonSharpBehaviour
{
[SerializeField] [NewbieInject]
private NewbieLogger logger;

[SerializeField] [NewbieInject]
private MagazineVariantDataStore[] magazineVariants;

Expand Down Expand Up @@ -47,6 +51,7 @@ public Magazine SpawnMagazine(MagazineVariantDataStore dataStore, Vector3 positi
[PublicAPI]
public void ResetMagazines()
{
logger.Log("MagazineManager::ResetMagazines");
// foreach cannot be used to DataList in UdonSharp
// ReSharper disable once ForCanBeConvertedToForeach
for (var i = 0; i < _spawnedMagazines.Count; i++)
Expand Down

0 comments on commit 238b49d

Please sign in to comment.