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


C# TargetType.ToString方法代码示例

本文整理汇总了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;
    }
开发者ID:andrey-ushakov,项目名称:kinect-unity,代码行数:17,代码来源:TargetsFactory.cs

示例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;
    }
开发者ID:andrey-ushakov,项目名称:kinect-unity,代码行数:15,代码来源:TargetsFactory.cs

示例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;
    }
开发者ID:andrey-ushakov,项目名称:kinect-unity,代码行数:47,代码来源:TargetsFactory.cs

示例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()));
 }
开发者ID:rlane187,项目名称:ISXEQ2Wrapper,代码行数:9,代码来源:Extension.cs


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