public bool SetHeldItem(RPOSInventoryCell cell) { Vector3 vector3; IInventoryItem inventoryItem; if (!cell) { inventoryItem = null; } else { inventoryItem = cell.slotItem; } if (!this.SetHeldItem(inventoryItem)) { return(false); } try { if (NGUITools.GetCentroid(cell, out vector3)) { Vector2 screenPoint = UICamera.FindCameraForLayer(cell.gameObject.layer).cachedCamera.WorldToScreenPoint(vector3); this.offsetPoint = screenPoint - UICamera.lastMousePosition; } } catch { this.offsetPoint = Vector3.zero; } return(true); }
public bool SetHeldItem(RPOSInventoryCell cell) { if (!this.SetHeldItem((cell == null) ? null : cell.slotItem)) { return(false); } try { Vector3 vector; if (NGUITools.GetCentroid(cell, out vector)) { Vector2 vector2 = UICamera.FindCameraForLayer(cell.gameObject.layer).cachedCamera.WorldToScreenPoint(vector); this.offsetPoint = (Vector3)(vector2 - UICamera.lastMousePosition); } } catch { this.offsetPoint = Vector3.zero; } return(true); }
public void ClearHeldItem(RPOSInventoryCell fadeToCell) { Vector3 vector3; if (this.hasItem) { this.fadingOut = true; this.ClearHeldItem(); try { if (NGUITools.GetCentroid(fadeToCell, out vector3)) { this.FadeOutToPoint(vector3); } return; } catch { } this.Opaque(); } }