/// <summary> /// 調べる時のアイコン /// </summary> public void ShowIcon() { if (isPossible) { ExamineIconManager.ShowIcon(ExamineIconManager.IconType.Check); } }
/// <summary> /// 右クリックで掴むアイコンを表示 /// </summary> public void GetIconSprite() { if (isPossible) { ExamineIconManager.ShowIcon(ExamineIconManager.IconType.Hold); } }
/// <summary> /// アイコンを表示 /// </summary> public void GetIconSprite() { if (isPossible) { ExamineIconManager.ShowIcon(ExamineIconManager.IconType.GotoNextStage); } }
private void ToGo() { isPause = true; Pauser.Pause(); Vector3 targetEulerAngles = new Vector3(90.0f, 0.0f, 0.0f); if (tabletMoveState == TabletMoveState.before && Application.loadedLevelName != Scenes.EndScene.name) { tabletPC = Instantiate(tabletPCPrefab, tabletTransform.position, tabletTransform.rotation) as GameObject; tabletPC.transform.parent = tabletTransform; StartCoroutine(TabletMovement(tabletPCAxis, targetEulerAngles, true)); player.ShowMiniMap(false); ExamineIconManager.SetVisible(false); } if (tabletMoveState == TabletMoveState.after) { pauseState = PauseState.Run; tabletMoveState = TabletMoveState.before; Cursor.visible = true; Cursor.lockState = CursorLockMode.None; } }
/// <summary> /// Eキーで調べるアイコンを表示 /// </summary> public void GetIconSprite() { // 取得不可能、もしくは取得済みならreturn if (!_isAcquisition || !IsShow) { return; } if (item == Items.CardKey) { ExamineIconManager.ShowIcon(ExamineIconManager.IconType.TakeCardKey); } else { ExamineIconManager.ShowIcon(ExamineIconManager.IconType.Check); } }
/// <summary> /// メッセージ表示開始 /// </summary> private void CallMessage() { if (isCall) { return; } if (isPossible) { if (messageIndex != -1) { isCall = true; AdvancedWriteMessageSingleton.instance.Write(messageIndex); ExamineIconManager.HideIcon(); } } }
void OnTriggerStay(Collider other) { if (grabbedObject != null) { return; } // hitListに何か含まれていればreturn。(拾えるもの優先) foreach (GraspItem listItem in hitList) { ColorObjectBase colorObject = listItem.GetComponent <ColorObjectBase>(); if (colorObject != null) { if (!colorObject.isDisappearance) { return; } } else { return; } } // 目の前の物を調べる // 調べられるもの全てを配列として取得 Component[] checkComponents = other.GetComponents(typeof(ICheckEvent)); if (checkComponents == null) { return; } ExamineIconManager.HideIcon(); if ((Input.GetKeyDown(KeyCode.E) || Input.GetMouseButtonDown(1)) && !player.isIrradiation) { foreach (ICheckEvent component in checkComponents) { component.Check(); } } }
private void ToBack() { if (menu != null) { Destroy(menu.gameObject); } if (tabletScreen && tabletScreen.GetComponent <MeshRenderer>().material.color != EndScreenColor) { tabletScreen.GetComponent <MeshRenderer>().material.color = EndScreenColor; } Vector3 targetEulerAngles = new Vector3(360.0f, 0.0f, 0.0f); if (tabletPCAxis.localEulerAngles.x != 0 && tabletMoveState == TabletMoveState.before) { StartCoroutine(TabletMovement(tabletPCAxis, targetEulerAngles)); } if (tabletMoveState == TabletMoveState.after) { if (tabletPCAxis.localEulerAngles != targetEulerAngles) { tabletPCAxis.localEulerAngles = targetEulerAngles; } if (tabletPC != null) { Destroy(tabletPC); } pauseState = PauseState.None; tabletMoveState = TabletMoveState.before; Cursor.lockState = CursorLockMode.Locked; Cursor.visible = false; Pauser.Resume(); isPause = false; player.ShowMiniMap(true); ExamineIconManager.SetVisible(true); } }
protected override void Update() { base.Update(); if (AdvancedWriteMessageSingleton.instance.isWrite) { return; } Collider[] colliders = Physics.OverlapSphere(transform.position, radius); float minDistance = Mathf.Infinity; Component[] iconOwnerCheckComponents = null; bool isGrabbed = false; foreach (Collider hitCollider in colliders) { float distance = (hitCollider.transform.position - transform.position).sqrMagnitude; Component[] checkComponents = hitCollider.gameObject.GetComponents(typeof(ICheckEvent)); if (distance < minDistance && checkComponents.Length != 0) { if (hitCollider.GetComponent <GraspItem>() != null && !hitCollider.GetComponent <GraspItem>().enabled) { continue; } if (isGrabbed) { if (hitCollider.GetComponent <GraspItem>() != null) { minDistance = distance; iconOwnerCheckComponents = checkComponents; } } else { if (hitCollider.GetComponent <GraspItem>() != null) { isGrabbed = true; } minDistance = distance; iconOwnerCheckComponents = checkComponents; } } } if (iconOwnerCheckComponents != null && iconOwnerCheckComponents.Length != 0) { if (grabbedObject == null) { foreach (ICheckEvent checkEvent in iconOwnerCheckComponents) { checkEvent.ShowIcon(); } if ((Input.GetKeyDown(KeyCode.E) || Input.GetMouseButtonDown(1)) && !player.isIrradiation) { foreach (ICheckEvent component in iconOwnerCheckComponents) { component.Check(); } } } else { ExamineIconManager.HideIcon(); } } else { ExamineIconManager.HideIcon(); } if (hitList.Count != 0) { if (Input.GetMouseButtonDown(1) && !Input.GetMouseButton(0)) { minDistance = Mathf.Infinity; GraspItem grabItem = null; foreach (GraspItem item in hitList) { float distance = (item.transform.position - transform.position).magnitude; if (minDistance > distance && !item.collider.isTrigger) { grabItem = item.GetComponent <GraspItem>(); minDistance = distance; } } if (grabItem != null) { grabItem.Grab(transform.parent.gameObject); grabbedObject = grabItem; grabbedObject.transform.parent = transform.parent.parent; } } } if (grabbedObject != null) { bool isLetGo = false; // 持ってるものを離す if ((transform.position - grabbedObject.transform.position).sqrMagnitude > grabbedLimitLeaving) { isLetGo = true; } else { grabbedObject.rigidbody.velocity = (transform.position - grabbedObject.transform.position) * grabbedMoveSpeed; } if (Input.GetMouseButtonUp(1)) { isLetGo = true; } else if (grabbedObject.GetComponent <ColorObjectBase>() != null && grabbedObject.GetComponent <ColorObjectBase>().isDisappearance) { isLetGo = true; } if (isLetGo) { LetGo(); } } }
protected override void Update() { base.Update(); if (AdvancedWriteMessageSingleton.instance.isWrite) { return; } Collider[] colliders = Physics.OverlapSphere(transform.position, radius); float minDistance = Mathf.Infinity; Component[] iconOwnerCheckComponents = null; bool isGrabbed = false; foreach (Collider hitCollider in colliders) { float distance = (hitCollider.transform.position - transform.position).sqrMagnitude; Component[] checkComponents = hitCollider.gameObject.GetComponents(typeof(ICheckEvent)); if (distance < minDistance && checkComponents.Length != 0) { if (hitCollider.GetComponent <GraspItem>() != null && !hitCollider.GetComponent <GraspItem>().enabled) { continue; } if (isGrabbed) { if (hitCollider.GetComponent <GraspItem>() != null) { minDistance = distance; iconOwnerCheckComponents = checkComponents; } } else { if (hitCollider.GetComponent <GraspItem>() != null) { isGrabbed = true; } minDistance = distance; iconOwnerCheckComponents = checkComponents; } } } // 調べられるものがあるとき if (iconOwnerCheckComponents != null && iconOwnerCheckComponents.Length != 0) { if (grabbedObject == null) { foreach (ICheckEvent checkEvent in iconOwnerCheckComponents) { checkEvent.GetIconSprite(); } // 調べるコマンドが実行されたとき if ((Input.GetKeyDown(KeyCode.E) || Input.GetMouseButtonDown(1)) && !player.isIrradiation) { // 調べられるものなら調べる foreach (ICheckEvent component in iconOwnerCheckComponents) { component.Check(); } } } else { // 掴んでいるときは調べられない ExamineIconManager.HideIcon(); } } else { ExamineIconManager.HideIcon(); } InputGrasp(); InputLetGo(); }