// Use this for initialization void Start() { myFish = new Fish(0, 0f); myStar = new Star(0, 0f); myBone = new FishBone(0, 0f); player = GameObject.FindGameObjectWithTag("Player"); playerHealth = player.GetComponent <PlayerHealth>(); playerMovement = player.GetComponent <PlayerMovement>(); }
public FishBone Update(FishBone updateFish) { using (var scope = _serviceProvider.CreateScope()) { var _ctx = scope.ServiceProvider.GetService(typeof(SQLHoshinCoreContext)) as SQLHoshinCoreContext; var fishBone = _ctx.Fishbone.Where(x => x.FishboneID == updateFish.FishboneID).FirstOrDefault(); fishBone.Name = updateFish.Name; fishBone.Color = updateFish.Color; fishBone.Active = updateFish.Active; _ctx.Update(fishBone); _ctx.SaveChanges(); return(updateFish); } }
public FishBone Add(FishBone newFishBone) { using (var scope = _serviceProvider.CreateScope()) { var _ctx = scope.ServiceProvider.GetService(typeof(SQLHoshinCoreContext)) as SQLHoshinCoreContext; var fishBone = new Fishbone(); fishBone.Active = newFishBone.Active; fishBone.Color = newFishBone.Color; fishBone.Name = newFishBone.Name; _ctx.Fishbone.Add(fishBone); _ctx.SaveChanges(); newFishBone.FishboneID = newFishBone.FishboneID; return(newFishBone); } }