Пример #1
0
    public void CreatePointer(Transform targets, int questNumber)
    {
        Window_QuestPointer.QuestPointer questPointers = windowQuestPointer.CreatePointer(new Vector3(targets.position.x, targets.position.y, targets.position.z));
        FunctionUpdater.Create(() =>
        {
            #region
            float xDistancia = Camera.main.transform.position.x - targets.position.x;
            float yDistancia = Camera.main.transform.position.y - targets.position.y;
            #endregion
            float distancia = Mathf.Sqrt(xDistancia * xDistancia + yDistancia * yDistancia);
            #region

            /*Debug.Log(distancia);
             * Debug.Log(distance);
             * Debug.Log("Cam Distance: " + (distancia < distance));
             * Debug.Log("middleQuest: " + (theQM.middleQuestCompleted[questNumber]));
             * Debug.Log("Quest: " + (theQM.questCompleted[questNumber]));
             * Debug.Log("Everything: " + (Input.GetKeyDown(KeyCode.E) && (distancia < distance)));*/
            #endregion
            if (Input.GetKeyDown(KeyCode.E) && (distancia < distance))
            {
                windowQuestPointer.DestroyPointer(questPointers);
                return(true);
            }
            else
            {
                return(false);
            }
        });
    }
Пример #2
0
 private void Start()
 {
     //创建新的任务箭头图标
     Window_QuestPointer.QuestPointer questPointer_1 = windowQuestPointer.CreatePointer(new Vector3(-101, 60));
     //创建新的委托
     FunctionUpdater.Create(() =>
     {
         //如果到达目标范围40m左右就删除任务图标
         if (Vector3.Distance(Camera.main.transform.position, new Vector3(-101, 60)) < 20f)
         {
             windowQuestPointer.DestroyPointer(questPointer_1);
             return(true);
         }
         else
         {
             return(false);
         }
     });
     //创建新的任务箭头图标
     Window_QuestPointer.QuestPointer questPointer_2 = windowQuestPointer.CreatePointer(new Vector3(57, 55));
     //创建新的委托
     FunctionUpdater.Create(() =>
     {
         //如果到达目标范围40m左右就删除任务图标
         if (Vector3.Distance(Camera.main.transform.position, new Vector3(57, 55)) < 15f)
         {
             windowQuestPointer.DestroyPointer(questPointer_2);
             return(true);
         }
         else
         {
             return(false);
         }
     });
     //创建新的任务箭头图标
     Window_QuestPointer.QuestPointer questPointer_3 = windowQuestPointer.CreatePointer(new Vector3(120, 30));
     //创建新的委托
     FunctionUpdater.Create(() =>
     {
         //如果到达目标范围40m左右就删除任务图标
         if (Vector3.Distance(Camera.main.transform.position, new Vector3(120, 30)) < 20f)
         {
             windowQuestPointer.DestroyPointer(questPointer_3);
             return(true);
         }
         else
         {
             return(false);
         }
     });
 }
Пример #3
0
    private void Start()
    {
        Window_QuestPointer.QuestPointer questPointer_1 = windowQuestPointer.CreatePointer(new Vector3(200, 45), UtilsClass.GetColorFromString("FF0000"), UtilsClass.GetColorFromString("FFFFFF"));
        FunctionUpdater.Create(() => {
            if (Vector3.Distance(Camera.main.transform.position, new Vector3(200, 45)) < 40f)
            {
                windowQuestPointer.DestroyPointer(questPointer_1);
                return(true);
            }
            else
            {
                return(false);
            }
        });

        Window_QuestPointer.QuestPointer questPointer_2 = windowQuestPointer.CreatePointer(new Vector3(190, -32), UtilsClass.GetColorFromString("00FF00"), UtilsClass.GetColorFromString("00FF00"), customArrowSprite, customCrossSprite);
        FunctionUpdater.Create(() => {
            if (Vector3.Distance(Camera.main.transform.position, new Vector3(190, -32)) < 40f)
            {
                windowQuestPointer.DestroyPointer(questPointer_2);
                return(true);
            }
            else
            {
                return(false);
            }
        });

        Window_QuestPointer.QuestPointer questPointer_3 = windowQuestPointer.CreatePointer(new Vector3(-70, 200), UtilsClass.GetColorFromString("FFFFFF"), UtilsClass.GetColorFromString("FFFF00"), customArrowSprite, exclamationPointSprite);
        FunctionUpdater.Create(() => {
            if (Vector3.Distance(Camera.main.transform.position, new Vector3(-70, 200)) < 40f)
            {
                windowQuestPointer.DestroyPointer(questPointer_3);
                return(true);
            }
            else
            {
                return(false);
            }
        });
    }