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


C# Critter.GetLocomotion方法代码示例

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


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

示例1: GetTokenSpriteOptions

    public static Sprite[] GetTokenSpriteOptions(Critter critter)
    {
        Critter.locomotionType[] locomotions = critter.GetLocomotion();

        tokenSpriteOptions = PopulateTokenSpriteOptions(locomotions).ToArray();

        return tokenSpriteOptions;
    }
开发者ID:Paulgherve1,项目名称:Critters,代码行数:8,代码来源:GameController.cs

示例2: Activate

    public void Activate(Critter newCritter)
    {
        if (!hex)
        {
            hex = GetComponentInParent<Hex>();
            Image[] tempIcons = GetComponentsInChildren<Image>();
            List<Image> addedIcons = new List<Image>();

            for (int i = 0; i < tempIcons.Length; i += 2)
            {
                addedIcons.Add(tempIcons[i]);
            }

            icons = addedIcons.ToArray();

            locoSprites = Resources.LoadAll<Sprite>("LocomotionIcons");
        }

        critter = newCritter;

        if (critter)
        {
            if (!gameObject.activeInHierarchy)
            {
                gameObject.SetActive(true);

                Populate(hex);
            }
            else
            {
                if (locomotion.Length != critter.GetLocomotion().Length || restrictions.Length != critter.GetRestrictions().Length)
                {
                    Populate(hex);
                }
            }
        }
    }
开发者ID:Paulgherve1,项目名称:Critters,代码行数:37,代码来源:HexRestrictions.cs

示例3: SetLocoIcons

    //Determines Critter locomotion icons based on locomotion types.
    private void SetLocoIcons(Critter critter)
    {
        loco = critter.GetLocomotion();

        locoIcons.Clear();
        iconColors.Clear();

        Sprite[] locoSprites = Resources.LoadAll<Sprite>("LocomotionIcons");

        for(int i = 0; i < loco.Length; i++){
            Critter.locomotionType strat = loco[i];

            if(strat == Critter.locomotionType.AMPHIBIOUS){
                if(!locoIcons.Contains(locoSprites[0])){
                    locoIcons.Add(locoSprites[0]);
                    iconColors.Add(locoColors[0]);
                }
            }
            if(strat == Critter.locomotionType.AQUATIC){
                if(!locoIcons.Contains(locoSprites[1])){
                    locoIcons.Add(locoSprites[1]);
                    iconColors.Add(locoColors[1]);
                }
            }
            if(strat == Critter.locomotionType.AVIAN){
                if(!locoIcons.Contains(locoSprites[3])){
                    locoIcons.Add(locoSprites[3]);
                    iconColors.Add(locoColors[2]);
                }
            }
            if(strat == Critter.locomotionType.TERRESTRIAL){
                if(!locoIcons.Contains(locoSprites[2])){
                    locoIcons.Add(locoSprites[2]);
                    iconColors.Add(locoColors[3]);
                }
            }
        }
        locoIcons.TrimExcess();
        iconColors.TrimExcess();
    }
开发者ID:Paulgherve1,项目名称:Critters,代码行数:41,代码来源:CritterLine.cs

示例4: SetLocoIcons

    //Determines Critter locomotion icons based on locomotion types.
    private void SetLocoIcons(Critter target)
    {
        Critter.locomotionType[] loco = target.GetLocomotion();

        for(int i = 0; i < loco.Length; i++){
            Critter.locomotionType strat = loco[i];

            if(strat == Critter.locomotionType.AMPHIBIOUS){
                if(!locoIcons.Contains(locoSprites[0])){
                    locoIcons.Add(locoSprites[0]);
                    iconColors.Add(locoColors[0]);
                }
            }
            if(strat == Critter.locomotionType.AQUATIC){
                if(!locoIcons.Contains(locoSprites[1])){
                    locoIcons.Add(locoSprites[1]);
                    iconColors.Add(locoColors[1]);
                }
            }
            if (strat == Critter.locomotionType.AVIAN){
                if(!locoIcons.Contains(locoSprites[3])){
                    locoIcons.Add(locoSprites[3]);
                    iconColors.Add(locoColors[2]);
                }
            }
            if (strat == Critter.locomotionType.TERRESTRIAL)
            {
                if (!locoIcons.Contains(locoSprites[2]))
                {
                    locoIcons.Add(locoSprites[2]);
                    iconColors.Add(locoColors[3]);
                }
            }
        }

        locoIcons.TrimExcess();
    }
开发者ID:Paulgherve1,项目名称:Critters,代码行数:38,代码来源:CitterDetails.cs


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