コード例 #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

            base.Initialize();
            this.IsMouseVisible           = true;
            this.Window.AllowUserResizing = true;



            //------ MY CODE ------
            mainHandler = new UnityEngineMainHandler();

            var exporter = new ExportImport();

            var vv = exporter.JsonDeserialize(UIJsonData.data);

            var g = exporter.Deserialize(vv, mainHandler.main.transform);

            UnityEngine.GameObject eventSystem = new UnityEngine.GameObject("EventSystem");
            eventSystem.transform.parent = mainHandler.main.transform;
            var v         = eventSystem.AddComponent <UnityEngine.EventSystems.EventSystem>();
            var baseInput = eventSystem.AddComponent <UnityEngine.EventSystems.StandaloneInputModule>();

            inputModule = eventSystem.AddComponent <XnaInput>();
            inputModule.Init(this);
            baseInput.inputOverride = inputModule;
            // SUPER IMPORTANT
            UnityEngine.Cursor.visible   = true;
            UnityEngine.Cursor.lockState = UnityEngine.CursorLockMode.None;

            // Starts and Awakes all scripts
            mainHandler.Start();
        }
コード例 #2
0
        protected override void Initialize()
        {
            _input           = new XnaInput();
            _input.Processor = _test;

            _test.Initialize();

            base.Initialize();
        }