示例#1
0
 public static void ReadLocalisationFile()
 {
     localisationDic.Clear();
     lines     = ModIO.ReadAllLines(locatisationFilePath);
     languages = lines[0].Split(',');
     for (int i = 1; i < lines.Length; i++)
     {
         string[] strs = lines[i].Split(',');
         localisationDic.Add(strs[0], strs);
     }
 }
示例#2
0
 public static bool IsExist(String path)
 {
     try {
         //ModConsole.Log("Find: " + path);
         if (ModIO.ExistsFile(path))
         {
             return(true);
         }
     } catch {
         //ModConsole.Log("" + e);
     }
     return(false);
 }
示例#3
0
        public static void Load()
        {
            AssetBundle = bundle.AssetBundle;
            var allAssets = AssetBundle.LoadAllAssets();

            if (allAssets.Length <= 0)
            {
                Debug.LogWarning("asset bundle is empty attempting manual reloading");
                byte[] bytes = ModIO.ReadAllBytes("Resources/portal.unity3d");
                AssetBundle.Unload(false);
                AssetBundle = new AssetBundle();
                StatMaster.Instance.StartCoroutine(IELoad(AssetBundle.LoadFromMemoryAsync(bytes)));
                return;
            }
            RebuildForNewLevel();
        }
示例#4
0
    void ReadMeshs(string path, bool data = false)
    {
        List <ModMesh> modMeshes = new List <ModMesh>();

        string[] vs = ModIO.GetFiles(path, data);

        Debug.Log(vs.Length);
        Debug.Log(vs[0]);
        Console.WriteLine(vs[0]);



        //ModResource.CreateMeshResource("",)

        //foreach (var str in vs)
        //{
        //    Debug.Log(str.ToString());
        //}
    }
示例#5
0
        public RocketsController()
        {
            rocketTargetDict     = new Dictionary <BlockBehaviour, int>();
            playerGroupedRockets = new Dictionary <int, Dictionary <KeyCode, HashSet <TimedRocket> > >();
            InitRedSquareAndLayer();

            void InitRedSquareAndLayer()
            {
                redSquareAim.LoadImage(ModIO.ReadAllBytes(@"Resources/Square-Red.png"));
                redCircleAim.LoadImage(ModIO.ReadAllBytes(@"Resources/Circle-Red.png"));

                SetRadarIgnoreCollosionLayer();

                void SetRadarIgnoreCollosionLayer()
                {
                    Physics.IgnoreLayerCollision(RadarScript.CollisionLayer, RadarScript.CollisionLayer, true);
                    Physics.IgnoreLayerCollision(RadarScript.CollisionLayer, 29, true);
                }
            }
        }