|
|
@@ -100,7 +100,9 @@ namespace GamecraftModdingAPI.Blocks |
|
|
|
} |
|
|
|
}*/ |
|
|
|
|
|
|
|
public static void Prefix(ref Dictionary<string, BaseData> blocks) |
|
|
|
private static Material[] materials; |
|
|
|
|
|
|
|
public static void Prefix(List<PrefabData> prefabData, IList<GameObject> prefabs) |
|
|
|
{ |
|
|
|
/*foreach (var block in blocks.Values.Cast<CubeListData>()) |
|
|
|
{ |
|
|
@@ -109,11 +111,25 @@ namespace GamecraftModdingAPI.Blocks |
|
|
|
|
|
|
|
/*var res = Addressables.LoadContentCatalogAsync("customCatalog.json"); |
|
|
|
while (!res.IsDone) yield return Yield.It;*/ |
|
|
|
for (int i = 0; i < prefabData.Count; i++) |
|
|
|
{ |
|
|
|
var gameObject = prefabs[i]; |
|
|
|
switch (gameObject.name) |
|
|
|
{ |
|
|
|
case "Cube": |
|
|
|
gameObject.GetComponentsInChildren<MeshRenderer>()[0].sharedMaterials = materials; |
|
|
|
break; |
|
|
|
case "CTR_CommandBlock": |
|
|
|
materials = gameObject.GetComponentsInChildren<MeshRenderer>()[0].sharedMaterials; |
|
|
|
break; |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
public static MethodBase TargetMethod() |
|
|
|
{ //General block registration |
|
|
|
return AccessTools.Method("RobocraftX.Blocks.BlocksCompositionRoot:RegisterPartPrefabs"); |
|
|
|
//return AccessTools.Method("RobocraftX.Blocks.BlocksCompositionRoot:RegisterPartPrefabs"); |
|
|
|
return AccessTools.Method("RobocraftX.Rendering.ECSGPUIResourceManager:InitPreRegisteredPrefabs"); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|