本文整理汇总了C#中Mogre.ToString方法的典型用法代码示例。如果您正苦于以下问题:C# Mogre.ToString方法的具体用法?C# Mogre.ToString怎么用?C# Mogre.ToString使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Mogre
的用法示例。
在下文中一共展示了Mogre.ToString方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: OnRightClick
/// <summary>
/// Selectes the targeted group and finds out info about object where the mouse clicked.
/// After that calls OnRightMouseClick on group and depending on the response is called
/// the appropriate action.
/// </summary>
/// <param Name="clickedPoint">The mouse position.</param>
/// <param Name="selectedObjects">The objects in clicked area.</param>
public void OnRightClick(Mogre.Vector3 clickedPoint, List<Mogre.MovableObject> selectedObjects)
{
Mogre.MovableObject hitObject;
bool isFriendly = true;
bool isIMGO = true;
if (selectedObjects.Count == 0) {
// Nothing at clicked area.
hitObject = null;
} else {
hitObject = selectedObjects[0];
Team targetTeam;
// The clicked object is not controllable.
if (!hitTest.IsObjectControllable(hitObject.Name)) return;
if (hitTest.IsObjectMovable(hitObject.Name)) {
// The clicked object is movable.
targetTeam = hitTest.GetIMGO(hitObject.Name).Team;
} else {
// The clicked object is static.
targetTeam = hitTest.GetISGO(hitObject.Name).Team;
isIMGO = false;
}
// Checks if the object is friendly.
isFriendly = teamMgr.AreFriendly(groupMgr.ActiveTeam, targetTeam);
}
// Gets the selected group answer on mouse action (clicked position).
var answer = groupMgr.SelectInfoGroup(clickedPoint, hitObject, isFriendly, isIMGO);
Game.IEffectPlayer.PlayEffect(groupSelectedSound); // Plays effect
// Chooses the next action by the group reply.
switch (answer) {
case ActionAnswer.Move:
Game.PrintToGameConsole("Group from team " + groupMgr.GetActiveMovableGroup().Team.Name + " moving to " + clickedPoint.ToString());
moveMgr.GoToLocation(groupMgr.GetActiveMovableGroup(), clickedPoint);
break;
case ActionAnswer.MoveTo:
moveMgr.GoToTarget(groupMgr.GetActiveMovableGroup(), hitTest.GetGameObject(hitObject.Name));
break;
case ActionAnswer.Attack:
fightMgr.Attack(groupMgr.GetActiveMovableGroup(), hitTest.GetGameObject(hitObject.Name));
break;
case ActionAnswer.Occupy:
fightMgr.Occupy(groupMgr.GetActiveMovableGroup(), hitTest.GetGameObject(hitObject.Name));
break;
}
}