本文整理汇总了C#中Fish.Init方法的典型用法代码示例。如果您正苦于以下问题:C# Fish.Init方法的具体用法?C# Fish.Init怎么用?C# Fish.Init使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Fish
的用法示例。
在下文中一共展示了Fish.Init方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: SetType
public void SetType(FishType i_type)
{
switch (i_type)
{
case FishType.RedFish:
GetComponentInChildren<MeshRenderer>().sharedMaterial = blockMaterials[0];
m_fish = new RedFish();
m_fish.Init(FishType.RedFish);
break;
case FishType.GreenFish:
GetComponentInChildren<MeshRenderer>().sharedMaterial = blockMaterials[1];
m_fish = new GreenFish();
m_fish.Init(FishType.GreenFish);
break;
case FishType.BlueFish:
GetComponentInChildren<MeshRenderer>().sharedMaterial = blockMaterials[2];
m_fish = new BlueFish();
m_fish.Init(FishType.BlueFish);
break;
case FishType.CopperFish:
GetComponentInChildren<MeshRenderer>().sharedMaterial = blockMaterials[3];
m_fish = new CopperFish();
m_fish.Init(FishType.CopperFish);
break;
case FishType.SilverFish:
GetComponentInChildren<MeshRenderer>().sharedMaterial = blockMaterials[4];
m_fish = new SilverFish();
m_fish.Init(FishType.SilverFish);
break;
case FishType.GoldFish:
GetComponentInChildren<MeshRenderer>().sharedMaterial = blockMaterials[5];
m_fish = new GoldFish();
m_fish.Init(FishType.GoldFish);
break;
}
}