本文整理汇总了C#中TargetType.ToString方法的典型用法代码示例。如果您正苦于以下问题:C# TargetType.ToString方法的具体用法?C# TargetType.ToString怎么用?C# TargetType.ToString使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类TargetType
的用法示例。
在下文中一共展示了TargetType.ToString方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: ReleaseAllBonusTargetsByType
public static Bonus ReleaseAllBonusTargetsByType(TargetType targetType)
{
Bonus bonus = new Bonus ();
GameObject[] gameObjectsToRelease = GameObject.FindGameObjectsWithTag (targetType.ToString());
foreach(GameObject gameObject in gameObjectsToRelease) {
// add score
Target target = gameObject.GetComponent<Target>();
bonus.Score += target.BonusScore;
bonus.Time += target.BonusTime;
bonus.Life += target.BonusLife;
// release
TargetsFactory.ReleaseTarget(target);
}
return bonus;
}
示例2: ReleaseAllTargetsByType
public static int ReleaseAllTargetsByType(TargetType targetType)
{
int score = 0;
GameObject[] gameObjectsToRelease = GameObject.FindGameObjectsWithTag (targetType.ToString());
foreach(GameObject gameObject in gameObjectsToRelease) {
// add score
Target target = gameObject.GetComponent<Target>();
score += target.Score;
// release
TargetsFactory.ReleaseTarget(target);
}
return score;
}
示例3: InstantiateTarget
private static Target InstantiateTarget(TargetType targetType)
{
GameObject gameObject = null;
if (targetType == TargetType.BottomBonusTarget || targetType == TargetType.TopBonusTarget) {
gameObject = (GameObject)GameObject.Instantiate (Instance.targetBonusPrefab);
} else {
gameObject = (GameObject)GameObject.Instantiate (Instance.targetPrefab);
}
gameObject.SetActive(false);
gameObject.tag = targetType.ToString();
gameObject.transform.parent = TargetsFactory.Instance.gameObject.transform;
Target target = gameObject.GetComponent<Target>();
target.Type = targetType;
target.Score = GameManager.TargetScore;
target.Damage = GameManager.TargetDamage;
target.BonusScore = GameManager.TargetBonusScore;
target.BonusTime = GameManager.TargetBonusTime;
target.BonusLife = GameManager.TargetBonusLife;
switch (targetType) {
case TargetType.TopTarget:
target.Direction = new Vector3(0, 3, -7) * speed;
break;
case TargetType.LeftTarget:
target.Direction = new Vector3(-6, 0, -7) * speed;
break;
case TargetType.RightTarget:
target.Direction = new Vector3(6, 0, -7) * speed;
break;
case TargetType.TopBonusTarget:
target.Direction = new Vector3(0, 3, -7) * speed;
break;
case TargetType.BottomBonusTarget:
target.Direction = new Vector3(0, -3, -7) * speed;
break;
}
TargetsFactory.Instance.targetCount++;
return target;
}
示例4: Target
/// <summary>
/// Targets the nearest actor of the supplied type
/// </summary>
/// <param name="type">target type</param>
public static int Target(TargetType type)
{
Trace.WriteLine(String.Format("Extension:Target({0})", type));
return LavishScript.ExecuteCommand(String.Format("Target {0}", type.ToString().ToLower()));
}