예제 #1
0
        /// <summary>
        /// Update the game object being focused on
        /// </summary>
        public void UpdateFocus()
        {
            OldPrimeFocus          = PrimeFocus;
            PrimeFocus             = null;
            OldUIInteractibleFocus = UIInteractibleFocus;
            UIInteractibleFocus    = null;

            if (m_LockedFocus != null)
            {
                PrimeFocus = m_LockedFocus;
            }
            else if (Hit && FocusHitInfo.transform != null)
            {
                PrimeFocus = FocusHitInfo.transform.gameObject;
            }

            // Bubble up from the old focused object and record all object that should get the GazeExited message
            if (OldPrimeFocus != null)
            {
                Transform trans = OldPrimeFocus.transform;
                do
                {
                    FocusExitList.Add(trans.gameObject);
                    GetNextValidParent(ref trans);
                } while (trans != null);
            }

            FocusList.Clear();

            if (PrimeFocus != null)
            {
                Transform trans = PrimeFocus.transform;
                do
                {
                    bool found = FocusExitList.Remove(trans.gameObject);
                    if (!found)
                    {
                        FocusEnterList.Add(trans.gameObject);
                    }

                    FocusList.Add(trans.gameObject);

                    if (UIInteractibleFocus == null)
                    {
                        Selectable          foundSelectable = trans.gameObject.GetComponent <Selectable>();
                        IEventSystemHandler eventHandler    = trans.gameObject.GetComponent <IEventSystemHandler>();
                        if (eventHandler != null)
                        {
                            UIInteractibleFocus = (eventHandler as Component).gameObject;
                        }
                        else if (foundSelectable != null && foundSelectable.IsInteractable())
                        {
                            UIInteractibleFocus = foundSelectable.gameObject;
                        }
                    }

                    GetNextValidParent(ref trans);
                } while (trans != null);
            }
        }
예제 #2
0
        public void OnPoacherKilled(BaseCreature bc)
        {
            if (Poachers != null && Poachers.Contains(bc))
            {
                Poachers.Remove(bc);

                if (Poachers.Count == 0)
                {
                    if (!IsHatching)
                    {
                        IsHatching = true;
                        ColUtility.Free(Poachers);

                        Timer.DelayCall(TimeSpan.FromSeconds(Utility.RandomMinMax(15, 30)), () =>
                        {
                            Hatchling = new DragonTurtleHatchling();
                            Hatchling.MoveToWorld(Location, Map);
                            Hatchling.Tamable = false;

                            SpawnPoachers(Hatchling);

                            if (Egg != null)
                            {
                                Egg.Visible = false;
                            }
                        });
                    }
                    else
                    {
                        if (Hatchling.Alive)
                        {
                            CooldownEnds = DateTime.UtcNow + ResetPeriod;
                            Timer.DelayCall(TimeSpan.FromSeconds(1), OnComplete, new object[] { Hatchling, Focus });

                            if (!FocusList.Contains(Focus))
                            {
                                FocusList.Add(Focus);
                            }
                        }
                        else
                        {
                            Delete();
                        }

                        if (DeadlineTimer != null)
                        {
                            DeadlineTimer.Stop();
                            DeadlineTimer = null;
                        }

                        Hatchling = null;
                        Focus     = null;

                        ColUtility.Free(Poachers);
                        Poachers = null;
                    }
                }
            }
        }
예제 #3
0
        protected override async Task InitializationAsync()
        {
            var activityHomePageDetailResult = await OfoApi.GetActivityHomePageDetailAsync();

            if (await CheckOfoApiResult(activityHomePageDetailResult))
            {
                var activityHomePageDetail = activityHomePageDetailResult.Data;
                if (activityHomePageDetail?.AdList?.Count > 0)
                {
                    activityHomePageDetail.AdList.ForEach(item =>
                    {
                        ActivityList.Add(new ActivityCenterActivityItemViewModel()
                        {
                            ActivityId   = item.activityId,
                            ClickCommand = ActivityClickCommand,
                            ImgName      = item.ImgName,
                            ImgUrl       = item.ImgUrl,
                            JumpUrl      = item.JumpUrl,
                        });
                    });
                }
                if (activityHomePageDetail?.OperationList?.Count > 0)
                {
                    activityHomePageDetail.OperationList.ForEach(item =>
                    {
                        OperationList.Add(item);
                    });
                }
                if (activityHomePageDetail?.FocusList?.Count > 0)
                {
                    activityHomePageDetail.FocusList.ForEach(item =>
                    {
                        FocusList.Add(item);
                    });
                }
            }
        }