private static int GetBaseFrameTime(TimeSpan averageFrameTime, SlotType slotType) { // no frame time based on the current PPD calculation selection ('LastFrame', 'LastThreeFrames', etc) // this section attempts to give DetermineStats values to detect Hung clients before they have a valid // frame time - Issue 10 // get the average frame time for this client and project id if (averageFrameTime > TimeSpan.Zero) { return(Convert.ToInt32(averageFrameTime.TotalSeconds)); } // no benchmarked average frame time, use some arbitrary (and large) values for the frame time // we want to give the client plenty of time to show progress but don't want it to sit idle for days else { // CPU: use 1 hour (3600 seconds) as a base frame time int baseFrameTime = 3600; if (slotType.Equals(SlotType.GPU)) { // GPU: use 10 minutes (600 seconds) as a base frame time baseFrameTime = 600; } return(baseFrameTime); } }
public void OnPointerClick(PointerEventData eventData) { if (slotInWhat.Equals(SlotType.QuickInventory)) { inventoryPanelParent.SelectionFrame.anchoredPosition = GetComponent <RectTransform>().anchoredPosition; inventoryPanelParent.SelectedSlotIndex = this.slotIndex; inventoryPanelParent.theCharacter.selectedInventoryIndex = this.slotIndex; // gameUIScript.SelectedSlotIndex = slotIndex; } }
private void Update() { if (!isEnabled) { return; } if (item_quantity.text.Equals("0") || quantity <= 0) { Clear(); return; } if (Input.touchCount == 0 || (Input.touchCount > 1 && Input.GetTouch(1).phase.Equals(TouchPhase.Ended))) { if (isMoving) { isMoving = false; isBeingHeld = false; SummonItem(slot_item); AudioManager.GetInstance().Play("sfx-drop"); rect.anchoredPosition = startPoint; if (item_quantity.text.Equals("0")) { isMoving = false; Clear(); InventoryController.GetInventoryController().UpdateUI(); return; } } isMoving = false; return; } Vector3 position; position = Input.touchCount == 2 ? Input.GetTouch(1).position : Input.GetTouch(0).position; //position = Camera.main.ScreenToWorldPoint(position); if (interactible_box.OverlapPoint(position) || isMoving) { if (!isBeingHeld) { AudioManager.GetInstance().Play("sfx-drag"); isBeingHeld = true; HeldType = slotType; } if (!HeldType.Equals(slotType)) { return; } isMoving = true; Vector3 Position = new Vector3(position.x, position.y, 0); rect.position = Position; } }
private static int GetBaseFrameTime(TimeSpan averageFrameTime, SlotType slotType) { // no frame time based on the current PPD calculation selection ('LastFrame', 'LastThreeFrames', etc) // this section attempts to give DetermineStats values to detect Hung clients before they have a valid // frame time - Issue 10 // get the average frame time for this client and project id if (averageFrameTime > TimeSpan.Zero) { return Convert.ToInt32(averageFrameTime.TotalSeconds); } // no benchmarked average frame time, use some arbitrary (and large) values for the frame time // we want to give the client plenty of time to show progress but don't want it to sit idle for days else { // CPU: use 1 hour (3600 seconds) as a base frame time int baseFrameTime = 3600; if (slotType.Equals(SlotType.GPU)) { // GPU: use 10 minutes (600 seconds) as a base frame time baseFrameTime = 600; } return baseFrameTime; } }