コード例 #1
0
ファイル: IwViewsManager.cs プロジェクト: ly774508966/Iwana
        public void addView(IIwView view)
        {
            if ( view == null )
            {
                Debug.LogError ( "Error in " + this + " View can't be null." );
                return;
            }

            if ( hasView ( view.name ) )
            {
                Debug.LogError ( "Error in " + this + " View '" + view.name + "' already registered." );
                return;
            }

            lock ( _viewList )
            {
                _viewList [view.name] = view;
                view.dispatcher = _dispatcher;

                if ( view.eventsToHand != null && view.eventsToHand.Count > 0 )
                {
                    foreach ( string eventToHand in view.eventsToHand )
                    {
                        if ( _viewsForNotify.ContainsKey ( eventToHand ) )
                        {
                            _viewsForNotify[eventToHand].Add ( view );
                        }
                        else
                        {
                            List<IIwView> viewListsByEvent = new List<IIwView> ();
                            viewListsByEvent.Add ( view );
                            _viewsForNotify[eventToHand] = viewListsByEvent;
                        }
                    }
                }

                view.initialize ();
            }
        }
コード例 #2
0
ファイル: IwGame.cs プロジェクト: ly774508966/Iwana
 public void addView( IIwView view )
 {
     System.Diagnostics.Debug.Assert (_viewsMgr == null, "View Manager not exists!!!");
     _viewsMgr.addView (view);
 }