public void SetState(StateOfUIInterAction SUII, InterActionUI _InterActionUI) { if (_InterActionUI == null) { transform.position = Vector3.zero; _ItselfSR.enabled = false; _InteractionUIText.text = ""; ListenEvent = false; return; } transform.position = _InterActionUI.gameObject.transform.position; if (SUII == StateOfUIInterAction.Opened) { _ItselfSR.sprite = _InterActionUI.GetInterActionUISprite(); _InteractionUIText.text = _InterActionUI.info; _ItselfSR.enabled = true; ListenEvent = true; _Active = _InterActionUI; } else if (SUII == StateOfUIInterAction.Closed) { _ItselfSR.enabled = false; _InteractionUIText.text = ""; _InterActionUI = null; ListenEvent = false; _Active = null; } }
// Use this for initialization void Awake() { _ItselfSR = GetComponent <SpriteRenderer>(); _InteractionUIText = GameObject.Find("InteractionUIText").GetComponent <Text>(); _Active = null; _ControlMeta = Camera.main.GetComponent <ControlMeta>(); }