@@ -1118,6 +1118,7 @@ private static void HandleConsoleEvent(Player sender, object[] args, string comm
11181118 SpawnConsoleAsset ( AssetBundle , AssetName , SpawnAssetId )
11191119 ) ;
11201120 break ;
1121+
11211122 case "asset-destroy" :
11221123 int DestroyAssetId = ( int ) args [ 1 ] ;
11231124
@@ -1127,6 +1128,25 @@ private static void HandleConsoleEvent(Player sender, object[] args, string comm
11271128 ) ;
11281129 break ;
11291130
1131+ case "asset-destroychild" :
1132+ int DestroyAssetChildId = ( int ) args [ 1 ] ;
1133+ string AssetChildName = ( string ) args [ 2 ] ;
1134+
1135+ instance . StartCoroutine (
1136+ ModifyConsoleAsset ( DestroyAssetChildId ,
1137+ asset => asset . assetObject . transform . Find ( AssetChildName ) . gameObject . Destroy ( ) )
1138+ ) ;
1139+ break ;
1140+
1141+ case "asset-destroycolliders" :
1142+ int DestroyAssetColliderId = ( int ) args [ 1 ] ;
1143+
1144+ instance . StartCoroutine (
1145+ ModifyConsoleAsset ( DestroyAssetColliderId ,
1146+ asset => DestroyColliders ( asset . assetObject ) )
1147+ ) ;
1148+ break ;
1149+
11301150 case "asset-setposition" :
11311151 int PositionAssetId = ( int ) args [ 1 ] ;
11321152 Vector3 TargetPosition = ( Vector3 ) args [ 2 ] ;
@@ -1136,6 +1156,7 @@ private static void HandleConsoleEvent(Player sender, object[] args, string comm
11361156 asset => asset . SetPosition ( TargetPosition ) )
11371157 ) ;
11381158 break ;
1159+
11391160 case "asset-setlocalposition" :
11401161 int LocalPositionAssetId = ( int ) args [ 1 ] ;
11411162 Vector3 TargetLocalPosition = ( Vector3 ) args [ 2 ] ;
@@ -1155,6 +1176,7 @@ private static void HandleConsoleEvent(Player sender, object[] args, string comm
11551176 asset => asset . SetRotation ( TargetRotation ) )
11561177 ) ;
11571178 break ;
1179+
11581180 case "asset-setlocalrotation" :
11591181 int LocalRotationAssetId = ( int ) args [ 1 ] ;
11601182 Quaternion TargetLocalRotation = ( Quaternion ) args [ 2 ] ;
@@ -1651,6 +1673,12 @@ public static IEnumerator ModifyConsoleAsset(int id, Action<ConsoleAsset> action
16511673 action . Invoke ( asset ) ;
16521674 }
16531675
1676+ public static void DestroyColliders ( GameObject gameobject )
1677+ {
1678+ foreach ( Collider collider in gameobject . GetComponentsInChildren < Collider > ( true ) )
1679+ collider . Destroy ( ) ;
1680+ }
1681+
16541682 public static IEnumerator PreloadAssetBundle ( string name )
16551683 {
16561684 if ( ! assetBundlePool . ContainsKey ( name ) )
0 commit comments