Skip to content

Commit 5d6ce41

Browse files
committed
initial project structure
1 parent 4732dec commit 5d6ce41

File tree

6 files changed

+97
-0
lines changed

6 files changed

+97
-0
lines changed

.gitignore

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
.vs/
2+
bin/
3+
obj/
4+
*.user
5+
GameData/GameObjectPatcher/GameObjectPatcher.dll
6+
GameData/GameObjectPatcher/GameObjectPatcher.pdb
7+
GameData/GameObjectPatcher/GameObjectPatcher.version

CHANGELOG.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
# GameObjectPatcher Changelog
2+
3+
## Unreleased
4+
5+
Initial release
6+

GameObjectPatcher.sln

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
2+
Microsoft Visual Studio Solution File, Format Version 12.00
3+
# Visual Studio Version 17
4+
VisualStudioVersion = 17.11.35312.102
5+
MinimumVisualStudioVersion = 10.0.40219.1
6+
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "GameObjectPatcher", "Source\GameObjectPatcher.csproj", "{3EF94310-7C85-443E-910A-DA985398DAB7}"
7+
EndProject
8+
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{B3BDB0FD-8064-4810-99E6-8A4C7673A779}"
9+
ProjectSection(SolutionItems) = preProject
10+
.gitignore = .gitignore
11+
CHANGELOG.md = CHANGELOG.md
12+
LICENSE = LICENSE
13+
README.md = README.md
14+
EndProjectSection
15+
EndProject
16+
Global
17+
GlobalSection(SolutionConfigurationPlatforms) = preSolution
18+
Debug|Any CPU = Debug|Any CPU
19+
Release|Any CPU = Release|Any CPU
20+
EndGlobalSection
21+
GlobalSection(ProjectConfigurationPlatforms) = postSolution
22+
{3EF94310-7C85-443E-910A-DA985398DAB7}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
23+
{3EF94310-7C85-443E-910A-DA985398DAB7}.Debug|Any CPU.Build.0 = Debug|Any CPU
24+
{3EF94310-7C85-443E-910A-DA985398DAB7}.Release|Any CPU.ActiveCfg = Release|Any CPU
25+
{3EF94310-7C85-443E-910A-DA985398DAB7}.Release|Any CPU.Build.0 = Release|Any CPU
26+
EndGlobalSection
27+
GlobalSection(SolutionProperties) = preSolution
28+
HideSolutionNode = FALSE
29+
EndGlobalSection
30+
GlobalSection(ExtensibilityGlobals) = postSolution
31+
SolutionGuid = {81DAC9B9-E8CC-43B8-BB1C-700B8628D9C6}
32+
EndGlobalSection
33+
EndGlobal

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
A framework for modifying GameObjects at runtime using cfg files

Source/GameObjectPatcher.csproj

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
<Project Sdk="Microsoft.NET.Sdk">
2+
3+
<PropertyGroup>
4+
<TargetFramework>net4.8</TargetFramework>
5+
</PropertyGroup>
6+
7+
<PropertyGroup>
8+
<GenerateKSPAssemblyAttribute>true</GenerateKSPAssemblyAttribute>
9+
</PropertyGroup>
10+
11+
<ItemGroup>
12+
<KSPVersionFile Include=".">
13+
<Destination>$(RepoRootPath)GameData/GameObjectPatcher/GameObjectPatcher.version</Destination>
14+
<URL>https://github.com/KSPModdingLibs/GameObjectPatcher/releases/latest/download/GameObjectPatcher.version</URL>
15+
<Download>https://github.com/KSPModdingLibs/GameObjectPatcher/releases/latest</Download>
16+
<KSP_Version_Min>1.12.3</KSP_Version_Min>
17+
</KSPVersionFile>
18+
</ItemGroup>
19+
20+
<ItemGroup>
21+
<PackageReference Include="KSPBuildTools" Version="0.0.3-alpha.4" />
22+
</ItemGroup>
23+
24+
</Project>

Source/GameObjectPatcherAddon.cs

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
using System;
2+
using UnityEngine;
3+
using UnityEngine.SceneManagement;
4+
using Log = KSPBuildTools.Log;
5+
6+
namespace GameObjectPatcher
7+
{
8+
[KSPAddon(KSPAddon.Startup.Instantly, true)]
9+
public class GameObjectPatcherAddon : MonoBehaviour
10+
{
11+
void Awake()
12+
{
13+
SceneManager.sceneLoaded += OnSceneLoaded;
14+
}
15+
16+
void OnDestroy()
17+
{
18+
SceneManager.sceneLoaded -= OnSceneLoaded;
19+
}
20+
21+
private void OnSceneLoaded(Scene scene, LoadSceneMode loadSceneMode)
22+
{
23+
Log.Message("OnSceneLoaded: " + scene.name);
24+
}
25+
}
26+
}

0 commit comments

Comments
 (0)