void Update() { if (m_Player == null) { m_Player = FindObjectOfType<PlayerController>(); } if (m_Player == null) return; float vDis = Vector2.Distance(m_Player.transform.position, transform.position); if (vDis < 0.3f) { if (fieldUI == null) { fieldUI = UIManager.Instance().GetFieldUI() as FieldUI_Control; if (fieldUI == null) return; } if (m_Player.PhyCtrl.IsMoving) return; #if UNITY_EDITOR if (Input.GetMouseButtonUp(0)) { fieldUI.StartConver(m_iConverTextNo); } #else if (Input.touchCount > 0) { fieldUI.StartConver(m_iConverTextNo); } #endif } }
public void InitConver(int iNPCNo, FieldUI_Control.CallBackConverEnd Call) { if (m_bConverIng) return; m_ListConver.Clear(); string st = TBManager.Instance().GetConverText(iNPCNo); string [] stText = st.Split('_'); if (stText == null) return; m_LabelName.text = stText[0]; m_ListConver.AddRange(stText); CallBack = Call; ConverText(); TweenScale ts = GetComponent<TweenScale>(); if (ts != null) { ts.ResetToBeginning(); ts.from = new Vector3(0.1f, 0.1f, 0.1f); ts.to = Vector3.one; ts.duration = 0.1f; ts.PlayForward(); m_bTweenScaleEvent = true; } }
void Start() { m_Player = FindObjectOfType<PlayerController>(); fieldUI = UIManager.Instance().GetFieldUI() as FieldUI_Control; }