public bool WaitForPickUp() { if (pickedUpItem != null) { if (timeSpan.OnSpanComplete()) { return(true); } } return(false); }
public void UpdatePickUpdObject() { if (_Timer.OnSpanComplete()) { if (pickedUpObj != null) { ray = Camera.main.ScreenPointToRay(Input.mousePosition); if (Physics.Raycast(ray, out shortHit, distence, LayerMask.GetMask(LayerConst.putLayer))) { pickedUpObj.Trans.position = shortHit.point; } else { pickedUpObj.Trans.position = Camera.main.ScreenToWorldPoint(new Vector3(Input.mousePosition.x, Input.mousePosition.y, distence)); } } } pickedUpObj.Trans.rotation = pickedUpObj.Trans.rotation * Quaternion.Euler(Vector3.up * Input.GetAxis("Mouse ScrollWheel") * scrollSpeed); }
void Update() { if (timer.OnSpanComplete() && Camera.main) { ray = Camera.main.ScreenPointToRay(Input.mousePosition); if (Physics.Raycast(ray, out hit, 200, totalmask, QueryTriggerInteraction.Collide)) { currTexture = textureList.Find((x) => x.layerMask == LayerMask.GetMask(LayerMask.LayerToName(hit.collider.gameObject.layer))).texture; if (currTexture != lastTexture) { ChangeToNewTexture(currTexture); lastTexture = currTexture; } } else { lastTexture = null; ChangeToNewTexture(defultTexture); } } }