Example #1
0
    //3D Max表格信息提取
    public bool MaxAdd(DataRow max_row, string id)
    {
        bool           isRight  = true;
        MaxInfoManager maxMana  = new MaxInfoManager();
        MaxMotion      maxExcel = maxMana.MaxInfoGet(max_row, id, ref isRight);

        if (!isRight)
        {
            return(false);
        }
        _motionList.Add(maxExcel);
        simpleID.Add(simpleID.Count, id);
        return(true);
    }
	//3DMax状态处理
	private void MaxStateProcess(float current_value, float pre_process)
	{
		ExcelOperator excelReader = new ExcelOperator();
		DataTable maxTable = excelReader.ExcelReader(MotionPara.dataRootPath + IDTableName + ".xls", "3DMAX", "A", "J");
		//表格行重复判断,因为编辑人员的疏忽可能导致3DMAX表格内容重复
		List<string> repeatedJudge = new List<string>();
		for (int i = 0; i < maxTable.Rows.Count; i++) 
		{
			string keyStr = (string)maxTable.Rows[i][0].ToString();
			if (repeatedJudge.Contains(keyStr))
			{
				return;  //以下重复,退出
			}
			else 
			{
				repeatedJudge.Add(keyStr);
				//ID表
				string tableID = (string)maxTable.Rows[i][1].ToString();
				int idIndex = idList.IndexOf(tableID);
				if (idIndex == -1)
				{
					Debug.LogError(IDTableName + ".xls,(" + (i + 2).ToString() + ",B)ID表填写错误!");
					return;
				}
				else 
				{
					//读入后面的数据
					float basicTime = 0f;
					if (idIndex != 0)
						basicTime = nodeTimeList[idIndex - 1];
					float endValue = (float.Parse((string)maxTable.Rows[i][9].ToString()) + basicTime) * perTime;
					//首先判断需不需要改变Max状态
					float valMin = pre_process;
					float valMax = current_value;
					if (pre_process > current_value) 
					{
						valMin = current_value;
						valMax = pre_process;
					}
					if (endValue < valMin || endValue > valMax)  //无需更改状态
					{
						continue;
					}
					else  //需要更改状态
					{
						DataRow maxRow = maxTable.Rows[i];
						bool isRight = true;
						MaxInfoManager maxInfo = new MaxInfoManager();
						MaxMotion maxMotion = maxInfo.MaxInfoGet(maxRow, keyStr, ref isRight);
						if (endValue < current_value)
						{
							//已经运行过了
							maxMotion.setCurrentProgress(false);
						}
						else
						{
							//没有运行到
							maxMotion.setCurrentProgress(true);
						}
					}
				}
			}
		}
	}
Example #3
0
	//3D Max表格信息提取
	public bool MaxAdd(DataRow max_row, string id)
	{
		bool isRight = true;
		MaxInfoManager maxMana = new MaxInfoManager();
		MaxMotion maxExcel = maxMana.MaxInfoGet(max_row, id, ref isRight);
		if(!isRight){
			return false;
		}
		_motionList.Add(maxExcel);
		simpleID.Add(simpleID.Count, id);
		return true;
	}