private void Awake() { seamoth = GetComponent <SeaMoth>(); objectHelper = ArmServices.main.objectHelper; vfxConstructing = GetComponent <VFXConstructing>(); light_left = objectHelper.FindDeepChild(gameObject, "light_left").transform; light_left_default = new PureTransform(light_left.localPosition, light_left.localRotation, light_left.localScale); light_left_UP = new PureTransform(new Vector3(0f, 0.68f, 1f), Quaternion.Euler(0, 0, 0), light_left.localScale); light_right = objectHelper.FindDeepChild(gameObject, "light_right").transform; light_right_default = new PureTransform(light_right.localPosition, light_right.localRotation, light_right.localScale); light_right_DOWN = new PureTransform(new Vector3(0f, -1.21f, 1.04f), Quaternion.Euler(35, 0, 0), light_left.localScale); GameObject leftArmAttachPoint = objectHelper.CreateGameObject("leftArmAttachPoint", seamoth.torpedoTubeLeft, new Vector3(-0.93f, 0f, -0.74f), new Vector3(346, 23, 0)); leftArmAttach = leftArmAttachPoint.transform; GameObject rightArmAttachPoint = objectHelper.CreateGameObject("rightArmAttachPoint", seamoth.torpedoTubeRight, new Vector3(0.93f, 0f, -0.74f), new Vector3(346, 337, 360)); rightArmAttach = rightArmAttachPoint.transform; GameObject leftAimForward = objectHelper.CreateGameObject("leftAimForward", seamoth.transform); aimTargetLeft = leftAimForward.transform; GameObject rightAimForward = objectHelper.CreateGameObject("rightAimForward", seamoth.transform); aimTargetRight = rightAimForward.transform; }
public static void Prefix(VFXConstructing __instance) { if (CraftData.GetTechType(__instance.gameObject) != MainPatch.sharkTech) { return; } __instance.wireColor = col; }
public static void Postfix(VFXConstructing __instance) { if (CraftData.GetTechType(__instance.gameObject) != MainPatch.sharkTech) { return; } __instance.ghostMaterial = new Material(__instance.ghostMaterial); __instance.ghostOverlay.material = __instance.ghostMaterial; __instance.ghostMaterial.color = col; }
private void Awake() { helper = SeatruckServices.Main.GetSeaTruckHelper(gameObject); objectHelper = Main.graphics.objectHelper; vfxConstructing = GetComponent <VFXConstructing>(); leftArmAttachPoint = objectHelper.CreateGameObject("leftArmAttachPoint", transform, new Vector3(-1.06f, -0.52f, 1.82f), new Vector3(350, 7, 0)); leftArmAttach = leftArmAttachPoint.transform; GameObject armSocketLeft = Instantiate(Main.graphics.ArmSocket, leftArmAttach); armSocketLeft.SetActive(true); armSocketLeft.name = "armSocketLeft"; ColorizationHelper.AddRendererToColorCustomizer(gameObject, armSocketLeft, false, new int[] { 0 }); ColorizationHelper.AddRendererToSkyApplier(gameObject, armSocketLeft, Skies.Auto); LeftSocketMat = armSocketLeft.GetComponent <Renderer>().material; rightArmAttachPoint = objectHelper.CreateGameObject("rightArmAttachPoint", transform, new Vector3(1.06f, -0.52f, 1.82f), new Vector3(350, 353, 0)); rightArmAttach = rightArmAttachPoint.transform; objectHelper.GetPrefabClone(ref armSocketLeft, rightArmAttach, true, "armSocketRight", out GameObject armSocketRight); ColorizationHelper.AddRendererToColorCustomizer(gameObject, armSocketRight, false, new int[] { 0 }); ColorizationHelper.AddRendererToSkyApplier(gameObject, armSocketRight, Skies.Auto); armSocketLeft.transform.localPosition = new Vector3(0f, 0.01f, -0.01f); armSocketLeft.transform.localScale = new Vector3(1.17f, 1.50f, 1.50f); armSocketLeft.transform.localRotation = Quaternion.Euler(90, 0, 0); RightSocketMat = armSocketRight.GetComponent <Renderer>().material; armSocketRight.transform.localPosition = new Vector3(0f, 0.01f, -0.01f); armSocketRight.transform.localScale = new Vector3(-1.17f, 1.50f, 1.50f); armSocketRight.transform.localRotation = Quaternion.Euler(90, 0, 0); GameObject leftAimForward = objectHelper.CreateGameObject("leftAimForward", transform); aimTargetLeft = leftAimForward.transform; GameObject rightAimForward = objectHelper.CreateGameObject("rightAimForward", transform); aimTargetRight = rightAimForward.transform; }
private void Awake() { seamoth = GetComponent <SeaMoth>(); vfxConstructing = GetComponent <VFXConstructing>(); light_left = gameObject.FindChildInMaxDepth("light_left").transform; light_left_default = new PureTransform(light_left.localPosition, light_left.localRotation, light_left.localScale); light_left_UP = new PureTransform(new Vector3(0f, 0.68f, 1f), Quaternion.Euler(0, 0, 0), light_left.localScale); light_right = gameObject.FindChildInMaxDepth("light_right").transform; light_right_default = new PureTransform(light_right.localPosition, light_right.localRotation, light_right.localScale); light_right_DOWN = new PureTransform(new Vector3(0f, -1.21f, 1.04f), Quaternion.Euler(35, 0, 0), light_left.localScale); SeamothArmPrefabs = CreateGameObject("SeamothArmPrefabs", gameObject.transform); SeamothArmPrefabs.SetActive(false); InitializeArmsCache(); GameObject leftArmAttachPoint = CreateGameObject("leftArmAttachPoint", seamoth.torpedoTubeLeft, new Vector3(-0.93f, 0f, -0.74f), new Vector3(346, 23, 0)); leftArmAttach = leftArmAttachPoint.transform; GameObject rightArmAttachPoint = CreateGameObject("rightArmAttachPoint", seamoth.torpedoTubeRight, new Vector3(0.93f, 0f, -0.74f), new Vector3(346, 337, 360)); rightArmAttach = rightArmAttachPoint.transform; GameObject leftAimForward = CreateGameObject("leftAimForward", seamoth.transform); aimTargetLeft = leftAimForward.transform; GameObject rightAimForward = CreateGameObject("rightAimForward", seamoth.transform); aimTargetRight = rightAimForward.transform; UpdateArmRenderers(); }