コード例 #1
0
        /// <summary>
        /// Draw the scene.
        /// This method is called every frame. Don't call it manually.
        /// </summary>
        protected void DrawScene(GameTime gameTime)
        {
            if (m_NeedsInit)
            {
                return;
            }

            float startTime = 0;

            if (m_bDisplayStats)
            {
                startTime = (float)m_pStopwatch.Elapsed.TotalMilliseconds;
            }

            CCDrawManager.PushMatrix();

            // draw the scene
            if (m_pRunningScene != null)
            {
                m_pRunningScene.Visit();
            }

            // draw the notifications node
            if (m_pNotificationNode != null)
            {
                NotificationNode.Visit();
            }

            ShowStats();

            CCDrawManager.PopMatrix();

            m_uTotalFrames++;

            if (m_bDisplayStats)
            {
                m_uDrawCount++;
                m_fAccumDraw += (float)m_pStopwatch.Elapsed.TotalMilliseconds - startTime;
            }
        }
コード例 #2
0
        protected void Draw(CCGameTime gameTime)
        {
            Stats.UpdateStart();

            DrawManager.PushMatrix();

            foreach (CCDirector director in sceneDirectors)
            {
                CCScene runningScene = director.RunningScene;

                // draw the scene
                if (runningScene != null)
                {
                    runningScene.Visit();
                    if (EventDispatcher.IsEventListenersFor(EVENT_AFTER_VISIT))
                    {
                        EventDispatcher.DispatchEvent(eventAfterVisit);
                    }
                }

                // draw the notifications node
                if (NotificationNode != null)
                {
                    NotificationNode.Visit();
                }

                if (EventDispatcher.IsEventListenersFor(EVENT_AFTER_DRAW))
                {
                    EventDispatcher.DispatchEvent(eventAfterDraw);
                }
            }

            DrawManager.PopMatrix();

            Stats.Draw(this);
        }
コード例 #3
0
 public void AddNotificationText(NodeAddedEvent e, NotificationNode notification)
 {
     notification.Entity.AddComponent(new NotificationMessageComponent(string.Empty));
 }
コード例 #4
0
 public void CreateUserRankRewardNotification(NodeAddedEvent e, NotificationNode notification)
 {
     notification.Entity.AddComponent(new NotificationMessageComponent(string.Empty));
 }
コード例 #5
0
        public void PrepareNotificationText(NodeAddedEvent e, NotificationNode notification, [JoinAll] ChangeUIDSystem.SelfUserNode user)
        {
            string message = string.Format(notification.uIDChangedNotificationText.MessageTemplate, user.userUid.Uid);

            notification.Entity.AddComponent(new NotificationMessageComponent(message));
        }
コード例 #6
0
        public void PrepareNotificationText(NodeAddedEvent e, NotificationNode notification, [Context, JoinByUser] SingleNode <UserUidComponent> fromUser, NotificationNode notificationToMap, [Context, JoinByMap] MapNode map)
        {
            string message = string.Format(notification.inviteFriendToBattleNotification.MessageTemplate, fromUser.component.Uid, map.descriptionItem.Name, notification.battleMode.BattleMode);

            notification.Entity.AddComponent(new NotificationMessageComponent(message));
        }
コード例 #7
0
 public void GoToBattle(NotificationClickEvent e, NotificationNode notification, [JoinAll] Optional <SingleNode <SelfBattleUserComponent> > userInBattle)
 {
     base.ScheduleEvent(new ShowBattleEvent(notification.battleGroup.Key), EngineService.EntityStub);
 }