Example #1
0
 public T UseArrow <T>(float pDistance, float pAngle, bool autoRot, Transform uiTransform, Sprite pSprite, string displayerName, bool autoDestroy = true) where T : UIObjectPointIcon
 {
     if (_container == null)
     {
         return(null);
     }
     if (_modelIcon == null)
     {
         return(null);
     }
     else
     {
         UIObjectPointIcon newPointer = GameObject.Instantiate <UIObjectPointIcon>(_modelIcon, _container);
         if (newPointer.gameObject.activeSelf)
         {
             newPointer.gameObject.SetActive(false);
         }
         newPointer.SetProperties(pDistance, pAngle, autoRot, uiTransform, pSprite, displayerName, autoDestroy);
         newPointer.gameObject.SetActive(true);
         _arrows.Add(newPointer);
         return(newPointer as T);
     }
 }
Example #2
0
 public void SetModels(UIObjectPointer simpleModel, UIObjectPointIcon iconModel)
 {
     _modelSimple = simpleModel;
     _modelIcon   = iconModel;
 }
Example #3
0
    public void DisplayQuest()
    {
        ArrowDisplayer.Instances(ArrowDisplayerName).CleanArrows();
        pinchSprite.gameObject.SetActive(false);

        if (_runningQuest == null || _runningQuest.validated)
        {
            return;
        }

        bool hasItem = InventoryPlayer.Instance.ContainItem(_runningQuest.itemType) != null;

        if (_runningQuest.step < 1 && !hasItem)
        {
            int pnjCount = InteractablePNJ.PNJs.Count;
            for (int i = 0; i < pnjCount; i++)
            {
                InteractablePNJ pnj = InteractablePNJ.PNJs[i];
                if (pnj.IDname == _runningQuest.NGOtarget)
                {
                    UIObjectPointIcon pointer = ArrowDisplayer.Instances(ArrowDisplayerName).UseArrow <UIObjectPointIcon>(350f, 0, true, pnj.transform.position, NGOSprite, ArrowDisplayerName, false);
                    if (view == ECameraTargetType.MAP)
                    {
                        ArrowDisplayer.Instances(ArrowDisplayerName).SetActiveArrows(false);
                    }
                }
            }
            return;
        }

        if (hasItem && _runningQuest.step < 1)
        {
            NextQuestStep();
            return;
        }

        if (_runningQuest.step == 1)
        {
            if (!hasItem)
            {
                return;
            }
            if (_runningQuest.selectedActivity != EBudgetType.None)
            {
                NextQuestStep();
                return;
            }
            else
            {
                if (view == ECameraTargetType.ZOOM)
                {
                    pinchSprite.gameObject.SetActive(true);
                    pinchSprite.GetComponent <Animator>().SetBool("pinch", false);
                }
                else
                {
                    pinchSprite.gameObject.SetActive(false);
                }
            }
        }

        if (_runningQuest.step == 2)
        {
            if (!hasItem)
            {
                return;
            }
            CheckStep(_runningQuest);
            if (_runningQuest.validated)
            {
                return;
            }
            if (view == ECameraTargetType.MAP)
            {
                pinchSprite.gameObject.SetActive(true);
                pinchSprite.GetComponent <Animator>().SetBool("pinch", true);
            }
            else
            {
                int pnjCount = InteractablePNJ.PNJs.Count;
                for (int i = 0; i < pnjCount; i++)
                {
                    InteractablePNJ pnj = InteractablePNJ.PNJs[i];
                    if (pnj.budgetComponent.type == _runningQuest.selectedActivity)
                    {
                        UIObjectPointIcon pointer = ArrowDisplayer.Instances(ArrowDisplayerName).UseArrow <UIObjectPointIcon>(350f, 0, true, pnj.transform.position, EntrepreneurSprite, ArrowDisplayerName, false);
                    }
                }
            }
        }
        else
        {
            CheckStep(_runningQuest);
        }
    }