Пример #1
0
	public float GetCost(ObjectInteraction obj){
		// lets try something based on:  skill fit, number of lines, distance to the character?
		
		Vector3 skillLocation = new Vector3(0,0,0);
		if (skillVector != null && skillVector.Length>0) skillLocation = skillVector[0];
		
		float cost = extraCost;
		float skillFactor = 1;
		if (obj != null) skillFactor = (1.0f+obj.SkillMetric(skillLocation));
		cost+= scriptLines.Length*skillFactor;
		
		// we could add in a factor for distance to travel to perform this task
		if (obj != null)
			cost += MoveDistance(obj.gameObject);

		// add a penalty if the script isn't ready
		if (!isReadyFor(obj)) cost+= 10;
		if (!isReadyToRun(obj,false)) cost+= 10;
		
		return cost;
	}