private static void SandBoxSubModuleOnSubModuleLoad() { BrushLoader.Inject(BaseResourceHandler.Instance); PrefabsLoader.Inject(BaseResourceHandler.Instance); WidgetLoader.Inject(BaseResourceHandler.Instance); UpdateOptionScreen(MCMUISettings.Instance !); MCMUISettings.Instance !.PropertyChanged += MCMSettings_PropertyChanged; }
private void OnMouseClick() { string objectName = PrefabsLoader.GetRandomPrefabName(); GameObject gO = Instantiate(Resources.Load <GameObject>($"{BaseDefinitions.PrefabFolder}/{objectName}"), Vector3.zero, Quaternion.identity); gO.name = objectName; controller = gO.GetComponent <GeometryObjectController>(); SpawnStateChange(controller); }
/// <summary> /// Intercept LoadMovie("ModOptionsScreen_v1") /// </summary> public static bool Prefix(GauntletMovie __instance) { if (__instance.MovieName == "ModOptionsScreen_v1") { var customType = PrefabsLoader.LoadModOptionsScreen_v1Prefab(); var widgetCreationData = new WidgetCreationData(__instance.Context, __instance.WidgetFactory); widgetCreationData.AddExtensionData(__instance); var widgetInstantiationResult = customType.Instantiate(widgetCreationData); RootViewProperty.SetValue(__instance, widgetInstantiationResult.GetGauntletView()); var target = __instance.RootView.Target; var movieRootNode = (Widget)MovieRootNodeField.GetValue(__instance); movieRootNode.AddChild(target); __instance.RootView.RefreshBindingWithChildren(); return(false); } return(true); }
private void Awake() { PrefabsLoader.Load(); figureSpawner.SpawnStateChange += SpawnStateChange; }
private void Start() { SetObjectTypeOptions(PrefabsLoader.GetAllNames()); removeBtn.onClick.AddListener(RemoveElement); }