Пример #1
0
    public static void Destroy()
    {
        if (m_instance == null)
        {
            Console.Out.WriteLine("The ShaderTool is not instanciated, create it before destroying");
            return;
        }

        Destroy(m_instance.gameObject);
        m_instance = null;
    }
Пример #2
0
    public static void Instanciate()
    {
        if (m_instance != null)
        {
            Console.Out.WriteLine("ShaderTool is already instanciated");
            return;
        }

        var obj  = new GameObject("ShaderTool");
        var tool = obj.AddComponent <ShaderTool>();

        m_instance = tool;

        DontDestroyOnLoad(obj);
    }
Пример #3
0
        public void Initialize(IManager manager, string ipcIdentifier)
        {
            try
            {
                var harmony = new Harmony("com.Larnin.CustomCar");

                harmony.PatchAll(Assembly.GetExecutingAssembly());
            }
            catch (Exception e)
            {
                Console.Out.WriteLine(e.ToString());
            }

            //DebugShaderList.Exec();
            ShaderTool.Instanciate();
            //AudioPlayer.Init();

            try
            {
                CarInfos carInfos = new CarInfos();
                carInfos.collectInfos();
                CarBuilder builder = new CarBuilder();
                builder.createCars(carInfos);
            }
            catch (Exception e)
            {
                ErrorList.add("An error occured while trying to load cars assets");
                Console.Out.WriteLine(e.ToString());
            }

            ModdedCarsColors.LoadAll();

            //disable loging cars
            //LogCarPrefabs.logCars();

            Events.MainMenu.Initialized.Subscribe(data =>
            {
                if (ErrorList.haveErrors())
                {
                    ErrorList.show();
                }
            });
        }