コード例 #1
0
ファイル: TrarckPlugin.cs プロジェクト: trarck/dspbp
        void Awake()
        {
            m_Harmony = new Harmony("com.trarck.dspplugin");

            m_Harmony.PatchAll(typeof(PlayerAction_Build_Patch));

            m_Harmony.PatchAll(typeof(UIBuildingGrid_Patch));

            InitInputKeys();

            //GameData gd = GameMain.data;

            //Player p1 = GameMain.mainPlayer;

            //PlanetData pd1= GameMain.mainPlayer.planetData;
            //PlanetData pd2= GameMain.data.localPlanet;

            //PlanetFactory pf = pd1.factory;

            //FactorySystem fs = pf.factorySystem;

            m_EnterFactoryBPMode = false;

            m_FactoryBP = new FactoryBP();
            m_FactoryBP.Init();

            m_FactoryBPUI = new FactoryBPUI();
            m_FactoryBPUI.Init(m_FactoryBP);
            m_FactoryBPUI.RefreshBPFiles();

            s_Instance = this;
        }
コード例 #2
0
        static void Main(string[] args)
        {
            Console.WriteLine("Hello World!");

            FactoryBP fbp = new FactoryBP();

            fbp.bpDir = Environment.CurrentDirectory;


            BPData bPData = new BPData();

            bPData.name = "test";

            BPEntityData bPEntity = new BPEntityData();

            bPEntity.protoId      = 1;
            bPEntity.type         = BPEntityType.Belt;
            bPEntity.pos          = new Vector3(1, 2, 3);
            bPEntity.rot          = Quaternion.identity;
            bPEntity.gcsCellIndex = new Vector2Int(100, 100);

            bPData.entities.Add(bPEntity);

            bPEntity              = new BPEntityData();
            bPEntity.protoId      = 2;
            bPEntity.type         = BPEntityType.Assembler;
            bPEntity.pos          = new Vector3(4, 5, 6);
            bPEntity.rot          = Quaternion.identity;
            bPEntity.gcsCellIndex = new Vector2Int(50, 50);

            bPData.entities.Add(bPEntity);

            fbp.SaveBPData(bPData);
        }
コード例 #3
0
ファイル: FactoryBPUI.cs プロジェクト: trarck/dspbp
        public void Init(FactoryBP fbp)
        {
            factoryBP          = fbp;
            m_BPFiles          = new List <BluePrintFile>();
            m_SearchedBPFiles  = new List <BluePrintFile>();
            m_PageItemCountStr = m_PageItemCount.ToString();
            m_PageIndexStr     = m_PageIndex.ToString();

            m_BPEntitiesCount = new Dictionary <int, int>();
            m_EntityInfos     = new Dictionary <int, string>();
            m_EntityIcons     = new Dictionary <int, Texture>();
        }
コード例 #4
0
ファイル: TrarckPlugin.cs プロジェクト: trarck/dspbp
        private void ExportModelLapJot()
        {
            LapJointAsset lapJointAsset = new LapJointAsset();

            lapJointAsset.lapJoints = new List <LapJointNode>();
            foreach (ItemProto itemProto in LDB.items.dataArray)
            {
                PrefabDesc prefabDesc = FactoryBP.GetPrefabDesc(itemProto);
                if (prefabDesc != null)
                {
                    //Debug.LogFormat("{0},{1}", itemProto.ID, prefabDesc.lapJoint);
                    LapJointNode node = new LapJointNode()
                    {
                        protoId  = itemProto.ID,
                        lapJoint = prefabDesc.lapJoint
                    };
                    lapJointAsset.lapJoints.Add(node);
                }
            }

            //System.Text.StringBuilder sb = new System.Text.StringBuilder();
            //sb.Append("{\n");
            //sb.Append("\"lapJoints\":[\n");
            //foreach (var node in lapJointAsset.lapJoints)
            //{
            //	sb.Append("{");
            //	sb.Append("\"protoId\":").Append(node.protoId).Append(",\n");
            //	sb.Append("\"lapJoint\":")
            //		   .Append("{");
            //				sb.Append("\"x\":").Append(node.lapJoint.x).Append(",");
            //				sb.Append("\"y\":").Append(node.lapJoint.y).Append(",");
            //				sb.Append("\"z\":").Append(node.lapJoint.z);
            //			sb.Append("}").Append("\n");
            //	sb.Append("},\n");
            //}
            //sb.Append("]\n");
            //sb.Append("}");
            //string jsonStr = sb.toString();

            string jsonStr = JsonUtility.ToJson(lapJointAsset);
            string outFile = System.IO.Path.Combine(Environment.CurrentDirectory, "BepInEx/config", "latJoint.json");

            System.IO.File.WriteAllText(outFile, jsonStr);
        }
コード例 #5
0
ファイル: MultiSelector.cs プロジェクト: trarck/dspbp
 public void Init(FactoryBP fbp = null)
 {
     factoryBP      = fbp;
     m_BlankTexture = CreateDummyTex();
 }