Beispiel #1
0
    //关闭合成界面
    void CloseRecipe(GameObject go)
    {
        btn_Close.transform.Find("Text").GetComponent <Text>().text = "关闭";
        EventTriggerListener.Get(btn_Close.gameObject).onClick      = CloseRecipeMenu;

        LeanTween.moveY(PropertyListPlane.gameObject, PropertyListPlaneRect.y, 0.5f).setEase(LeanTweenType.easeInBack);
        LeanTween.moveY(recipeSlotsList.gameObject, recipeSlotsListPos.y, 0.5f).setEase(LeanTweenType.easeInBack);
        LeanTween.scale(recipeSlotsList.gameObject, new Vector3(1f, 1f, 1f), 0.5f).setEase(LeanTweenType.easeInBack);

        Color c = recipeSlotsList.GetComponent <Image>().color;

        recipeSlotsList.GetComponent <Image>().color = new Color(c.r, c.g, c.b, 1);

        Color m = ComposeMask.GetComponent <Image>().color;

        ComposeMask.GetComponent <Image>().color = new Color(m.r, m.g, m.b, 0.7f);

        MenuUI.SetActive(true);
        recipeUI.SetActive(false);
        ComposeMask.SetActive(false);
        btn_startRecipe.gameObject.SetActive(true);
        recipeSlotsList.gameObject.SetActive(true);

        ClearRecipeData();

        //触发合成事件
        bool ishit = false;

        ishit = eventmanager.CheckEventList(ChatEventManager.ChatEvent.EventTypeList.ComposeGoods, true) || ishit;
        if (ishit)
        {
            eventmanager.StartStory();
        }
    }
Beispiel #2
0
    //初始化显示地图ui
    void InstMapUI()
    {
        playerInfo = PlayerInfo.GetPlayerInfo();

        mineText.text  = playerInfo.MineCount.ToString();
        moneyText.text = playerInfo.Money.ToString();

        bool ishit = false;

        ishit = eventmanager.CheckUnCompleteEvent() || ishit;
        ishit = eventmanager.CheckEventList(ChatEventManager.ChatEvent.EventTypeList.InMap, false) || ishit;
        ishit = eventmanager.CheckEventList(ChatEventManager.ChatEvent.EventTypeList.Mines, false) || ishit;
        ishit = eventmanager.CheckEventList(ChatEventManager.ChatEvent.EventTypeList.Golds, false) || ishit;
        if (ishit)
        {
            eventmanager.StartStory();
        }
    }
Beispiel #3
0
    // Use this for initialization
    void Start()
    {
        _bagUI = Resources.Load <GameObject>("Prefab/BagUI");
        Money  = transform.Find("/ToolsKit/Canvas/PlayerInfo/glodBoard/Text").GetComponent <Text>();
        Mine   = transform.Find("/ToolsKit/Canvas/PlayerInfo/mineBoard/Text").GetComponent <Text>();

        //获取事件控制器
        eventmanager = transform.Find("/ToolsKit/EventManager").GetComponent <ChatEventManager>();
        questManager = transform.Find("/ToolsKit/QuestManager").GetComponent <QuestManager>();

        UpdateShopGoodsData();
        InitShopGoods();
        UpdateShopMoney();

        EventTriggerListener.Get(GameObject.Find("Canvas/Button (2)")).onClick = OpenSpecialItemBag;
        EventTriggerListener.Get(GameObject.Find("Canvas/Button (3)")).onClick = OpenSpecialItemBagAll;
        EventTriggerListener.Get(GameObject.Find("Canvas/Button (4)")).onClick = PlayerInfo.ClearCompleteEvents;

        //增加进入地图次数
        PlayerInfo.AddSenceInfo(0);

        bool ishit = false;

        ishit = eventmanager.CheckUnCompleteEvent() || ishit;
        ishit = eventmanager.CheckEventList(ChatEventManager.ChatEvent.EventTypeList.InShop, false) || ishit;
        ishit = eventmanager.CheckEventList(ChatEventManager.ChatEvent.EventTypeList.SellGoods, false) || ishit;
        if (ishit)
        {
            eventmanager.StartStory();
        }
        else
        {
            eventmanager.PreCheckEventList(0);
            questManager.PreCheckQuest(0);
            questManager.IsArriveWaitingCheckPoint(0);
        }
    }
Beispiel #4
0
    void MovePath()
    {
        //如果有采集、回家图标,则关闭采集,回家图标
        CloseMineIcon();
        CloseHomeIcon();

        string root     = "/Canvas/Scroll View/Viewport/Content/map/pathList/";
        string pathline = "";

        Transform[] _ts = new Transform[0];

        //如果到达终点则打断
        if (playerPoints.Nowpoint == playerPoints.Targetpoint)
        {
            //增加路点次数信息
            PlayerInfo.AddMapInfo(playerPoints.Nowpoint);
            PlayerInfo.SetNowscene(playerPoints.Nowpoint);

            //检测触发事件
            if (eventmanager.CheckEventList(ChatEventManager.ChatEvent.EventTypeList.Arrive, true))
            {
                eventmanager.StartStory();
            }
            else
            {
                questManager.CheckQuestListWithArrive(playerPoints.Targetpoint);
                questManager.IsArriveWaitingCheckPoint(playerPoints.Targetpoint);
                eventmanager.PreCheckEventList(1);
                questManager.PreCheckQuest(1);
            }

            state = MoveState.Stay;
            AniController.Get(MovePlayer).PlayAniBySkin("down", AniController.AniType.LoopBack, 5);

            //关闭路点提示
            ClosePathPoint();
            CloseMovePathLine();
            movePathLine.Clear();

            if (playerPoints.Targetpoint != 1)
            {
                //显示采集图标
                ShowMineIcon(playerPoints.Targetpoint);
                return;
            }
            else
            {
                ShowHomeBoard(1);
                return;
            }
        }

        //找到移动的路径
        for (int i = 0; i <= Bestpaths.Count - 2; i++)
        {
            //根据方向排序
            if ((int)Bestpaths[i] == playerPoints.Nowpoint)
            {
                if ((int)Bestpaths[i + 1] > (int)Bestpaths[i])
                {
                    pathline = "pathLine_" + Bestpaths[i].ToString() + "_" + Bestpaths[i + 1].ToString();
                    Transform t = transform.Find(root + pathline);
                    if (t != null)
                    {
                        _ts = new Transform[t.childCount];
                        for (int j = 0; j < t.childCount; j++)
                        {
                            _ts[j] = t.GetChild(j);
                        }
                    }
                    else
                    {
                        Debug.Log("can't find pathline:" + root + pathline);
                    }
                }
                else
                {
                    pathline = "pathLine_" + Bestpaths[i + 1].ToString() + "_" + Bestpaths[i].ToString();
                    Transform t = transform.Find(root + pathline);
                    if (t != null)
                    {
                        _ts = new Transform[t.childCount];
                        for (int j = 0; j < t.childCount; j++)
                        {
                            _ts[j] = t.GetChild(t.childCount - 1 - j);
                        }
                    }
                    else
                    {
                        Debug.Log("can't find pathline:" + root + pathline);
                    }
                }
                playerPoints.Nextpoint = (int)Bestpaths[i + 1];
                break;
            }
        }

        //移动方法
        if (_ts.Length != 0)
        {
            playerPoints.Nowpoint = playerPoints.Nextpoint;
            Transform _map = transform.Find("/Canvas/Scroll View/Viewport/Content/map");
            Vector3[] vecs = new Vector3[_ts.Length + 2];

            for (int i = 0; i < _ts.Length; i++)
            {
                //vecs[i + 1] = _ts[i].position - _map.position;
                vecs[i + 1] = _ts[i].position;
            }
            vecs[0] = vecs[1];
            vecs[vecs.Length - 1] = vecs[vecs.Length - 2];

            state = MoveState.Moving;
            LTSpline cr   = new LTSpline(vecs);
            float    time = cr.distance / 5;
            LeanTween.move(MovePlayer.gameObject, cr, time).setOnComplete(() =>
            {
                playerPoints.Nowpoint = playerPoints.Nextpoint;
                MovePath();
            });

            SetCharacterVecter(vecs);
        }
    }