Glowy test

This commit is contained in:
Chris Adderley
2020-04-23 15:33:23 -07:00
parent d50c8ad21c
commit a930b09165
10 changed files with 130 additions and 1 deletions

View File

@ -0,0 +1,43 @@
using System;
using System.Collections.Generic;
using UnityEngine;
namespace Restock
{
public class ModuleRestockLinkedColorChanger : ModuleColorChanger
{
// The module to link this ColorChanger to
[KSPField] public string parentModuleID = "moduleName";
public ModuleColorChanger parentModuleColorChanger;
public override void Start()
{
base.Start();
if (HighLogic.LoadedSceneIsFlight || HighLogic.LoadedSceneIsEditor)
{
foreach (ModuleColorChanger mcc in part.GetComponents<ModuleColorChanger>())
{
Debug.Log(mcc.moduleID);
if (mcc.moduleID == parentModuleID)
{
parentModuleColorChanger = mcc;
}
}
}
}
public override void FixedUpdate()
{
base.FixedUpdate();
if (!parentModuleColorChanger)
return;
SetScalar(parentModuleColorChanger.GetScalar);
}
}
}

View File

@ -33,14 +33,17 @@
<ItemGroup>
<Reference Include="Assembly-CSharp">
<Private>False</Private>
<HintPath>..\..\..\..\..\..\..\Games\Steam\steamapps\common\Kerbal Space Program\KSP_x64_Data\Managed\Assembly-CSharp.dll</HintPath>
</Reference>
<Reference Include="System" />
<Reference Include="System.Core" />
<Reference Include="UnityEngine.CoreModule">
<Private>False</Private>
<HintPath>..\..\..\..\..\..\..\Games\Steam\steamapps\common\Kerbal Space Program\KSP_x64_Data\Managed\UnityEngine.CoreModule.dll</HintPath>
</Reference>
<Reference Include="UnityEngine.AnimationModule">
<Private>False</Private>
<HintPath>..\..\..\..\..\..\..\Games\Steam\steamapps\common\Kerbal Space Program\KSP_x64_Data\Managed\UnityEngine.AnimationModule.dll</HintPath>
</Reference>
</ItemGroup>
<ItemGroup>
@ -55,6 +58,7 @@
<Compile Include="MaterialModifiers\MaterialModifierParser.cs" />
<Compile Include="MaterialModifiers\TexturePropertyMaterialModifier.cs" />
<Compile Include="ModuleRestockLaunchClamp.cs" />
<Compile Include="ModuleRestockLinkedColorChanger.cs" />
<Compile Include="ModuleRestockLinkedMesh.cs" />
<Compile Include="ModuleRestockDepthMask.cs" />
<Compile Include="ModuleRestockHeatEffects.cs" />
@ -66,8 +70,12 @@
<Compile Include="Properties\AssemblyInfo.cs" />
<Compile Include="ResourceBlacklist.cs" />
</ItemGroup>
<ItemGroup>
<WCFMetadata Include="Connected Services\" />
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<PropertyGroup>
<PostBuildEvent>sh -e -c "cp -v '$(TargetPath)' '$(SolutionDir)/../Distribution/Restock/GameData/ReStock/Plugins'"</PostBuildEvent>
<PostBuildEvent>
</PostBuildEvent>
</PropertyGroup>
</Project>