GameHandler.Init C# (CSharp) Method

Init() public method

public Init ( ) : void
return void
    public void Init()
    {
        this.ClearData();
        this.partyHandler = new PartyHandler();

        if(Application.isPlaying)
        {
            if(this.levelHandler == null)
            {
                GameObject tmp = new GameObject("LevelHandler");
                if(GUISystemType.ORK.Equals(DataHolder.GameSettings().guiSystemType))
                {
                    this.levelHandler = (LevelHandler)tmp.AddComponent("LevelHandler");
                }
                else
                {
                    this.levelHandler = (LevelHandlerGUI)tmp.AddComponent("LevelHandlerGUI");
                }
            }
            if(this.musicHandler == null)
            {
                GameObject tmp = new GameObject("MusicHandler");
                this.musicHandler = (MusicHandler)tmp.AddComponent("MusicHandler");
            }
            if(this.dropHandler == null)
            {
                GameObject tmp = new GameObject("DropHandler");
                this.dropHandler = (DropHandler)tmp.AddComponent("DropHandler");
                this.dropHandler.ClearData();
            }
            if(this.dragHandler == null)
            {
                GameObject tmp = new GameObject("DragHandler");
                this.dragHandler = (DragHandler)tmp.AddComponent("DragHandler");
            }
            if(this.windowHandler == null)
            {
                this.windowHandler = new WindowHandler();
            }
            if(this.guiHandler == null)
            {
                GameObject tmp = new GameObject("GUIHandler");
                this.guiHandler = (GUIHandler)tmp.AddComponent("GUIHandler");
            }
        }
    }

Usage Example

Esempio n. 1
0
        /// <summary>
        /// Allows the game to perform any initialization it needs to before starting to run.
        /// This is where it can query for any required services and load any non-graphic
        /// related content.  Calling base.Initialize will enumerate through any components
        /// and initialize them as well.
        /// </summary>
        protected override void Initialize()
        {
            // TODO: Add your initialization logic here

            GameHandler.Init(graphics, GraphicsDevice);

            base.Initialize();
        }
All Usage Examples Of GameHandler::Init
GameHandler