private static void AddItemsToTechFabricator()
        {
            var icon        = ImageUtils.LoadSpriteFromFile(Path.Combine(Mod.GetAssetFolder(), "FCSDeepDriller.png"));
            var craftingTab = new CraftingTab(Mod.DeepDrillerTabID, Mod.ModFriendlyName, icon);

            var deepDrillerKit = new FCSKit(Mod.DeepDrillerKitClassID, Mod.DeepDrillerKitFriendlyName, craftingTab, Mod.DeepDrillerKitIngredients);

            deepDrillerKit.Patch(FcTechFabricatorService.PublicAPI, FcAssetBundlesService.PublicAPI);

            var assetsFolder = Mod.GetAssetFolder();

            var focusAttachmentKit = new FCSKit(Mod.FocusAttachmentKitClassID, Mod.FocusAttachmentFriendlyName, craftingTab, Mod.FocusAttachmentKitIngredients);

            focusAttachmentKit.ChangeIconLocation(assetsFolder, "FocusAttachment_DD");
            focusAttachmentKit.Patch(FcTechFabricatorService.PublicAPI, FcAssetBundlesService.PublicAPI);

            var batteryAttachmentKit = new FCSKit(Mod.BatteryAttachmentKitClassID, Mod.BatteryAttachmentFriendlyName, craftingTab, Mod.BatteryAttachmentKitIngredients);

            batteryAttachmentKit.ChangeIconLocation(assetsFolder, "BatteryAttachment_DD");
            batteryAttachmentKit.Patch(FcTechFabricatorService.PublicAPI, FcAssetBundlesService.PublicAPI);

            var solarAttachmentKit = new FCSKit(Mod.SolarAttachmentKitClassID, Mod.SolarAttachmentFriendlyName, craftingTab, Mod.SolarAttachmentKitIngredients);

            solarAttachmentKit.ChangeIconLocation(assetsFolder, "SolarAttachment_DD");
            solarAttachmentKit.Patch(FcTechFabricatorService.PublicAPI, FcAssetBundlesService.PublicAPI);

            var drillerMK1Module = new FCSModule(Mod.DrillerMK1ModuleClassID, Mod.DrillerMK1ModuleFriendlyName, Mod.MK1Description, craftingTab, Mod.DrillerMK1Ingredients);

            drillerMK1Module.ChangeIconLocation(assetsFolder, Mod.DrillerMK1ModuleClassID);
            drillerMK1Module.Patch(FcTechFabricatorService.PublicAPI, FcAssetBundlesService.PublicAPI);

            var drillerMK2Module = new FCSModule(Mod.DrillerMK2ModuleClassID, Mod.DrillerMK2ModuleFriendlyName, Mod.MK2Description, craftingTab, Mod.DrillerMK2Ingredients);

            drillerMK2Module.ChangeIconLocation(assetsFolder, Mod.DrillerMK2ModuleClassID);
            drillerMK2Module.Patch(FcTechFabricatorService.PublicAPI, FcAssetBundlesService.PublicAPI);

            var drillerMK3Module = new FCSModule(Mod.DrillerMK3ModuleClassID, Mod.DrillerMK3ModuleFriendlyName, Mod.MK3Description, craftingTab, Mod.DrillerMK3Ingredients);

            drillerMK3Module.ChangeIconLocation(assetsFolder, Mod.DrillerMK3ModuleClassID);
            drillerMK3Module.Patch(FcTechFabricatorService.PublicAPI, FcAssetBundlesService.PublicAPI);
        }
Exemple #2
0
    // Use this for initialization
    void Awake()
    {
        //If clientunity object is already present on the scene, the new one gets destroyed
        if (FindObjectsOfType(GetType()).Length > 1)
        {
            Destroy(gameObject);
            return;
        }

        //The first ClientUnity is common for every scene
        DontDestroyOnLoad(gameObject);

        //FileInfo fileInfo = new System.IO.FileInfo(Application.dataPath + "/Resources/Update/airt-project-0.1.1-.deb");
        //FileStream fs = File.OpenRead(Application.dataPath + "/Resources/Update/airt-project-0.1.1-.deb");
        //ulong fileSize = (ulong)fileInfo.Length;
        //UnityEngine.Debug.Log("File size: " + fileSize);
        //byte[] fileBytes = new byte[4096];
        //
        //BinaryReader br = new BinaryReader(fs);
        //
        //
        //ulong bytesRead = 0;
        //while (bytesRead < fileSize)
        //{
        //    int readCount = br.Read(fileBytes, (int)0, 4096);
        //    bytesRead += 4096;
        //    UnityEngine.Debug.Log("READING");
        //}
        //UnityEngine.Debug.Log("END");
        //Drone ip
        if (GlobalSettings.Instance.getIP() == "")
        {
            //GlobalSettings.Instance.setIP("10.42.0.101");
            GlobalSettings.Instance.setIP("192.168.8.1");
        }

        //GlobalSettings.Instance.setIP("192.168.8.205");
        //GlobalSettings.Instance.setIP("158.42.154.131");
        //Every module
        client = new Client();

        stdManager             = new StandardModule();
        atreyuManager          = new AtreyuModule();
        osManager              = new OSModule(FileManager.debFilePath, FileManager.debFileName + ".deb");
        fpvManager             = new FPVModule();
        FCS_Module             = new FCSModule();
        libraryManager         = new LibraryModule();
        missionExecutorManager = new MissionExecutorModule();
        pozyxManager           = new PozyxModule();
        pointCloudManager      = new MapperModule();
        droneManager           = new DroneModule();
        recCamModule           = new RecCamModule();
        //mhandlers.Add(new MsgHandler((byte)Modules.POINTCLOUD_MODULE, (byte)PointcloudNotificationType.PCL_SINGLE, onPclData));  // data



        cli_thread = new Thread(() => client.run(mhandlers));
        cli_thread.Start();
        //We start quering atreyu state to see if the app should jump to mapping or recording, as the drone can't do anything other than mapping or recording if it is
        //is those states
        if (client.isConnected)
        {
            tryReconnect = false;
            client.SendCommand((byte)Modules.ATREYU_MODULE, (byte)AtreyuCommandType.ATREYU_QUERY_SYSTEM_STATE);
        }
        else
        {
            tryReconnect = true;
        }
        //client.sendCommand((byte)Modules.ATREYU_MODULE, (byte)AtreyuCommandType.ATREYU_QUERY_SERVER_VERSION);
    }