本文整理汇总了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;
}
示例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);
}
}
}
}
示例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();
}
示例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();
}