コード例 #1
0
    public void OpenCollider(DCtype type, float delay, DamageType damageType)
    {
        if (!states.lookRight)
        {
            switch (type)
            {
            case DCtype.bottom:
                StartCoroutine(OpenCollider(damageCollidersLeft, 0, delay, damageType));
                break;

            case DCtype.up:
                StartCoroutine(OpenCollider(damageCollidersLeft, 1, delay, damageType));
                break;
            }
        }
        else
        {
            switch (type)
            {
            case DCtype.bottom:
                StartCoroutine(OpenCollider(damageColldersRight, 0, delay, damageType));
                break;

            case DCtype.up:
                StartCoroutine(OpenCollider(damageColldersRight, 1, delay, damageType));
                break;
            }
        }
    }
コード例 #2
0
    public void OpenCollider(DCtype type, float delay, DamageType damageType)
    {
        switch (type)
        {
        case DCtype.left_l_down:
            StartCoroutine(OpenCollider(damageColliders, 0, delay, damageType));
            break;

        case DCtype.right_l_down:
            StartCoroutine(OpenCollider(damageColliders, 1, delay, damageType));
            break;

        case DCtype.left_kn_down:
            StartCoroutine(OpenCollider(damageColliders, 2, delay, damageType));
            break;

        case DCtype.right_kn_down:
            StartCoroutine(OpenCollider(damageColliders, 3, delay, damageType));
            break;

        case DCtype.left_h_up:
            StartCoroutine(OpenCollider(damageColliders, 4, delay, damageType));
            break;

        case DCtype.right_h_up:
            StartCoroutine(OpenCollider(damageColliders, 5, delay, damageType));
            break;
        }
    }
コード例 #3
0
    public void OpenCollider(DCtype type, float delay, DamageType damageType)
    {
        //make sure the colliders are flipped with the character
        switch (type)
        {
        case DCtype.bottom:
            StartCoroutine(OpenCollider(damageColliders, 0, delay, damageType));
            break;

        case DCtype.top:
            StartCoroutine(OpenCollider(damageColliders, 1, delay, damageType));
            break;
        }

        /*if(!states.lookRight)
         * {
         *  switch (type)
         *  {
         *      case DCtype.bottom:
         *          StartCoroutine(OpenCollider(damageColliders, 0, delay, damageType));
         *          break;
         *      case DCtype.top:
         *          StartCoroutine(OpenCollider(damageColliders, 1, delay, damageType));
         *          break;
         *  }
         * } else
         * {
         *  damageColliders.flipX;
         * }*/
    }
コード例 #4
0
ファイル: frmShp2Dwg.cs プロジェクト: siszoey/geosufan
        private void DataChange(DCtype dcType, string strSource, string strTarget)
        {
            if (strSource.Substring(strSource.Length - 3).ToUpper() == strTarget.Substring(strTarget.Length - 3).ToUpper())
            {
                MessageBox.Show("数据格式一致,不需要转换。");
                return;
            }

            //由dwg到gdb数据转换
            if (strSource.Substring(strSource.Length - 3).ToUpper() == "DWG")
            {
            }
            else
            {
            }
        }
コード例 #5
0
ファイル: frmShp2Dwg.cs プロジェクト: siszoey/geosufan
        private void cmdOK_Click(object sender, EventArgs e)
        {
            //转换类型
            try
            {
                //check null
                if (txtSource.Text == "" || txtTarget.Text == "")
                {
                    return;
                }
                DCtype tempType = DCtype.NoXdata;
                switch (1)
                {
                case 0:
                    tempType = DCtype.NoXdata;
                    break;

                case 1:
                    tempType = DCtype.HasXdata;
                    break;

                case 2:
                    tempType = DCtype.FmeXdata;
                    break;

                default:
                    return;
                }

                if (m_OutType == OutType.gdb2dwg || m_OutType == OutType.mdb2dwg || m_OutType == OutType.shp2dwg)
                {
                    if (lstLyrFile.CheckedItems.Count == 0)
                    {
                        return;
                    }
                    string strgdbLyrs = GetInputFile(this.txtSource.Text);
                    if (tempType == DCtype.FmeXdata)
                    {
                        strgdbLyrs = this.txtSource.Text;
                    }
                    string strdwgfile = this.txtTarget.Text;

                    if (strgdbLyrs == "" || strdwgfile == "")
                    {
                        return;
                    }
                    string strtemp = System.IO.Path.GetDirectoryName(strdwgfile);

                    if (strtemp == "")
                    {
                        MessageBox.Show("输出dwg的路径出现错误。", "提示", MessageBoxButtons.OK, MessageBoxIcon.Information);
                        return;
                    }

                    strtemp = System.IO.Path.GetFileName(strdwgfile);
                    if (strtemp == "")
                    {
                        return;
                    }

                    if (System.IO.Path.GetExtension(strdwgfile).ToUpper() != ".DWG")
                    {
                        MessageBox.Show("输出dwg的路径后缀名应为dwg。", "提示", MessageBoxButtons.OK, MessageBoxIcon.Information);
                        return;
                    }

                    this.Cursor  = Cursors.WaitCursor;
                    this.Enabled = false;
                    label1.Text  = "正在转换,请稍后...";
                    if (this.WriteLog)
                    {
                        Plugin.LogTable.Writelog("将矢量数据转换成dwg数据");
                    }

                    Application.DoEvents();
                    QuickExportToDWG(strgdbLyrs, strdwgfile, tempType, "");
                    label1.Text = "";
                    Application.DoEvents();
                }
                else if (m_OutType == OutType.dwg2shp || m_OutType == OutType.dwg2gdb)
                {
                    this.Cursor  = Cursors.WaitCursor;
                    this.Enabled = false;
                    label1.Text  = "正在转换,请稍后...";
                    if (this.WriteLog)
                    {
                        Plugin.LogTable.Writelog("将dwg数据转换成矢量数据");
                    }
                    Application.DoEvents();
                    QuickImportTopdb(txtSource.Text, txtTarget.Text);
                    label1.Text = "";
                    Application.DoEvents();
                }

                this.Cursor  = Cursors.Default;
                this.Enabled = true;
                MessageBox.Show("转换完成。", "提示", MessageBoxButtons.OK, MessageBoxIcon.Information);
                if (this.WriteLog)
                {
                    Plugin.LogTable.Writelog("完成转换");
                }
                //this.Close();//转换完成不应该关闭
            }
            catch (Exception ex)
            {
                this.Cursor  = Cursors.Default;
                this.Enabled = true;
                label1.Text  = "";
                if (this.WriteLog)
                {
                    Plugin.LogTable.Writelog("转换出现错误(" + ex.Message + "),停止转换");
                }
                MessageBox.Show("转换过程出现错误。" + Environment.NewLine + ex.Message, "提示", MessageBoxButtons.OK, MessageBoxIcon.Information);
            }
        }
コード例 #6
0
ファイル: frmShp2Dwg.cs プロジェクト: siszoey/geosufan
        //利用quickexport进行数据转换  gdb-->dwg 有扩展属性的转换
        private void QuickExportToDWG(string strSource, string strdwgFile, DCtype type, string strTemplate)
        {
            ITrackCancel pTrackCancel = null;

            //找到tool
            ESRI.ArcGIS.Geoprocessing.GeoProcessor _geoPro = new GeoProcessor();
            pTrackCancel = new TrackCancelClass();
            IVariantArray pVArray    = new VarArrayClass();
            IVariantArray parameters = new VarArrayClass();

            //模板文件
            string strT = "";

            if (strTemplate != "")
            {
                strT = ",_TMPL," + strTemplate;// D:\南京\data\dddd.dwg
            }

            string strtoolName = "";

            if (type == DCtype.HasXdata)
            {
                parameters.Add(strSource);
                parameters.Add("ACAD," + strdwgFile);
                parameters.Add("RUNTIME_MACROS,");
                parameters.Add("_ATTRKIND,extended_entity_data,_REL,Release2000" + strT);
                parameters.Add(",META_MACROS,");
                parameters.Add("Dest_ATTRKIND,extended_entity_data,Dest_REL,Release2000" + strT);
                parameters.Add(",METAFILE,ACAD,COORDSYS,,__FME_DATASET_IS_SOURCE__,false");

                strtoolName = "QuickExport_interop";
            }
            else if (type == DCtype.NoXdata)
            {
                parameters.Add(strSource);
                parameters.Add("ACAD," + strdwgFile);
                parameters.Add("RUNTIME_MACROS,");
                parameters.Add("_ATTRKIND,ignore,_REL,Release2000" + strT);
                parameters.Add(",META_MACROS,");
                parameters.Add("Dest_ATTRKIND,ignore,Dest_REL,Release2000" + strT);
                parameters.Add(",METAFILE,ACAD,COORDSYS,,__FME_DATASET_IS_SOURCE__,false");

                strtoolName = "QuickExport_interop";
            }
            else if (type == DCtype.FmeXdata)
            {
                string strTblPath = Application.StartupPath + "\\dc.tbx";
                if (strTemplate == "")
                {
                    parameters.Add(strSource);
                    parameters.Add(strdwgFile);
                    _geoPro.AddToolbox(strTblPath);
                    strtoolName = "SpatialETLTool";
                }
                else
                {
                    parameters.Add(strSource);
                    parameters.Add(strdwgFile);
                    parameters.Add(strTemplate);
                    _geoPro.AddToolbox(strTblPath);
                    strtoolName = "SpatialETLTool";
                }
            }
            else
            {
                return;
            }

            IGPEnvironmentManager pgpEnv = new GPEnvironmentManager();
            IGPMessages           pGpMessages; //= _geoPro.Validate(parameters, false, pgpEnv);
            IGPComHelper          pGPCOMHelper = new GpDispatch();

            //这里是关键,如果不赋值的话,那么就会报错
            //IGPEnvironmentManager pEnvMgr = pGPCOMHelper.EnvironmentManager;
            //pgpEnv.PersistAll = true;
            //pGpMessages = new GPMessagesClass();

            // Execute the model tool by name.
            _geoPro.Execute(strtoolName, parameters, pTrackCancel);
        }