private void UpdateShipHud(On.Hud.orig_UpdateShipHud orig, Hud self, Player player, float dt) { MoveableBaseRoot controlledMoveableBaseRoot = player.GetControlledShip() as MoveableBaseRoot; if (controlledMoveableBaseRoot) { Ship.Speed speedSetting = controlledMoveableBaseRoot.GetSpeedSetting(); self.m_shipHudRoot.SetActive(value: true); self.m_rudderSlow.SetActive(speedSetting == Ship.Speed.Slow); self.m_rudderForward.SetActive(speedSetting == Ship.Speed.Half); self.m_rudderFastForward.SetActive(speedSetting == Ship.Speed.Full); self.m_rudderBackward.SetActive(speedSetting == Ship.Speed.Back); self.m_rudderLeft.SetActive(value: false); self.m_rudderRight.SetActive(value: false); self.m_fullSail.SetActive(false); self.m_halfSail.SetActive(false); self.m_shipWindIconRoot.gameObject.SetActive(false); self.m_shipWindIndicatorRoot.gameObject.SetActive(false); GameObject rudder2 = self.m_rudder; rudder2.SetActive(false); self.m_shipRudderIndicator.gameObject.SetActive(value: false); Camera mainCamera = Utils.GetMainCamera(); if (!(mainCamera == null)) { self.m_shipControlsRoot.transform.position = mainCamera.WorldToScreenPoint(controlledMoveableBaseRoot.m_controlGuiPos.position); } return; } orig(self, player, dt); }
internal void SetMoveableBaseRoot(MoveableBaseRoot moveableBaseRoot) { if (!moveableBaseRoot) { return; } m_follower = true; m_baseRoot = moveableBaseRoot; m_baseRootObject = moveableBaseRoot.gameObject; }
public void Awake() { m_nview = GetComponent <ZNetView>(); m_pulley = GetComponent <Pulley>(); #if DEBUG Jotunn.Logger.LogInfo(m_nview.m_zdo.m_uid + " Creating MoveableBaseRoot"); #endif m_baseControllerObject = Object.Instantiate(PrefabManager.Instance.GetPrefab(PulleyManager.MoveableBaseRootName), transform.position, transform.rotation); m_baseRoot = m_baseControllerObject.GetComponent <MoveableBaseRoot>(); m_baseRoot.SetBaseSync(this); }
private void Player_SetShipControl(On.Player.orig_SetShipControl orig, Player self, ref Vector3 moveDir) { MoveableBaseRoot moveableBaseRoot = self.GetControlledShip() as MoveableBaseRoot; if (moveableBaseRoot) { moveableBaseRoot.ApplyMovementControlls(moveDir); return; } orig(self, ref moveDir); }
public new void Awake() { m_nview = GetComponentInParent <ZNetView>(); m_nview.Register <ZDOID>("RequestControl", RPC_RequestControl); m_nview.Register <ZDOID>("ReleaseControl", RPC_ReleaseControl); m_nview.Register <bool>("RequestRespons", RPC_RequestRespons); m_pulley = GetComponentInParent <Pulley>(); m_baseRoot = GetComponentInParent <MoveableBaseRoot>(); m_ship = m_baseRoot; m_handAttach = m_pulley.transform.Find("New/crank/handattach").transform; m_attachPoint = m_pulley.transform.Find("attachpoint"); }
public static void PlacedPiece(GameObject gameObject) { if (gameObject.TryGetComponent(out Piece piece)) { if (m_lastRayPiece) { MoveableBaseRoot moveableBaseRoot = m_lastRayPiece.GetComponentInParent <MoveableBaseRoot>(); if (moveableBaseRoot) { moveableBaseRoot.m_baseSync.AddNewPiece(piece); } } } }
internal void SetMoveableBase(MoveableBaseRoot baseRoot) { m_ship = baseRoot; m_baseRoot = baseRoot; }
internal void SetMoveableBase(MoveableBaseRoot m_baseRoot) { m_pulleyControlls.SetMoveableBase(m_baseRoot); }