本文整理汇总了C#中Resource.GetResourceType方法的典型用法代码示例。如果您正苦于以下问题:C# Resource.GetResourceType方法的具体用法?C# Resource.GetResourceType怎么用?C# Resource.GetResourceType使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Resource
的用法示例。
在下文中一共展示了Resource.GetResourceType方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: HarvestCommand
public HarvestCommand(Unit unit, Resource resource)
{
if (unit.canharvest) { //sanity check (I don't think this is need though)
this.unit = unit;
this.resource = resource;
if(harvesttype == ResourceType.None || harvesttype !=resource.GetResourceType()) { //ensure we are carrying the right resource
harvesttype = resource.GetResourceType();
unit.currentload = 0.0f;
}
harvesting = true;
moveCommand = new MoveCommand (unit, resource.transform.position);
unit.IssueSubCommand (moveCommand);
} else {
complete = true;
}
}
示例2: StartHarvest
/* Private Methods */
private void StartHarvest(Resource resource)
{
resourceDeposit = resource;
//we can only collect one resource at a time, other resources are lost
if (harvestType == ResourceType.Unknown || harvestType != resource.GetResourceType())
{
harvestType = resource.GetResourceType();
currentLoad = 0.0f;
}
harvesting = true;
emptying = false;
}
示例3: StartHarvest
private void StartHarvest(Resource resource)
{
StartMove(resource.transform.position, resource.gameObject);
harvestType = resource.GetResourceType();
harvesting = true;
}
示例4: StartHarvest
private void StartHarvest(Resource resource)
{
resourceDeposit = resource;
WorldObject worldObject = resource.gameObject.GetComponent<WorldObject>();
addMovement(worldObject);
//we can only collect one resource at a time, other resources are lost
if(harvestType == ResourceType.Unknown || harvestType != resource.GetResourceType()) {
harvestType = resource.GetResourceType();
SetResourceColor();
resourceStore = WorkManager.findClosestResourceStore(WorkManager.findResourceStores(harvestType,player), this.gameObject.GetComponent<Unit>());
currentLoad = 0.0f;
}
harvesting = true;
recycling = false;
emptying = false;
}
示例5: StartHarvest
// Private Methods
private void StartHarvest(Resource resource)
{
resourceDeposit = resource;
if(currentLoad >= capacity)
{
StartMove(resourceStore.transform.position, resourceStore.gameObject);
harvesting = false;
emptying = true;
}
else
{
StartMove(resource.transform.position, resource.gameObject);
harvesting = true;
emptying = false;
}
//we can only collect one resource at a time, other resources are lost
if(harvestType == ResourceType.Unknown || harvestType != resource.GetResourceType())
{
harvestType = resource.GetResourceType();
currentLoad = 0.0f;
}
}
示例6: StartHarvest
private void StartHarvest(Resource resource)
{
resourceDeposit = resource;
resourceStores = player.GetComponentsInChildren<Building>();
MoveToLocation(resource.transform.position);
//we can only collect one resource at a time, other resources are lost
if(harvestType != resource.GetResourceType()) {
harvestType = resource.GetResourceType();
currentLoad = 0.0f;
}
harvesting = true;
emptying = false;
}
示例7: StartHarvest
/*** Private Methods ***/
private void StartHarvest(Resource resource)
{
resourceDeposit = resource;
if (audioElement != null) audioElement.Play(startHarvestSound);
StartMove (resource.transform.position, resource.gameObject);
//we can only collect one resource at a time, other resources are lost
if (harvestType == ResourceType.Unknown || harvestType != resource.GetResourceType ()) {
harvestType = resource.GetResourceType();
currentLoad = 0.0f;
}
harvesting = true;
emptying = false;
}