Esempio n. 1
0
 public Tool GetPrefab(Tool.Type type)
 {
     foreach (var toolInfo in toolsInfos)
     {
         if (toolInfo.type == type)
         {
             return(toolInfo.prefab);
         }
     }
     return(null);
 }
Esempio n. 2
0
 private void GetTool()
 {
     foreach (var touchingGrabbable in touchingGrabbables)
     {
         if (touchingGrabbable.CanBeGrabbed())
         {
             holdingToolType = touchingGrabbable.GetToolType();
             touchingGrabbable.BeGrabbed();
             toolAudioSource.Play();
             isHoldingTool        = true;
             myToolSprite.enabled = true;
             anim.SetBool("Carrying", true);
             myToolSprite.sprite = toolSpriteList.sprites[toolSpriteList.types.IndexOf(holdingToolType)];
             break;
         }
     }
 }