Пример #1
0
        private void Window_Loaded(object sender, RoutedEventArgs e)
        {
            UnrealScienceScripting.SetPlaying();

            unsafe
            {
                UnrealScienceScripting.InitD3D(panel.Handle.ToPointer(),
                                               System.Windows.Forms.SystemInformation.VirtualScreen.Width,
                                               System.Windows.Forms.SystemInformation.VirtualScreen.Height);

                loaded = true;
            }


            UnrealScienceScripting.InitWorld();

            timer = new System.Windows.Forms.Timer();

            timer.Interval = 10;

            timer.Tick += timer_Tick;

            timer.Start();

            Scripting = new UnrealScienceScripting();

            Scripting.InitScripting();

            Scripting.InitAnimationScripting();

            if (UnrealScienceScripting.World.Entities.Count != 0)
            {
                Scripting.isPlaying = true;
                CreateScene(UnrealScienceScripting.World);
                isArray = true;
            }
            else if (Reader.Scene != null)
            {
                Scripting.isPlaying = true;
                CreateScene(Reader.Scene);
            }

            Resize();

            InitSpeech();
        }
Пример #2
0
        private void Window_Loaded(object sender, RoutedEventArgs e)
        {
            unsafe
            {
                UnrealScienceScripting.InitD3D(panel.Handle.ToPointer(),
                                               System.Windows.Forms.SystemInformation.VirtualScreen.Width,
                                               System.Windows.Forms.SystemInformation.VirtualScreen.Height);
            }


            UnrealScienceScripting.InitWorld();

            timer = new System.Windows.Forms.Timer();

            //IntPtr hinstance = /*Marshal.GetHINSTANCE(typeof(MainWindow).Module)*/System.Diagnostics.Process.GetCurrentProcess().Handle;
            //IntPtr hInst = Marshal.GetHINSTANCE(this.GetType().Module);

            //unsafe
            //{
            //    bool t = InitInput(hInst.ToPointer());
            //}



            timer.Interval = 10;

            timer.Tick += timer_Tick;

            timer.Start();

            //InitScripting();

            Scripting = new UnrealScienceScripting();

            Scripting.InitScripting();

            Scripting.AddEntity         = new Action <int>(AddEntity);
            Scripting.Select_Entity     = new Action <int>(Select_Entity);
            Scripting.RemoveEntity      = new Action <int>(RemoveEntity);
            Scripting.ChangeEntityColor = new Action <int>(ChangeColor);

            PropertyGrid.PositionChanged = new Action(MoveEntity);
            PropertyGrid.RotationChanged = new Action(RotateEntity);
            PropertyGrid.ScaleChanged    = new Action(ScaleEntity);

            PropertyGrid.TextureChanged = new Action(SetTexture);

            PropertyGrid.ColorChanged = new Action(SetColor);

            PropertyGrid.InitGrid();



            //InitAnimationScripting();

            Scripting.InitAnimationScripting();

            Scripting.ScriptingManager.functions.Remove("startAnimation");
            Scripting.ScriptingManager.functions.Remove("next");
            Scripting.ScriptingManager.functions.Remove("prev");

            PropertyGrid.Visibility = System.Windows.Visibility.Collapsed;
        }