public void HoverDrillable() { SeamothArmManager control = Player.main.GetComponentInParent <SeamothArmManager>(); if (control && control.HasDrill()) { HandReticle.main.SetInteractText(Language.main.GetFormat("DrillResource", Language.main.Get(drillable.primaryTooltip)), drillable.secondaryTooltip, false, true, HandReticle.Hand.Left); HandReticle.main.SetIcon(HandReticle.IconType.Drill, 1f); } else { HandReticle.main.SetInteractText(drillable.primaryTooltip, "NeedExoToMine"); } }
public void ManagedUpdate() { if (timeLastDrilled + 0.5f > Time.time) { drillable.modelRoot.transform.position = transform.position + new Vector3(Mathf.Sin(Time.time * 60f), Mathf.Cos(Time.time * 58f + 0.5f), Mathf.Cos(Time.time * 64f + 2f)) * 0.011f; } if (lootPinataObjects.Count > 0 && drillingMoth) { List <GameObject> list = new List <GameObject>(); foreach (GameObject gameObject in lootPinataObjects) { if (gameObject == null) { list.Add(gameObject); } else { Vector3 b = drillingMoth.transform.position + new Vector3(0f, 0.8f, 0f); gameObject.transform.position = Vector3.Lerp(gameObject.transform.position, b, Time.deltaTime * 5f); float num = Vector3.Distance(gameObject.transform.position, b); if (num < 3f) { Pickupable pickupable = gameObject.GetComponentInChildren <Pickupable>(); if (pickupable) { SeamothArmManager control = drillingMoth.GetComponent <SeamothArmManager>(); if (!control.HasRoomForItem(pickupable)) { if (Player.main.GetVehicle() == drillingMoth) { ErrorMessage.AddMessage(Language.main.Get("ContainerCantFit")); } } else { string arg = Language.main.Get(pickupable.GetTechName()); ErrorMessage.AddMessage(Language.main.GetFormat("VehicleAddedToStorage", arg)); uGUI_IconNotifier.main.Play(pickupable.GetTechType(), uGUI_IconNotifier.AnimationType.From, null); pickupable = pickupable.Initialize(); InventoryItem item = new InventoryItem(pickupable); control.GetRoomForItem(pickupable).UnsafeAdd(item); pickupable.PlayPickupSound(); } list.Add(gameObject); } } } } if (list.Count > 0) { foreach (GameObject item2 in list) { lootPinataObjects.Remove(item2); } } } }