当前位置: 首页>>代码示例>>C#>>正文


C# SIMONObject.SetPropertyElement方法代码示例

本文整理汇总了C#中SIMONFramework.SIMONObject.SetPropertyElement方法的典型用法代码示例。如果您正苦于以下问题:C# SIMONObject.SetPropertyElement方法的具体用法?C# SIMONObject.SetPropertyElement怎么用?C# SIMONObject.SetPropertyElement使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在SIMONFramework.SIMONObject的用法示例。


在下文中一共展示了SIMONObject.SetPropertyElement方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: PropertyUpdate

	public System.Object PropertyUpdate(SIMONObject a, SIMONObject[] b)
	{
		GameObject myObject;
		myObject = GameObject.Find (a.ObjectID);
		int count = 0, count_H1 = 0, count_H2 = 0, count_H3=0,count_H4=0;
		int count_E1 = 0, count_E2 = 0, count_E3=0,count_E4=0;
		double positionX = 0.0d;
		double positionY = 0.0d;
		double myPositionX = myObject.transform.position.x;
		double myPositionY = myObject.transform.position.y;
		double disX, disY;
		Vector2 p;
		float distance;
		if(a.GetPropertyElement("Type") == 2)
		{
			if (myObject.GetComponent<SIMON_Controller>().animator.GetCurrentAnimatorStateInfo (0).IsTag ("Stay")) 
			{
				a.SetPropertyElement("isCheck",1);
			}
		}
		else
		{
			if (myObject.GetComponent<UsualAI_Controller>().animator.GetCurrentAnimatorStateInfo (0).IsTag ("Stay")) 
			{
				a.SetPropertyElement("isCheck",1);
			}
		}
		a.SetPropertyElement ("PositionX", (double)myObject.transform.position.x);
		a.SetPropertyElement ("PositionY", (double)myObject.transform.position.y);
		
		for(int i = 0; i < b.Length; i++)
		{
			if(b[i].GetPropertyElement ("CurHp") <= 0)
			{
				continue;
			}
			
			if(b[i].GetPropertyElement ("Attack_Target")== a.GetPropertyElement("ID"))
			{
				if(a.GetPropertyElement("Type") != b[i].GetPropertyElement("Type"))
					count++;
			}
			positionX = b[i].GetPropertyElement ("PositionX");
			positionY = b[i].GetPropertyElement ("PositionY");
			p = new Vector2((float)positionX,(float)positionY);
			
			distance = Vector2.Distance(p,myObject.transform.position);
			
			if(distance < a.GetPropertyElement("Monster_Sight"))
			{
				disX = positionX - myPositionX;
				disY = positionY - myPositionY;
				if(disX > 0 && disY > 0)
				{
					if(disY - disX > 0)
					{
						if(a.GetPropertyElement("Type") == b[i].GetPropertyElement("Type"))
							count_H1++;
						else
							count_E1++;
					}
					else
					{
						if(a.GetPropertyElement("Type") == b[i].GetPropertyElement("Type"))
							count_H4++;
						else
							count_E4++;
					}
					
				}
				else if(disX < 0 && disY > 0)
				{
					if(disY - (disX * -1.0d) > 0)
					{
						if(a.GetPropertyElement("Type") == b[i].GetPropertyElement("Type"))
							count_H1++;
						else
							count_E1++;
					}
					else
					{
						if(a.GetPropertyElement("Type") == b[i].GetPropertyElement("Type"))
							count_H2++;
						else
							count_E2++;
					}
				}
				else if(disX < 0 && disY < 0)
				{
					if((disY * -1.0d) - (disX * -1.0d) > 0)
					{
						if(a.GetPropertyElement("Type") == b[i].GetPropertyElement("Type"))
							count_H3++;
						else
							count_E3++;
					}
					else
					{
						if(a.GetPropertyElement("Type") == b[i].GetPropertyElement("Type"))
							count_H2++;
//.........这里部分代码省略.........
开发者ID:notear0,项目名称:SIMONFramework,代码行数:101,代码来源:SIMON_Controller.cs

示例2: Monster_defense

	public Object Monster_defense(SIMONObject a, SIMONObject[] b)
	{
		a.SetPropertyElement ("State", (double)3.0d);
		a.SetPropertyElement ("Attack_Target", -1.0d);
		a.SetPropertyElement ("Move_Target", -1.0d);
		a.SetPropertyElement ("Target",-1.0d);
		return null;
	}
开发者ID:notear0,项目名称:SIMONFramework,代码行数:8,代码来源:SIMON_Controller.cs

示例3: Monster_attack

	public Object Monster_attack(SIMONObject a, SIMONObject[] b)
	{
		a.SetPropertyElement("State",2.0d);
		a.SetPropertyElement ("Move_Target", -1.0d);
		a.SetPropertyElement("Target",a.GetPropertyElement("Attack_Target"));
		return null;
	}
开发者ID:notear0,项目名称:SIMONFramework,代码行数:7,代码来源:SIMON_Controller.cs

示例4: monster_Skill_Defensive

	public Object monster_Skill_Defensive(SIMONObject a, SIMONObject[] b)
	{
		a.SetPropertyElement ("Skill_number", 5);
		return null;
	}
开发者ID:notear0,项目名称:SIMONFramework,代码行数:5,代码来源:SIMON_Controller.cs

示例5: monster_Skill_Range

	public Object monster_Skill_Range(SIMONObject a, SIMONObject[] b)
	{
		a.SetPropertyElement ("Skill_number", 7);
		return null;
	}
开发者ID:notear0,项目名称:SIMONFramework,代码行数:5,代码来源:SIMON_Controller.cs

示例6: ActionFunction_Skill_CON

	public System.Object ActionFunction_Skill_CON(SIMONObject a, SIMONObject[] b)
	{
		double MaxValue= -1000000.0d;
		double tempValue = 0.0d;
		double hp =a.GetPropertyElement("CurHp");
		double total_hp = a.GetPropertyElement ("HP");
		double attackedCount = a.GetPropertyElement ("AttackedCount");

		double geneA, geneB, geneC ,geneD;
		
		if (a.GetPropertyElement ("CON") < 20)
			return MaxValue;
		
		
		if (a.GetPropertyElement ("Type") == 1) 
		{
			if (isSkillCoolTime((float)a.GetPropertyElement("coolTime_Skill_Start_6")) && !isSkill) 
			{
				a.SetPropertyElement("coolTime_Skill_Start_6",(double)Time.time);
				MaxValue = 1000000.0d;
			}
			return MaxValue;
		}
		
		
		if(SimulationType == 1)
		{
			geneA = 44.0d;
			geneB = 100.0d;
			geneC = 100.0d;
			geneD = 1.0d;
		}
		else
		{
			geneA = a.GetActionObject("Skill_CON"  ).FindWeight ("CON_Gene_A");
			geneB =	a.GetActionObject("Skill_CON"  ).FindWeight ("CON_Gene_B");
			geneC =	a.GetActionObject("Skill_CON"  ).FindWeight ("CON_Gene_C");
			geneD =	a.GetActionObject("Skill_CON"  ).FindWeight ("CON_Gene_D");
		}
		
		
		if (isSkillCoolTime((float)a.GetPropertyElement("coolTime_Skill_Start_6")) && !isSkill) 
		{
			a.SetPropertyElement("coolTime_Skill_Start_6",(double)Time.time);
			for(int i = 0 ; i < b.Length ; i++)
			{
				if(b[i].GetPropertyElement("CurHp") <=0)
					continue;
				if(a.GetPropertyElement("Type") != b[i].GetPropertyElement("Type"))
				{
					tempValue =((scoreConversion(-1.0d * total_hp,hp)*geneA)
					            )*4.0d;
					if(MaxValue < tempValue)
					{
						MaxValue = tempValue;
					}
				}
			}
		}
		return MaxValue;
	}
开发者ID:notear0,项目名称:SIMONFramework,代码行数:61,代码来源:SIMON_Controller.cs

示例7: ActionFunction_Move

	public System.Object ActionFunction_Move(SIMONObject a, SIMONObject[] b)
	{
		double MaxValue = -1000000.0d;
		double tempValue = 0.0d;
		double hp =a.GetPropertyElement("CurHp");
		double damage = a.GetPropertyElement ("Monster_Damage");
		double attack_Speed = a.GetPropertyElement ("Monster_Attack_Speed");
		double attackedCount = a.GetPropertyElement ("AttackedCount");
		double defensive = a.GetPropertyElement("Defensive");
		double total_hp = a.GetPropertyElement ("HP");
		
		double geneA, geneC, geneD;
		double pointX = a.GetPropertyElement ("PositionX");
		double pointY = a.GetPropertyElement ("PositionY");
		Vector2 a_v;
		
		GameObject Target_Temp;
		
		if(SimulationType == 1)
		{
			geneA = -0.5d;
			geneC = 0.0d;
			geneD = 4.0d;
		}
		else
		{
			geneA =	a.GetActionObject("Move").FindWeight ("Move_Gene_A");
			geneC =	a.GetActionObject("Move").FindWeight ("Move_Gene_C");
			geneD = a.GetActionObject("Move").FindWeight ("Move_Gene_D");
		}
		
		
		Target_Temp = GameObject.Find ("Player");
		double player_hp = Target_Temp.GetComponent<Player_Controller> ().HC.NowHealth;
		double player_total_hp = Target_Temp.GetComponent <Player_Controller> ().HC.TotalHealth;
		
		if(player_hp > 0 && a.GetPropertyElement("Type") == 1)
		{
			a_v= new Vector2((float)pointX,(float)pointY);
			MaxValue =((scoreConversion(-1.0d * player_total_hp,player_hp)*geneA)+
			           (scoreConversion(-25.0d,a.GetPropertyElement("AttackedCount"))*geneC)+
			           (scoreConversion(19.0d,dis)*geneD)
			           );
			
			a.SetPropertyElement("Move_Target",0.0d);
		}
		for(int i = 0; i < b.Length ; i++)
		{
			if(b[i].GetPropertyElement("CurHp") <=0)
				continue;
			if(a.GetPropertyElement("Type") != b[i].GetPropertyElement("Type"))
			{
				Target_Temp = GameObject.Find (b[i].ObjectID);
				a_v= new Vector2((float)pointX,(float)pointY);
				dis = Vector2.Distance (a_v, Target_Temp.transform.position);
				tempValue =((scoreConversion(-1.0d * b[i].GetPropertyElement("HP"),b[i].GetPropertyElement("CurHp"))*geneA)+
				            (scoreConversion(-25.0d,a.GetPropertyElement("AttackedCount"))*geneC)+
				            (scoreConversion(19.0d,dis)*geneD)
				            );
				if(MaxValue < tempValue)
				{
					MaxValue = tempValue;
					a.SetPropertyElement("Move_Target",b[i].GetPropertyElement("ID"));
				}
			}
		}
		
		return MaxValue;
	}
开发者ID:notear0,项目名称:SIMONFramework,代码行数:69,代码来源:Monster_Controller.cs

示例8: ActionFunction_Attack

	public System.Object ActionFunction_Attack(SIMONObject a, SIMONObject[] b)
	{
		double MaxValue = -1000000.0d;
		double tempValue = 0.0d;
		double hp =a.GetPropertyElement("CurHp");
		double damage = a.GetPropertyElement ("Monster_Damage");
		double attack_Speed = a.GetPropertyElement ("Monster_Attack_Speed");
		double attackedCount = a.GetPropertyElement ("AttackedCount");
		double defensive = a.GetPropertyElement("Defensive");
		double total_hp = a.GetPropertyElement ("HP");
		
		double geneA, geneC, geneD;
		double pointX = a.GetPropertyElement ("PositionX");
		double pointY = a.GetPropertyElement ("PositionY");
		Vector2 a_v;
		
		GameObject Target_Temp;
		if (a.GetPropertyElement ("Type") == 1) 
		{
			for (int i = 0; i < b.Length; i++) 
			{
				if(b[i].GetPropertyElement("CurHp") <=0)
					continue;
				if(a.GetPropertyElement("Type") != b[i].GetPropertyElement("Type"))
				{
					Target_Temp = GameObject.Find (b[i].ObjectID);
					a_v= new Vector2((float)pointX,(float)pointY);
					dis = Vector2.Distance (a_v, Target_Temp.transform.position);
					if (dis < a.GetPropertyElement("Monster_Range")) 
					{
						tempValue = 100000.0d - b[i].GetPropertyElement("CurHp")+100000;
						if(MaxValue < tempValue)
						{
							MaxValue = tempValue;
							a.SetPropertyElement("Attack_Target",b[i].GetPropertyElement("ID"));
							a.SetPropertyElement("Monster_Enemy_Defensive",b[i].GetPropertyElement("Monster_Defensive"));
							a.SetPropertyElement("Monster_Enemy_CurHp",b[i].GetPropertyElement("CurHp"));
						}       
					}
				}
			}
			
			return MaxValue;
		}
		
		if(SimulationType == 1)
		{
			geneA = 192.0d;
			geneC = 20.0d;
			geneD = 2.4d;
		}
		else
		{
			geneA = a.GetActionObject("Attack").FindWeight ("Attack_Gene_A");
			geneC = a.GetActionObject("Attack").FindWeight ("Attack_Gene_C");
			geneD = a.GetActionObject("Attack").FindWeight ("Attack_Gene_D");
		}
		
	
		for (int i = 0; i < b.Length; i++) 
		{
			if(b[i].GetPropertyElement("CurHp") <=0)
				continue;
			if(a.GetPropertyElement("Type") != b[i].GetPropertyElement("Type"))
			{
				Target_Temp = GameObject.Find (b[i].ObjectID);
				a_v= new Vector2((float)pointX,(float)pointY);
				dis = Vector2.Distance (a_v, Target_Temp.transform.position);
				if (dis < a.GetPropertyElement("Monster_Range")) 
				{
					tempValue =((scoreConversion(-1.0d * b[i].GetPropertyElement("HP"),b[i].GetPropertyElement("CurHp"))*geneA)+
					            (scoreConversion(-25.0d,a.GetPropertyElement("AttackedCount"))*geneC)+
					            (scoreConversion(-19.0d,dis)*geneD)
					            );
					if(MaxValue < tempValue)
					{
						MaxValue = tempValue;
						a.SetPropertyElement("Attack_Target",b[i].GetPropertyElement("ID"));
						a.SetPropertyElement("Monster_Enemy_Defensive",b[i].GetPropertyElement("Monster_Defensive"));
						a.SetPropertyElement("Monster_Enemy_CurHp",b[i].GetPropertyElement("CurHp"));
					}       
				}
			}
		}
		
		return MaxValue;
		
		
	}
开发者ID:notear0,项目名称:SIMONFramework,代码行数:89,代码来源:SIMON_Controller.cs

示例9: monster_Skill_Strength

	public Object monster_Skill_Strength(SIMONObject a, SIMONObject[] b)
	{
		a.SetPropertyElement ("Skill_number", 1);
		return null;
	}
开发者ID:notear0,项目名称:SIMONFramework,代码行数:5,代码来源:SIMON_Controller.cs

示例10: ExecutionFinish

	public object ExecutionFinish(SIMONObject s, SIMONObject[] o){
		if(CurrentIteration<ObjectSize)
		{
			Debug.Log(CurrentIteration+" "+s.GetPropertyElement("Angle1")+" "+s.GetPropertyElement("Angle2")+" "+ball.position.x);
			save (s);
			init ();
			state = (State)(((int)state + 1) % StateNumber);
			s.SetPropertyElement ("State", (double)State.Init);
		}
		else //save & learn
		{
			SIMON.GlobalSIMON.SIMONLearn(ObjectList);

			IterationFlag = true;
			save (s);
			init ();
			state = (State)(((int)state + 1) % StateNumber);
			s.SetPropertyElement ("State", (double)State.Init);
		}

		return 1.0;
	}
开发者ID:notear0,项目名称:SIMONFramework,代码行数:22,代码来源:controller_script.cs

示例11: save2

	void save2(SIMONObject s)
	{
		s.SetPropertyElement("Result", ball.position.x);
		//ObjectList.Add (s.ObjectID, s);
		CurrentIteration++;
	}
开发者ID:notear0,项目名称:SIMONFramework,代码行数:6,代码来源:controller_script.cs

示例12: ExecutionShoot

	public object ExecutionShoot(SIMONObject s, SIMONObject[] o){
		if(ball.position.y < position_limit)
		{
			state = (State)(((int)state + 1) % StateNumber);
			s.SetPropertyElement ("State", (double)State.Finish);
		}
		return 1.0;
	}
开发者ID:notear0,项目名称:SIMONFramework,代码行数:8,代码来源:controller_script.cs

示例13: ExecutionArm2

	public object ExecutionArm2(SIMONObject s, SIMONObject[] o){
		//Debug.Log((double)s.GetPropertyElement("Angle2")+" "+arm2.rotation.eulerAngles.z+" "+(arm2.rotation.eulerAngles.z-(float)s.GetPropertyElement("Angle2")));

		if(Mathf.Abs( arm2.rotation.eulerAngles.z-a12) <= angle_error )
		{
			//Debug.Log((double)s.GetPropertyElement("Angle2")+" "+arm2.rotation.eulerAngles.z+" "+(arm2.rotation.eulerAngles.z-(float)s.GetPropertyElement("Angle2")));
			state = (State)(((int)state + 1) % StateNumber);
			s.SetPropertyElement ("State", (double)State.Shoot);
		}
		return 1.0;
	}
开发者ID:notear0,项目名称:SIMONFramework,代码行数:11,代码来源:controller_script.cs

示例14: ExecutionStart

	public object ExecutionStart(SIMONObject s, SIMONObject[] o){
		state = (State)(((int)state + 1) % StateNumber);
		s.SetPropertyElement ("State", (double)State.Phase1);
		return 1.0;
	}
开发者ID:notear0,项目名称:SIMONFramework,代码行数:5,代码来源:controller_script.cs

示例15: ActionFunction_Skill_Critical

	public System.Object ActionFunction_Skill_Critical(SIMONObject a, SIMONObject[] b)
	{
		double MaxValue= -1000000.0d;
		double hp =a.GetPropertyElement("CurHp");
		double damage = a.GetPropertyElement ("Monster_Damage");
		double attack_Speed = a.GetPropertyElement ("Monster_Attack_Speed");
		double tempValue = 0.0d;
		double geneA, geneB, geneC ,geneD;
		double pointX = a.GetPropertyElement ("PositionX");
		double pointY = a.GetPropertyElement ("PositionY");
		Vector2 a_v;
		
		GameObject Target_Temp;
		
		if (a.GetPropertyElement ("Critical") < 20)
			return MaxValue;
		
		if (a.GetPropertyElement ("Type") == 1) 
		{
			if (isSkillCoolTime((float)a.GetPropertyElement("coolTime_Skill_Start_4")) && !isSkill) 
			{
				a.SetPropertyElement("coolTime_Skill_Start_4",(double)Time.time);
				MaxValue = 1000000.0d;
			}
			return MaxValue;
		}
		if(SimulationType == 1)
		{
			geneA = -2.0d;
			geneB = 195.0d;
			geneC = 43.0d;
			geneD = -3.0d;
		}
		else
		{
			geneA =	a.GetActionObject("Skill_Critical"  ).FindWeight ("Critical_Gene_A");
			geneB =	a.GetActionObject("Skill_Critical"  ).FindWeight ("Critical_Gene_B");
			geneC =	a.GetActionObject("Skill_Critical"  ).FindWeight ("Critical_Gene_C");
			geneD = a.GetActionObject("Skill_Critical"  ).FindWeight ("Critical_Gene_D");
		}

		
		
	
		if (isSkillCoolTime((float)a.GetPropertyElement("coolTime_Skill_Start_4")) && !isSkill) 
		{
			a.SetPropertyElement("coolTime_Skill_Start_4",(double)Time.time);
			for(int i = 0 ; i < b.Length ; i++)
			{
				if(b[i].GetPropertyElement("CurHp") <=0)
					continue;
				if(a.GetPropertyElement("Type") != b[i].GetPropertyElement("Type"))
				{
					
					Target_Temp = GameObject.Find (b[i].ObjectID);
					a_v= new Vector2((float)pointX,(float)pointY);
					dis = Vector2.Distance (a_v, Target_Temp.transform.position);
					tempValue =((scoreConversion(-1.0d * b[i].GetPropertyElement("HP"),b[i].GetPropertyElement("CurHp"))*geneA)+
					            (scoreConversion(25.0d,b[i].GetPropertyElement("AttackedCount"))*geneB)+
					            (scoreConversion(-25.0d,a.GetPropertyElement("AttackedCount"))*geneC)+
					            (scoreConversion(-19.0d,dis)*geneD)
					            )*2.0d;
					if(MaxValue < tempValue)
					{
						MaxValue = tempValue;
					}
				}
			}
		}
		return MaxValue;
	}
开发者ID:notear0,项目名称:SIMONFramework,代码行数:71,代码来源:SIMON_Controller.cs


注:本文中的SIMONFramework.SIMONObject.SetPropertyElement方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。