private void SetClue(ActionRefferer aR) { if (Panel == null) { return; } Panel.SetActive(true); if (aR.ParentActionComponent.IsDefaultState()) { ClueText.text = aR.ParentGameObject.GetComponent <BaseClueTextHoler>().GetDefaultClueText(ActionKey); } else { ClueText.text = aR.ParentGameObject.GetComponent <BaseClueTextHoler>().GetExecutedClueText(ActionKey); } }
private void CastForActionAbleOjects() { RaycastHit sphereHit; Ray ray = Camera.main.ScreenPointToRay( Input.mousePosition); if (Physics.SphereCast(ray, castingRadius, out sphereHit, castingDistance)) { if (sphereHit.transform.gameObject.tag == "ActionAbleObject") { ActionRefferer aR = sphereHit.transform.gameObject.GetComponent <ActionRefferer>(); SetClue(aR); if (Input.GetKeyDown(ActionKey)) { Debug.LogWarning(aR.ParentGameObject.name); CmdInteract(aR.ParentGameObject.name); } } else { HideClue(); } } }