本文整理汇总了C#中Village.getAction方法的典型用法代码示例。如果您正苦于以下问题:C# Village.getAction方法的具体用法?C# Village.getAction怎么用?C# Village.getAction使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Village
的用法示例。
在下文中一共展示了Village.getAction方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: buildCastle
public void buildCastle(Village v)
{
int vWood = v.getWood ();
VillageType vType = v.getMyType ();
VillageActionType vAction = v.getAction ();
if (vType != VillageType.Fort) {
gameGUI.displayError (@"Upgrade to a Fort before building a Castle");
} else if (vWood < 12) {
gameGUI.displayError (@"Castles require more lumber (12)");
} else if (vAction != VillageActionType.ReadyForOrders) {
gameGUI.displayError (@"You cant queue build orders :/");
} else {
v.setAction(VillageActionType.StartedUpgrading);
v.addWood (-12);
}
}
示例2: upgradeVillage
public void upgradeVillage(Village v)
{
int vWood = v.getWood ();
VillageType vType = v.getMyType ();
VillageActionType vAction = v.getAction ();
if (vType == VillageType.Fort)
{
gameGUI.displayError(@"The only structure stronger than a Fort is a Castle. ¯\(°_o)/¯ Press Build Castle to go to the next level!");
}
else if ((vType != VillageType.Fort) && (vWood >= 8) && (vAction == VillageActionType.ReadyForOrders))
{
//v.setAction (VillageActionType.StartedUpgrading);
v.networkView.RPC ("setVillageActionNet",RPCMode.AllBuffered,(int)VillageActionType.StartedUpgrading);
//v.addWood(-8);
v.networkView.RPC("addWoodNet",RPCMode.AllBuffered,-8);
}
}
示例3: updateVillageActions
public void updateVillageActions(Village v)
{
VillageActionType action = v.getAction ();
if (action == VillageActionType.StartedUpgrading)
{
v.gameObject.networkView.RPC ("setVillageActionNet",RPCMode.AllBuffered,(int)VillageActionType.FinishedUpgrading);
}
else if (action == VillageActionType.FinishedUpgrading)
{
v.gameObject.networkView.RPC ("setVillageActionNet",RPCMode.AllBuffered,(int)VillageActionType.ReadyForOrders);
VillageType vType = v.getMyType();
if (vType == VillageType.Hovel)
{
v.gameObject.networkView.RPC ("switchPrefabNet",RPCMode.AllBuffered,(int)VillageType.Town);
v.gameObject.networkView.RPC ("setVillageTypeNet",RPCMode.AllBuffered,(int)VillageType.Town);
v.gameObject.networkView.RPC ("setHealthNet",RPCMode.AllBuffered,2);
}
else if (vType == VillageType.Town)
{
v.gameObject.networkView.RPC ("switchPrefabNet",RPCMode.AllBuffered,(int)VillageType.Fort);
v.gameObject.networkView.RPC ("setVillageTypeNet",RPCMode.AllBuffered,(int)VillageType.Fort);
v.gameObject.networkView.RPC ("setHealthNet",RPCMode.AllBuffered,5);
}
else if (vType == VillageType.Fort)
{
v.gameObject.networkView.RPC ("switchPrefabNet",RPCMode.AllBuffered,(int)VillageType.Castle);
v.gameObject.networkView.RPC ("setVillageTypeNet",RPCMode.AllBuffered,(int)VillageType.Castle);
v.gameObject.networkView.RPC ("setHealthNet",RPCMode.AllBuffered,10);
v.gameObject.networkView.RPC ("setWageNet",RPCMode.AllBuffered,80);
}
}
}