public void OnRelease() { if (m_DragLayout != null) { TargetInfo target = CurrentInfo.Targets.Find(e => e.type == eTutorialType.Drag); Vector3 pos = CoreUtility.WorldPositionToUIPosition(UICamera.lastWorldPosition); // Debug.Log(pos); if (DungeonInfoMenu.IsRectContainsPoint(target.pos, target.size, pos) == true) { m_DragLayout.ProcessRelease(); while (m_Prefabs.Count > 0) { Destroy(m_Prefabs[0]); m_Prefabs.RemoveAt(0); } m_DragLayout = null; SetNextTutorial(); } else { m_DragLayout.DragContainer = null; //m_DragLayout.Rebatch(); m_DragLayout.Init(TeamDataManager.Instance.GetTeam(pe_Team.Main)); m_DragLayout.ProcessRelease(); m_DragLayout = null; //TweenPosition tween = m_Prefabs[0].GetComponent<TweenPosition>(); //tween.enabled = false; //Vector3 indicator_pos = m_Prefabs[0].transform.localPosition; //m_Prefabs[0].transform.localPosition = tween.from; } } }
public void OnPress(bool isPressed) { if (CurrentInfo != null) { TargetInfo target = CurrentInfo.Targets.Find(e => e.type == eTutorialType.Drag); if (target != null) { if (string.IsNullOrEmpty(target.gameobject) == false) { GameObject target_obj = GameObject.Find(target.gameobject); if (target_obj != null) { m_DragLayout = target_obj.GetComponentInParent <MainLayout>(); if (m_DragLayout != null) { m_DragLayout.ProcessPress(); if (m_DragLayout.DragContainer == null || m_DragLayout.DragContainer.CharacterAsset.Asset.name != target.gameobject) { m_DragLayout.ProcessRelease(); m_DragLayout = null; } else { //TweenPosition tween = m_Prefabs[0].GetComponent<TweenPosition>(); //Vector3 pos = m_Prefabs[0].transform.localPosition; //tween.from = pos; //pos.x += target.drag_x; //pos.y += target.drag_y; //tween.to = pos; //tween.PlayForward(); } } } } } } }