Пример #1
0
    public void CreateMaskInScene(GuideAimType type, float offsetX, float offsetY, GuidePointerRotateType rotateType, string str, int step, bool mask = false, float alpha = 0.7f)
    {
        IsGuiding_ = true;
        UIManager.Instance.DoDeActive();
        switch (type)
        {
        case GuideAimType.GAT_MainCrystal:
            GameObject aim = GameObject.FindGameObjectWithTag("PVE");
            creator_.CreateInScene(aim, offsetX, offsetY, rotateType, str, step, alpha, mask);
            break;

        case GuideAimType.GAT_MainJiubaHouse:
            GameObject aim2 = GameObject.FindGameObjectWithTag("jiuba");
            creator_.CreateInScene(aim2, offsetX, offsetY, rotateType, str, step, alpha, mask);
            break;

        case GuideAimType.GAT_MainCastle:
            GameObject aim3 = GameObject.FindGameObjectWithTag("Team");
            creator_.CreateInScene(aim3, offsetX, offsetY, rotateType, str, step, alpha, mask);
            break;

        case GuideAimType.GAT_MainJJC:
            GameObject aim4 = GameObject.FindGameObjectWithTag("arena");
            creator_.CreateInScene(aim4, offsetX, offsetY, rotateType, str, step, alpha, mask);
            break;

        default:
            break;
        }
        crtGuideType_ = GuideType.GT_Scene;
    }
Пример #2
0
    // 指向箭头,指向各个位置,先做指向箭头,至于要不要限制玩家行动,个人认为不需要
    public void ArrowTo(GuideType guide)
    {
        switch (guide)
        {
        case GuideType.Portrait:
            break;

        case GuideType.Strength:
            break;

        case GuideType.Roommate:
            break;

        case GuideType.ActionPanel:
            UIPanelManager.Instance.PushPanel(UIPanelType.Action);
            break;

        case GuideType.ActionButton:
            break;

        case GuideType.ActionDetermineBtn:
            break;

        case GuideType.Block:

            break;

        case GuideType.NextRound:
            break;
        }
    }
Пример #3
0
        public void DrawMask(Graphics g)
        {
            foreach (uint key in guides.Keys)
            {
                Guide     guide = guides[key];
                uint      c     = GuideColorFromGuide(guide);
                GuideType gt    = guide.GuideType;
                switch (gt)
                {
                case GuideType.Point:
                    break;

                case GuideType.Horizontal:
                case GuideType.Vertical:
                    using (Pen p = new Pen(Color.FromArgb((int)c), 5f))
                    {
                        g.DrawLine(p, guide.Bounds.Point.SysPoint(), guide.EndPoint.SysPoint());
                    }
                    break;

                case GuideType.Rectangle:
                    PointF[] pts = guide.Bounds.SysRectangleF().Points();
                    for (int i = 0; i < pts.Length; i++)
                    {
                        using (Pen p = new Pen(Color.FromArgb((int)c - i), 5f))
                        {
                            int targPoint = (i == pts.Length - 1) ? 0 : i + 1;
                            g.DrawLine(p, pts[i], pts[targPoint]);
                        }
                    }
                    break;
                }
            }
        }
    public void show(GuideType type)
    {
        show();

        switch (type)
        {
        case GuideType.Championship:
            goChampionshipInfoContainer.SetActive(true);
            goFriendInfoContainer.SetActive(false);

            lbChampionshipDescription.text = Util.getUIText("CHAMP_INFO_DESCRIPTION");
            lbChampionshipWarning.text     = Util.getUIText("CHAMP_INFO_WARNING");

            lbChampionshipWinningGold.text = Util.getUIText("CHAMP_WINNING_GOLD");

            break;

        case GuideType.Friend:
            goChampionshipInfoContainer.SetActive(false);
            goFriendInfoContainer.SetActive(true);

            if (_setFriendDesc == false)
            {
                _setFriendDesc            = true;
                lbFriendTitle.text        = Util.getUIText("FRIEND_INFO_TITLE");
                lbFriendDescription.text  = Util.getUIText("FRIEND_INFO_DESCRIPTION");
                lbFriendDescription2.text = Util.getUIText("FRIEND_INFO_DESCRIPTION2");
                lbFriendWarning.text      = Util.getUIText("FRIEND_INFO_WARNING");
            }

            refreshFriend();

            break;
        }
    }
Пример #5
0
    public void CreateMaskInBattle(int battlePos, float offsetX, float offsetY, GuidePointerRotateType rotateType, string str, int step, bool mask = false, float alpha = 0.7f)
    {
        IsGuiding_ = true;
        BattleActor actor = Battle.Instance.GetActorByIdx(battlePos);

        creator_.CreateInScene(actor.ControlEntity.ActorObj, offsetX, offsetY, rotateType, str, step, alpha, mask);
        crtGuideType_ = GuideType.GT_Scene;
    }
Пример #6
0
 public void ClearGuideAim()
 {
     guideAimDic_.Clear();
     creator_.ClearGuide();
     IsGuiding_    = false;
     crtGuideType_ = GuideType.GT_None;
     guideTimer_   = 0f;
 }
Пример #7
0
 public void ClearMask()
 {
     IsGuiding_ = false;
     if (creator_ != null)
     {
         creator_.ClearGuide();
     }
     crtGuideType_ = GuideType.GT_None;
     guideTimer_   = 0f;
 }
Пример #8
0
 public void CreateMask(GuideAimType gaType, float offsetX, float offsetY, GuidePointerRotateType rotateType, string str, int step, bool mask = false, float alpha = 0.7f)
 {
     if (!guideAimDic_.ContainsKey(gaType))
     {
         return;
     }
     IsGuiding_    = true;
     crtGuideType_ = GuideType.GT_UI;
     creator_.Create(guideAimDic_[gaType], offsetX, offsetY, rotateType, str, step, alpha, mask);
 }
Пример #9
0
        private IEnumerator PlayAnimation(GuideType guideType, float additionalDelay, bool isSkip, System.Action callback)
        {
            yield return(new WaitForSeconds(predelay + additionalDelay));

            _arrow.Play(_guideTypes[guideType], -1, isSkip ? 1 : 0);
            var length = _arrow.GetCurrentAnimatorStateInfo(0).length;

            yield return(new WaitForSeconds(length));

            callback?.Invoke();
        }
Пример #10
0
    public Vector3[] Guide(Canvas canvas, RectTransform target, GuideType guideType, TranslateType translateType = TranslateType.Direct, float time = 1)
    {
        Guide(target, guideType);

        switch (guideType)
        {
        case GuideType.Rect:
            return(rectGuide.Guide(canvas, target, translateType, time));

        case GuideType.Circle:
            return(circleGuide.Guide(canvas, target, translateType, time));
        }
        return(null);
    }
Пример #11
0
 //TODO TEST
 public void CreateMaskInScene(int npcId, float offsetX, float offsetY, GuidePointerRotateType rotateType, string str, int step, bool mask = false, float alpha = 0.7f)
 {
     IsGuiding_ = true;
     UIManager.Instance.DoDeActive();
     GameObject[] npc = GameObject.FindGameObjectsWithTag("NPC");
     for (int i = 0; i < npc.Length; ++i)
     {
         if (npc[i].name.Equals(npcId.ToString()))
         {
             creator_.CreateInScene(npc[i], offsetX, offsetY, rotateType, str, step, alpha, mask);
         }
     }
     crtGuideType_ = GuideType.GT_Scene;
 }
Пример #12
0
        public override int GetHashCode()
        {
            int hash = 1;

            if (GuideId != 0)
            {
                hash ^= GuideId.GetHashCode();
            }
            if (GuideType != 0)
            {
                hash ^= GuideType.GetHashCode();
            }
            hash ^= awards_.GetHashCode();
            return(hash);
        }
Пример #13
0
    public void Guide(Canvas canvas, RectTransform target, GuideType guideType, float scale, float time, TranslateType translateType = TranslateType.Direct, float moveTime = 1)
    {
        Guide(target, guideType);

        switch (guideType)
        {
        case GuideType.Rect:
            rectGuide.Guide(canvas, target, scale, time, translateType, moveTime);
            break;

        case GuideType.Circle:
            circleGuide.Guide(canvas, target, scale, time, translateType, moveTime);
            break;
        }
    }
Пример #14
0
 public GuideArrowData(
     GuideType guideType,
     RectTransform target,
     Vector2 targetPositionOffset,
     Vector2 targetSizeOffset,
     float arrowAdditionalDelay,
     bool isSkip)
 {
     this.guideType            = guideType;
     this.target               = target;
     this.targetPositionOffset = targetPositionOffset;
     this.targetSizeOffset     = targetSizeOffset;
     this.arrowAdditionalDelay = arrowAdditionalDelay;
     this.isSkip               = isSkip;
 }
Пример #15
0
    private void Guide(RectTransform target, GuideType guideType)
    {
        this.target    = target;
        this.guideType = guideType;

        switch (guideType)
        {
        case GuideType.Rect:
            mask.material = rectMat;
            break;

        case GuideType.Circle:
            mask.material = circleMat;
            break;
        }
    }
Пример #16
0
 public GuideItemBase(IGuide guid, GuideType type)
 {
     _type  = type;
     _guide = guid;
     if (type == GuideType.Global)
     {
         lineColor = new SolidColorBrush(Color.FromRgb(GlobalData.GlobalGuideColor.R, GlobalData.GlobalGuideColor.G, GlobalData.GlobalGuideColor.B));
     }
     else
     {
         lineColor = new SolidColorBrush(Color.FromRgb(GlobalData.LocalGuideColor.R, GlobalData.LocalGuideColor.G, GlobalData.LocalGuideColor.B));
     }
     LockCommand   = new DelegateCommand <object>(LockExecute);
     DeleteCommand = new DelegateCommand <object>(DeleteExecute, CanDeleteExecute);
     _ListEventAggregator.GetEvent <GlobalLockGuides>().Subscribe(GlobalLockGuidesHandler);
     //isLocked = true;
 }
Пример #17
0
        public int BookGuide(GuideType type, int days)
        {
            switch (type)
            {
            case GuideType.None:
                return(0);

            case GuideType.Audio:
                return(25 * days);

            case GuideType.Person:
                return(50 * days);

            default:
                return(0);
            }
        }
Пример #18
0
        public void ShowGuidence(GuideType guideType, MaskableGraphic target, float border, float shrinkTime)
        {
            mTarget = target;

            switch (guideType)
            {
            case GuideType.Circle:
                mCircleGuidence.Show(target, border, shrinkTime);
                break;

            case GuideType.Rect:
                mRectGuidence.Show(target, border, shrinkTime);
                break;

            default:
                break;
            }
        }
Пример #19
0
        public override int GetHashCode()
        {
            int hash = 1;

            if (UserId != 0)
            {
                hash ^= UserId.GetHashCode();
            }
            if (GuideType != 0)
            {
                hash ^= GuideType.GetHashCode();
            }
            if (GuideId != 0)
            {
                hash ^= GuideId.GetHashCode();
            }
            return(hash);
        }
Пример #20
0
 public void setGuideState(GuideType type, int step)
 {
     guideStep [(int)type] = step;
 }
Пример #21
0
 public VerticalGuideLine(IGuide guid, GuideType type, double scale)
     : base(guid, type)
 {
     this._scale = scale;
 }
Пример #22
0
        public async Task <List <ProgramInfo> > GetProgramGuideAsync(GuideType guideType, DateTime?dateTime = null)
        {
            List <ProgramInfo> programInfoList = new List <ProgramInfo>();

            try
            {
                Uri uri = null;
                switch (guideType)
                {
                case GuideType.Now:
                    uri = new Uri(string.Format(NOW_URL, AreaCode));
                    break;

                case GuideType.Today:
                    uri = new Uri(string.Format(TODAY_URL, AreaCode));
                    break;

                case GuideType.DateSpecification:

                    if (!dateTime.HasValue)
                    {
                        throw new ArgumentNullException();
                    }

                    uri = new Uri(string.Format(DATE_URL, dateTime?.ToString("yyyyMMdd"), AreaCode));
                    break;
                }

                var responce = await Client.GetStringAsync(uri);

                var    xmlSerializer = new XmlSerializer(typeof(radiko));
                radiko result        = null;
                using (StringReader stringReader = new StringReader(responce))
                    using (var xmlReader = System.Xml.XmlReader.Create(stringReader))
                    {
                        result = (radiko)xmlSerializer.Deserialize(xmlReader);
                    }

                if (result == null)
                {
                    return(programInfoList);
                }

                foreach (var item in result.stations)
                {
                    foreach (var item2 in item.progs.prog)
                    {
                        try
                        {
                            string dateText = $"{item.progs.date}{item2.ftl.ToString().PadLeft(4, '0')}";
                            int    year     = Convert.ToInt32(new string(item.progs.date.ToString().Take(4).ToArray()));
                            int    month    = Convert.ToInt32(new string(item.progs.date.ToString().Skip(4).Take(2).ToArray()));
                            int    day      = Convert.ToInt32(new string(item.progs.date.ToString().Skip(6).Take(2).ToArray()));
                            var    hour     = Convert.ToInt32(new string(item2.ftl.ToString().PadLeft(4, '0').Take(2).ToArray()));
                            var    minute   = Convert.ToInt32(new string(item2.ftl.ToString().PadLeft(4, '0').Skip(2).Take(2).ToArray()));

                            ProgramInfo programInfo = new ProgramInfo
                            {
                                Title          = item2.title,
                                StationName    = item.name,
                                StationId      = item.id,
                                OnAirDateTime  = new DateTime(year, month, day).Add(new TimeSpan(hour, minute, 00)),
                                OnAirTime      = new TimeSpan(0, 0, item2.dur),
                                InfomationHTML = item2.info
                            };

                            if (!string.IsNullOrWhiteSpace(item2.url))
                            {
                                programInfo.Url = new Uri(item2.url);
                            }

                            programInfoList.Add(programInfo);
                        }
                        catch (Exception ex)
                        {
                            Console.WriteLine(ex.ToString());
                        }
                    }
                }
            }
            catch (Exception ex)
            {
                Console.WriteLine(ex.ToString());
            }
            return(programInfoList);
        }
Пример #23
0
 public HorizontalGuideLine(IGuide guid, GuideType type, double scale)
     : base(guid, type)
 {
     this._scale = scale;
 }
Пример #24
0
 public static bool HasHorizontal(this GuideType g)
 {
     return(g == GuideType.Horizontal || g == GuideType.Rectangle);
 }
Пример #25
0
 public static bool HasVertical(this GuideType g)
 {
     return(g == GuideType.Vertical || g == GuideType.Rectangle);
 }
Пример #26
0
        public double BuildTrip(string fromCity, string toCity, int days, HotelType hotelType, TripType tripType, GuideType guideType)
        {
            double price = 0;

            var hotelBooking = new HotelBooking();

            price += hotelBooking.BookHotel(hotelType, days);

            var tripBooking = new TripBooking();

            price += tripBooking.BookTrip(tripType, fromCity, toCity);

            var guideBooking = new GuideBooking();

            price += guideBooking.BookGuide(guideType, days);

            //Console.WriteLine("Tour info:");
            //Console.WriteLine($"From: {fromCity}");
            //Console.WriteLine($"To: {toCity}");
            //Console.WriteLine($"Hotel type: {hotelType}");
            //Console.WriteLine($"Trip type: {tripType}");
            //Console.WriteLine($"Guide type: {guideType}");
            //Console.WriteLine($"Total price: {price}");

            return(price);
        }
Пример #27
0
 public GuideInfo(GuideType type, IGuide guide)
 {
     Type  = type;
     Guide = guide;
 }
Пример #28
0
 public void CreateMask(GameObject go, float offsetX, float offsetY, GuidePointerRotateType rotateType, string str, int step, bool mask = false, float alpha = 0.7f)
 {
     IsGuiding_    = true;
     crtGuideType_ = GuideType.GT_UI;
     creator_.Create(go, offsetX, offsetY, rotateType, str, step, alpha, mask);
 }