fix probe launcher materials

This commit is contained in:
Mister_Nebula 2021-07-29 23:45:33 +01:00
parent a641cfa2b6
commit 12dcad43e4

View File

@ -304,18 +304,24 @@ namespace QSB.Tools
Object.Destroy(REMOTE_ProbeLauncher.GetComponent<ProbePromptController>());
Object.Destroy(REMOTE_ProbeLauncher.GetComponent<PlayerProbeLauncher>());
Object.Destroy(REMOTE_ProbeLauncher.transform.Find("preLaunchCamera"));
Object.Destroy(REMOTE_ProbeLauncher.transform.Find("Props_HEA_ProbeLauncher_ProbeCamera")); // the correctly placed one...
Object.Destroy(REMOTE_ProbeLauncher.transform.Find("preLaunchCamera").gameObject);
Object.Destroy(REMOTE_ProbeLauncher.transform.Find("Props_HEA_ProbeLauncher_ProbeCamera").gameObject); // the correctly placed one...
var prop = REMOTE_ProbeLauncher.transform.Find("Props_HEA_ProbeLauncher");
var recallEffect = prop.Find("RecallEffect");
//Object.Destroy(prop.Find("PressureGauge_Arrow"));
//Object.Destroy(prop.Find("ProbeLauncherChassis"));
Object.Destroy(prop.Find("Props_HEA_ProbeLauncher_Prepass"));
prop.Find("PressureGauge_Arrow").GetComponent<MeshRenderer>().material = Props_HEA_PlayerTool_mat;
prop.Find("ProbeLauncherChassis").GetComponent<MeshRenderer>().material = Props_HEA_PlayerTool_mat;
Object.Destroy(prop.Find("Props_HEA_ProbeLauncher_Prepass").gameObject);
var preLaunchProbe = prop.Find("Props_HEA_Probe_Prelaunch");
Object.Destroy(preLaunchProbe.Find("Props_HEA_Probe_Prelaunch_Prepass"));
Object.Destroy(preLaunchProbe.Find("Props_HEA_Probe_Prelaunch_Prepass").gameObject);
// fuck you unity
var materials = preLaunchProbe.GetComponent<MeshRenderer>().materials;
materials[0] = Props_HEA_PlayerTool_mat;
materials[1] = Props_HEA_Lightbulb_OFF_mat;
preLaunchProbe.GetComponent<MeshRenderer>().materials = materials;
var tool = REMOTE_ProbeLauncher.AddComponent<QSBProbeLauncherTool>();
var spring = new DampedSpringQuat
@ -328,6 +334,7 @@ namespace QSB.Tools
mass = 1
}
};
tool.MoveSpring = spring;
tool.StowTransform = _toolStowTransform;
tool.HoldTransform = _toolHoldTransform;
@ -341,43 +348,6 @@ namespace QSB.Tools
REMOTE_ProbeLauncher.transform.parent = cameraBody;
REMOTE_ProbeLauncher.transform.localPosition = ProbeLauncherOffset;
REMOTE_ProbeLauncher.SetActive(true);
/*
var launcherRoot = new GameObject("REMOTE_ProbeLauncher");
var modelOrig = GameObject.Find("PlayerCamera/ProbeLauncher/Props_HEA_ProbeLauncher");
var model = Object.Instantiate(modelOrig);
model.transform.parent = launcherRoot.transform;
Object.Destroy(model.transform.Find("Props_HEA_ProbeLauncher_Prepass").gameObject);
Object.Destroy(model.transform.Find("Props_HEA_Probe_Prelaunch").Find("Props_HEA_Probe_Prelaunch_Prepass").gameObject);
var tool = launcherRoot.AddComponent<QSBProbeLauncherTool>();
var spring = new DampedSpringQuat
{
velocity = Vector4.zero,
settings = new DampedSpringSettings
{
springConstant = 50f,
dampingCoefficient = 8.485282f,
mass = 1
}
};
tool.MoveSpring = spring;
tool.StowTransform = _toolStowTransform;
tool.HoldTransform = _toolHoldTransform;
tool.ArrivalDegrees = 5f;
tool.Type = ToolType.ProbeLauncher;
tool.ToolGameObject = model;
GetRenderer(launcherRoot, "Props_HEA_Probe_Prelaunch").materials[0] = Props_HEA_PlayerTool_mat;
GetRenderer(launcherRoot, "Props_HEA_Probe_Prelaunch").materials[1] = Props_HEA_Lightbulb_mat;
GetRenderer(launcherRoot, "PressureGauge_Arrow").material = Props_HEA_PlayerTool_mat;
GetRenderer(launcherRoot, "ProbeLauncherChassis").material = Props_HEA_PlayerTool_mat;
launcherRoot.transform.parent = cameraBody;
launcherRoot.transform.localPosition = ProbeLauncherOffset;
launcherRoot.SetActive(true);
*/
}
private static MeshRenderer GetRenderer(GameObject root, string gameObjectName) =>