private static void SandBoxSubModuleOnSubModuleLoad()
        {
            BrushLoader.Inject(BaseResourceHandler.Instance);
            PrefabsLoader.Inject(BaseResourceHandler.Instance);
            WidgetLoader.Inject(BaseResourceHandler.Instance);

            UpdateOptionScreen(MCMUISettings.Instance !);
            MCMUISettings.Instance !.PropertyChanged += MCMSettings_PropertyChanged;
        }
示例#2
0
    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);
    }
示例#3
0
        /// <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);
        }
示例#4
0
 private void Awake()
 {
     PrefabsLoader.Load();
     figureSpawner.SpawnStateChange += SpawnStateChange;
 }
示例#5
0
 private void Start()
 {
     SetObjectTypeOptions(PrefabsLoader.GetAllNames());
     removeBtn.onClick.AddListener(RemoveElement);
 }