Exemplo n.º 1
0
        private bool isOK()
        {
            bool           result = false;
            List <Vector3> list   = CActDefs.ReadTargets(this.txtPath.Text);

            if (Operators.CompareString(this.ActionDef.ActionType, "Fly", false) == 0)
            {
                if (list.Count > 1)
                {
                    if (Operators.CompareString(this.txtObjType.Text, "Model", false) == 0)
                    {
                        result = true;
                    }
                    else if (this.txtObjType.Text.Length == 0)
                    {
                        result = true;
                    }
                    else
                    {
                        Interaction.MsgBox("Không đúng đối tượng.", MsgBoxStyle.OkOnly, null);
                    }
                }
                else
                {
                    Interaction.MsgBox("Chưa có đường bay.", MsgBoxStyle.OkOnly, null);
                }
            }
            else if (list.Count > 1)
            {
                if (Operators.CompareString(this.txtObjType.Text, "Model", false) == 0)
                {
                    this.ActionDef.ActionType = "Move";
                    result = true;
                }
                else if (Operators.CompareString(this.txtObjType.Text, "Billboard", false) == 0)
                {
                    this.ActionDef.ActionType = "Move";
                    result = true;
                }
                else if (Operators.CompareString(this.txtObjType.Text, "TexObj", false) == 0)
                {
                    this.ActionDef.ActionType = "Move";
                    result = true;
                }
                else if (this.txtObjType.Text.Length == 0)
                {
                    result = true;
                }
                else
                {
                    Interaction.MsgBox("Không đúng đối tượng.", MsgBoxStyle.OkOnly, null);
                }
            }
            else
            {
                Interaction.MsgBox("Chưa có đường chạy.", MsgBoxStyle.OkOnly, null);
            }
            return(result);
        }
Exemplo n.º 2
0
        private void UpdateAction()
        {
            this.ActionDef.Name      = this.txtActionName.Text;
            this.ActionDef.ObjName   = this.txtObjName.Text;
            this.ActionDef.SoundLoop = this.chkLoop.Checked;
            this.ActionDef.SoundName = this.txtSoundName.Text;
            this.ActionDef.duration  = this.txtDuration.Text;
            this.ActionDef.stophide  = this.chkHide.Checked;
            this.ActionDef.start     = this.txtStart.Text;
            List <Vector3> list = CActDefs.ReadTargets(this.txtPath.Text);

            if (list.Count > 0)
            {
                this.ActionDef.targets.Clear();
                try
                {
                    List <Vector3> .Enumerator enumerator = list.GetEnumerator();
                    while (enumerator.MoveNext())
                    {
                        Vector3 current = enumerator.Current;
                        this.ActionDef.targets.Add(current);
                    }
                }
                finally
                {
                    List <Vector3> .Enumerator enumerator;
                    ((IDisposable)enumerator).Dispose();
                }
            }
            if (Operators.CompareString(this.Mode, "Add", false) == 0)
            {
                this.Parentf.AddAction(this.ActionDef);
            }
            else
            {
                this.Parentf.UpdateAction();
            }
        }