Exemple #1
0
        private IEnumerator DisplayDrag(PointerFtueMove moveData)
        {
            int     stepI  = currentStepIndex;
            Vector3 pnjPos = Camera.main.WorldToScreenPoint(PlayerManager.Instance.GetNearestNPC().position);

            dragTarget.position = pnjPos;
            UIObjectPointer arrow = ArrowDisplayer.Instances("FtueTap").UseArrow <UIObjectPointer>(100f, -currentStep.pointRotation, false, clickTarget.transform as RectTransform, "FtueTap", false);

            arrow.SetAnimProperties(0f, 0f);
            float x = 0f;
            float t = 0f;

            while (currentStepIndex == stepI)
            {
                t = Mathf.Clamp(t + (Time.deltaTime * (1f / 1.2f)), 0f, 1f);
                x = Easing.CrossFade(Easing.SmoothStart, 3, Easing.SmoothStop, 3, t);
                clickTarget.transform.position = Vector3.Lerp(moveData.startTrf.position, dragTarget.position, x);
                if (t >= 1f)
                {
                    t = 0f;
                }
                yield return(null);
            }
            ArrowDisplayer.Instances("FtueTap").DestroyArrow(arrow);
        }
Exemple #2
0
 public T UseArrow <T>(float pDistance, float pAngle, bool autoRot, Transform uiTransform, string displayerName, bool autoDestroy = true) where T : UIObjectPointer
 {
     if (_container == null)
     {
         return(null);
     }
     if (_modelSimple == null)
     {
         return(null);
     }
     else
     {
         UIObjectPointer newPointer = GameObject.Instantiate <UIObjectPointer>(_modelSimple, _container);
         if (newPointer.gameObject.activeSelf)
         {
             newPointer.gameObject.SetActive(false);
         }
         newPointer.SetProperties(pDistance, pAngle, autoRot, uiTransform, displayerName, autoDestroy);
         newPointer.gameObject.SetActive(true);
         _arrows.Add(newPointer);
         return(newPointer as T);
     }
 }
Exemple #3
0
 public void SetModels(UIObjectPointer simpleModel, UIObjectPointIcon iconModel)
 {
     _modelSimple = simpleModel;
     _modelIcon   = iconModel;
 }
Exemple #4
0
 public void DestroyArrow(UIObjectPointer arrow)
 {
     GameObject.Destroy(arrow.gameObject);
     _arrows.Remove(arrow);
 }
 public void SetParent(UIObjectPointer pParent)
 {
     parent = pParent;
 }