示例#1
0
        public async Task <ActionResult <ToolDetails> > GetTool(long id)
        {
            var tool = await _context
                       .Tools
                       .Include(f => f.Licenses)
                       .FirstOrDefaultAsync(f => f.Id == id);

            if (tool == null)
            {
                return(NotFound());
            }

            return(ToolDetails.FromTool(tool));
        }
示例#2
0
 private void Awake()
 {
     scene = SceneManager.GetActiveScene();
     //only run if Internal tools scene
     if (scene.name.Equals("Internal_Tools", StringComparison.Ordinal) == true)
     {
         //check if instance already exists
         if (i == null)
         {
             i = this;
         }
         //if instance already exists and it's not this
         else if (i != this)
         {
             //Then destroy this in order to reinforce the singleton pattern (can only ever be one instance of toolManager)
             Destroy(gameObject);
         }
         //components
         adventureScript  = GetComponent <AdventureManager>();
         actorScript      = GetComponent <ActorPoolManager>();
         toolDataScript   = GetComponent <ToolDataManager>();
         toolFileScript   = GetComponent <ToolFileManager>();
         toolInputScript  = GetComponent <ToolInput>();
         toolDetailScript = GetComponent <ToolDetails>();
         jointScript      = GetComponent <JointManager>();
         actorFileScript  = GetComponent <ActorFileManager>();
         //gui
         adventureUIScript = AdventureUI.Instance();
         actorPoolUIScript = ActorPoolUI.Instance();
         toolUIScript      = ToolUI.Instance();
         //error Check
         Debug.Assert(adventureScript != null, "Invalid adventureScript (Null)");
         Debug.Assert(actorScript != null, "Invalid actorScript (Null)");
         Debug.Assert(toolDataScript != null, "Invalid toolDataScript (Null)");
         Debug.Assert(adventureUIScript != null, "Invalid adventureUIScript (Null)");
         Debug.Assert(actorPoolUIScript != null, "Invalid actorPoolUIScript (Null)");
         Debug.Assert(toolUIScript != null, "Invalid toolUIScript (Null)");
         Debug.Assert(toolInputScript != null, "Invalid toolInputScript (Null)");
         Debug.Assert(toolDetailScript != null, "Invalid toolDetailScript (Null)");
         Debug.Assert(jointScript != null, "Invalid loadScript (Null)");
         Debug.Assert(actorFileScript != null, "Invalid actorFileScript (Null)");
     }
 }