Esempio n. 1
0
    // ---

    void Start()
    {
        rigidbody      = GetComponent <Rigidbody>();
        collider       = GetComponent <CapsuleCollider>();
        animator       = GetComponent <Animator>();
        liver          = GetComponent <Liver>();
        trigger        = GetComponentInChildren <Trigger>();
        trigger.OnStay = OnChildTriggerStay;
        camera         = Camera.main.transform;
        startGravity   = Gravity;

        liver.Health = Game.PlayerHealth ?? liver.Health;
        potionCount  = Game.PotionCount ?? potionCount;

        if (SceneManager.GetActiveScene().name != "OutsideCave")
        {
            var ui = Instantiate(Prefabs.Get("PlayerUi"), GameObject.FindGameObjectWithTag("Canvas").transform);

            liver.SetUi(GameObject.FindGameObjectWithTag("PlayerUiPanel").GetComponent <RectTransform>());
            potionCountUi = GameObject.FindGameObjectWithTag("PotionUiText").GetComponent <TextMeshProUGUI>();
        }

        start  = NormalStart;
        update = NormalUpdate;
        exit   = NormalExit;

        if (Game.spawnPosition != null)
        {
            transform.position = Game.spawnPosition.Value;
            Game.spawnPosition = null;
        }
    }
Esempio n. 2
0
        public async Task <IActionResult> Create(LiverViewModel model)
        {
            if (!_permissions.IsAdmin())
            {
                return(this.NotFound());
            }
            if (ModelState.IsValid)
            {
                var Liver = new Liver()
                {
                    ChannelId   = model.ChannelId,
                    Name        = model.Name,
                    Graduated   = model.Graduated,
                    GroupId     = model.GroupId,
                    TwitterLink = model.TwitterLink
                };
                if (await AddLiverInfo(Liver))
                {
                    _context.Add(Liver);
                    await _context.SaveChangesAsync();

                    return(this.RedirectToAction("Index"));
                }
                else
                {
                    ModelState.AddModelError("ChannelId", "Make sure channel's Id is correct!");
                }
            }
            ViewBag.Groups = new SelectList(await _context.Groups.ToListAsync(), "Id", "Name", model.GroupId);
            return(this.View(model));
        }
        public ActionResult SuppressionConfirmee(int id)
        {
            Liver liver = db.Liver.Find(id);

            db.Liver.Remove(liver);
            db.SaveChanges();
            return(RedirectToAction("Index"));
        }
Esempio n. 4
0
    // Start is called before the first frame update
    void Start()
    {
        liver     = GetComponent <Liver>();
        rigidbody = GetComponent <Rigidbody>();
        animator  = GetComponentInChildren <Animator>();
        scene     = FindObjectOfType <Boss>();

        position = positions.Random();
    }
 public ActionResult Edit(Liver liver)
 {
     if (ModelState.IsValid)
     {
         db.Entry(liver).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     return(View(liver));
 }
        //DetailsLivre
        public ActionResult DetailsLivre(int?id)
        {
            Liver liver = db.Liver.Find(id);

            if (liver == null)
            {
                return(HttpNotFound());
            }
            return(View(liver));
        }
 public ActionResult CreerLivre(Liver liver)
 {
     if (ModelState.IsValid)
     {
         db.Liver.Add(liver);
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     return(View());
 }
Esempio n. 8
0
    void Start()
    {
        liver     = GetComponent <Liver>();
        rigidbody = GetComponent <Rigidbody>();
        animator  = GetComponentInChildren <Animator>();

        healthUi = Instantiate(Prefabs.Get("EnemyHP"), GameObject.FindGameObjectWithTag("Canvas").transform);
        healthUi.GetComponent <UiFollow>().target = hpTarget.transform;
        healthUi.SetActive(false);
        liver.SetUi(healthUi.GetComponentInChildren <HpBar>().GetComponent <RectTransform>());
    }
Esempio n. 9
0
            public Body()
            {
                // Create a brand new pancreas and assign it to this body
                _pancreas = new Pancreas()
                {
                    filtering = true
                };

                // Create a brand new liver and assign it to this body
                _liver = new Liver()
                {
                    poisoned = false
                };
            }
        public ActionResult SupprimerLivre(int?id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            Liver liver = db.Liver.Find(id);

            if (liver == null)
            {
                return(HttpNotFound());
            }
            return(View(liver));
        }
Esempio n. 11
0
        private async Task <Boolean> AddLiverInfo(Liver liver)
        {
            var youtubeService = new YouTubeService(new BaseClientService.Initializer()
            {
                ApiKey          = Variables.API_KEY,
                ApplicationName = this.GetType().ToString()
            });
            var channel_request = youtubeService.Channels.List("snippet,statistics,brandingSettings");

            channel_request.Id = liver.ChannelId;
            try
            {
                var response = (await channel_request.ExecuteAsync()).Items[0];
                liver.ChannelName = response.Snippet.Title;
                liver.Description = response.Snippet.Description;
                liver.Subscribers = (uint)response.Statistics.SubscriberCount;
                liver.Views       = (ulong)response.Statistics.ViewCount;
                if (response.Snippet.Thumbnails.Standard != null)
                {
                    liver.PictureURL = response.Snippet.Thumbnails.Standard.Url;
                }
                else if (response.Snippet.Thumbnails.High != null)
                {
                    liver.PictureURL = response.Snippet.Thumbnails.High.Url;
                }
                else if (response.Snippet.Thumbnails.Medium != null)
                {
                    liver.PictureURL = response.Snippet.Thumbnails.Medium.Url;
                }
                else if (response.Snippet.Thumbnails.Default__ != null)
                {
                    liver.PictureURL = response.Snippet.Thumbnails.Default__.Url;
                }
                liver.ThumbURL = response.Snippet.Thumbnails.Default__.Url;
                if (response.BrandingSettings.Image?.BannerExternalUrl != null)
                {
                    liver.BannerURL = response.BrandingSettings.Image.BannerExternalUrl;
                }
            } catch (NullReferenceException)
            {
                return(false);
            }
            return(true);
        }
Esempio n. 12
0
 public Abdomen(Bone[] abdomenBoneStructure = null, GastrointestinalTract gastrointestinalTract = null, Liver liver = null, Pancreas pancreas = null, UrinaryTract urinaryTract = null, Spleen spleen = null, Reproductive reproductives = null)
 {
     Bones = abdomenBoneStructure ?? DefaultBoneStructures.DefaultAbdomenBones;
     GastrointestinalTract = gastrointestinalTract ?? new GastrointestinalTract();
     Liver         = liver ?? new Liver();
     Pancreas      = pancreas ?? new Pancreas();
     UrinaryTract  = urinaryTract ?? new UrinaryTract();
     Spleen        = spleen ?? new Spleen();
     Reproductives = reproductives ?? new Reproductive_Female();
 }
Esempio n. 13
0
 void Start()
 {
     liver     = GetComponent <Liver>();
     rigidbody = GetComponent <Rigidbody>();
 }
Esempio n. 14
0
 void Start()
 {
     Liver = GetComponentInParent <Liver>();
 }