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


C# Resource.GetResourceType方法代码示例

本文整理汇总了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;
        }
    }
开发者ID:Strathcona,项目名称:SpaceGame,代码行数:18,代码来源:HarvestCommand.cs

示例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;
    }
开发者ID:Phelisse,项目名称:Elynium,代码行数:14,代码来源:Harvester.cs

示例3: StartHarvest

 private void StartHarvest(Resource resource)
 {
     StartMove(resource.transform.position, resource.gameObject);
     harvestType = resource.GetResourceType();
     harvesting = true;
 }
开发者ID:SebastianKaindl,项目名称:TabletopGenerals,代码行数:6,代码来源:Unit.cs

示例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;
 }
开发者ID:sentonnes,项目名称:RTS-Framework,代码行数:16,代码来源:Harvester.cs

示例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;
        }
    }
开发者ID:urbanek32,项目名称:SharpWars_GameCore,代码行数:24,代码来源:Harvester.cs

示例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;
 }
开发者ID:hansmei,项目名称:AgeCraft,代码行数:13,代码来源:Worker.cs

示例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;
 }
开发者ID:acenode,项目名称:unity-rts-demo,代码行数:14,代码来源:Harvester.cs


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