//delegate void InitDelegate();
        //void Init()
        //{
        //    if (this.InvokeRequired)
        //        this.Invoke(new InitDelegate(_Init));
        //    else
        //        _Init();
        //}
        void Init(object sender, EventArgs args)
        {
            this.scenePattern    = Library.GetScenePattern("snptrn0");//new ScenePattern("ScenePattern");
            this.scene           = (Scene)this.soshiant33Panel.engine.AddChild(this.scenePattern, null);
            this.scene.رنگ_زمینه = this.BackColor;
            this.scene.Pause();
            //base Plane
            SpritePattern plane = new SpritePattern("Plane Pattern");
            SpriteState   state = plane.AddNewState("st0");

            state.صورت = "basePlane.x";
            state.AddNewKeyFrame(0);
            Sprite basePlane = (Sprite)scene.AddChild(plane, null);

            basePlane.مولفه_ها.موقعیت.z = 1000;
            //Target Sprite
            this.spritePattern = new SpritePattern("SpritePatern" + patternCounter++.ToString());
            this.sprite        = (Sprite)this.scene.AddChild(this.spritePattern, null);

            this.soshiant33Panel.engine.camera.Fly(250);
            this.soshiant33Panel.engine.camera.Pitch(0.4f);
            this.soshiant33Panel.engine.camera.Walk(220);
            this.soshiant33Panel.engine.Resize(this.soshiant33Panel.Width, this.soshiant33Panel.Height);
            //this.splitContainer2.SplitterDistance = 200;
            if (this.OnTurnedOn != null)
            {
                this.OnTurnedOn(this, null);
            }
        }
        //Add New State BTN
        private void btn_newState_Click(object sender, EventArgs e)
        {
            if (this.spritePattern != null)
            {
                openMeshFile.InitialDirectory = Application.ExecutablePath + "\\Res\\";
                if (openMeshFile.ShowDialog() == DialogResult.OK)
                {
                    SpriteState state = this.spritePattern.AddNewState("State_" + statesCounter++.ToString());
                    this.Cursor = Cursors.WaitCursor;
                    state.صورت  = System.IO.Path.GetFileName(openMeshFile.FileName);
                    if (System.IO.Path.GetExtension(openMeshFile.FileName) == ".sht")
                    {
                        for (int i = 0; i < state.تعداد_زیرمجموعه_های_صورت; i++)
                        {
                            state.AddNewKeyFrame(i);
                        }
                    }
                    else
                    {
                        state.AddNewKeyFrame(-1);
                    }
                    this.btn_removeFrames.Enabled = true;
                    this.statesGallery.Items.Add(state.avatar);
                    state.avatar.Selected = true;
                    this.ResetTimeLine(state);
                    this.sprite.currentState         = (ushort)(this.spritePattern.وضعیتها.Count - 1);
                    this.propertyGrid.SelectedObject = state;
                    this.lbl_selectedObject.Text     = "[" + state.نام + "]";

                    if (this.statesGallery.Items.Count > 1)
                    {
                        this.btn_removeState.Enabled = true;
                    }
                    this.Cursor = Cursors.Arrow;
                }
            }
        }
예제 #3
0
        private void btn_clear_Click(object sender, EventArgs e)
        {
            this.scenePattern    = Library.GetScenePattern("ScenePattern_" + scenesCounter++.ToString());//new ScenePattern("ScenePattern_" + scenesCounter++.ToString());
            this.scene           = (Scene)this.s33Panel1.engine.AddChild(this.scenePattern, null);
            this.scene.رنگ_زمینه = this.BackColor;
            this.scene.Pause();
            //base Plane
            SpritePattern plane = new SpritePattern("Plane Pattern");
            SpriteState   state = plane.AddNewState("st0");

            state.صورت = "basePlane.x";
            state.AddNewKeyFrame(0);
            basePlane = (Sprite)this.scene.AddChild(plane, null);
            basePlane.مولفه_ها.موقعیت.z = 1000;
            s33Panel1_MouseUp(null, null);
        }