async Task LoadTVShowSeason(int tv_id, int season_number, string showName) { Item = await Task.Run(() => TMDbService.GetDetailedTVShowSeasonAsync(tv_id, season_number, showName)); Item.poster_path = ""; PosterSource.Clear(); foreach (var posterItem in Item.images.posters) { PosterSource.Add(posterItem); } CastSource.Clear(); foreach (var castItem in Item.credits.cast) { CastSource.Add(castItem); } CrewSource.Clear(); foreach (var crewItem in Item.credits.crew) { CrewSource.Add(crewItem); } EpisodeSource.Clear(); foreach (var episodeItem in Item.episodes) { EpisodeSource.Add(episodeItem); } LoadCompleted(); }
public void UpdateSpell(Spell newSpell, CastSource castSource) { var slot = weaponSlot; switch (castSource) { case CastSource.Weapon: weaponSpell = newSpell; break; case CastSource.Armor: armorSpell = newSpell; slot = armorSlot; break; case CastSource.Pet: petSpell = newSpell; slot = petSlot; break; default: weaponSpell = newSpell; break; } UpdateSpellSlotUI(slot, newSpell != null ? newSpell.SpellIcon : null); }
public void Cast(/*GameObject combatTarget, */ CastSource castSource) { var energyPlayer = FindObjectOfType <EnergyGlobeControl>(); // Start attack action GetComponent <ActionScheduler>().StartAction(this); InitSpellToCast(castSource); if (_spellToCast == null) { GameManager.Instance.FeedbackMessage.SetMessage("Vous n'avez pas de sort lié à cette touche"); return; } if (_spellToCast.IsSpellOnCooldown()) { return; } if (CompareTag("Player") && !energyPlayer.HasEnoughEnergy(_spellToCast.spellCost)) { return; } // Define target //Target = combatTarget.GetComponent<Health>(); _castSource = castSource; CastBehaviour(); }
private void CastSpell(CastSource castSource, Spell spell) { if (spell.IsSpellOnCooldown()) { return; } StartCoroutine(UpdateTimeBetweenSpell()); _aiController.UpdateRestTimer(restTimer); _fighterSpell.Cast(castSource); }
async Task LoadMovie(int id) { Item = await TMDbService.GetDetailedFilmAsync(id); Item.poster_path = ""; Item.backdrop_path = ""; PosterSource.Clear(); foreach (var posterItem in Item.images.posters) { PosterSource.Add(posterItem); } BackdropSource.Clear(); foreach (var backdropItem in Item.images.backdrops) { BackdropSource.Add(backdropItem); } ReviewSource.Clear(); foreach (var reviewItem in Item.reviews.results) { ReviewSource.Add(reviewItem); } CollectionSource.Clear(); if (Item.belongs_to_collection != null && Item.collection_films != null) { foreach (var collectionItem in Item.collection_films) { CollectionSource.Add(collectionItem); } } RecommendationsSource.Clear(); foreach (var recommendationItem in Item.recommendations.results) { RecommendationsSource.Add(recommendationItem); } CastSource.Clear(); foreach (var castItem in Item.credits.cast) { CastSource.Add(castItem); } CrewSource.Clear(); foreach (var crewItem in Item.credits.crew) { CrewSource.Add(crewItem); } LoadCompleted(); }
public void Reset(CastSource source) { if (sources.Contains(source)) { sources.Remove(source); } if (sources.Count() > 0) { return; } SetGravity(useGravity); }
async Task LoadTVShow(int id) { Item = await Task.Run(() => TMDbService.GetDetailedTVShowAsync(id)); Item.poster_path = ""; Item.backdrop_path = ""; PosterSource.Clear(); foreach (var posterItem in Item.images.posters) { PosterSource.Add(posterItem); } BackdropSource.Clear(); foreach (var backdropItem in Item.images.backdrops) { BackdropSource.Add(backdropItem); } ReviewSource.Clear(); foreach (var reviewItem in Item.reviews.results) { ReviewSource.Add(reviewItem); } RecommendationsSource.Clear(); foreach (var recommendationItem in Item.recommendations.results) { RecommendationsSource.Add(recommendationItem); } CastSource.Clear(); foreach (var castItem in Item.credits.cast) { CastSource.Add(castItem); } CrewSource.Clear(); foreach (var crewItem in Item.credits.crew) { CrewSource.Add(crewItem); } SeasonSource.Clear(); foreach (var seasonItem in Item.seasons) { SeasonSource.Add(seasonItem); } LoadCompleted(); }
public void Set(CastSource source) { item = item ?? GetComponent <Item>(); if (!sources.Contains(source)) { sources.Add(source); } if (sources.Count() > 1) { return; } startHeading = item.transform.forward; useGravity = item.rb.useGravity; }
async Task LoadPerson(int id) { Item = await Task.Run(() => TMDbService.GetDetailedPersonAsync(id)); Item.profile_path = ""; ProfilesSource.Clear(); foreach (var imageItem in Item.images.profiles) { ProfilesSource.Add(imageItem); } TaggedImagesSource.Clear(); foreach (var taggedImageItem in Item.tagged_images.results) { TaggedImagesSource.Add(taggedImageItem); } CastSource.Clear(); foreach (var castItem in Item.combined_credits.cast) { CastSource.Add(castItem); } CrewSource.Clear(); foreach (var crewItem in Item.combined_credits.crew) { CrewSource.Add(crewItem); } PermanentCast.Clear(); foreach (var permCastItem in CastSource) { PermanentCast.Add(permCastItem); } PermanentCrew.Clear(); foreach (var permCrewItem in CrewSource) { PermanentCrew.Add(permCrewItem); } LoadCompleted(); }
public void Throw(Vector3 velocity, CastSource source) { base.Throw(velocity); isActive = false; items.ForEach(item => item?.HeldItem()?.Reset(source)); particleGrid?.vfx.SetInt("State", 2); particleGrid?.vfx.SetVector3("Force", Quaternion.Inverse(spellCaster.ragdollHand.transform.rotation) * velocity); foreach (Item item in items) { if (!item) { continue; } item.rb.velocity = Vector3.zero; if (item.rb.mass < 1.0f) { item.rb.AddForce(velocity * throwVelocity, ForceMode.Impulse); } else { item.rb.AddForce(velocity * throwVelocity * item.rb.mass / 2.0f, ForceMode.Impulse); } item.Throw(); } foreach (Creature npc in creatures) { if (npc.FreezeData().IsCreatureFrozen) { FreezeController.Instance.UnFreezeCreature(npc); } foreach (RagdollPart part in npc.ragdoll.parts) { part.rb.velocity = Vector3.zero; if (part.rb.mass < 1.0f) { part.rb.AddForce(velocity * throwVelocity, ForceMode.Impulse); } else { part.rb.AddForce(velocity * throwVelocity * part.rb.mass / 2.0f, ForceMode.Impulse); } } } }
private void InitSpellToCast(CastSource castSource) { switch (castSource) { case CastSource.Weapon: _spellToCast = weaponSpell; break; case CastSource.Armor: _spellToCast = armorSpell; break; case CastSource.Pet: _spellToCast = petSpell; break; default: _spellToCast = weaponSpell; break; } }
public static string AsString(this CastSource <decimal> source) { return(source.value.ToString("0.#############################")); // 28-29 digits of precision }
public static string AsStringLowercase(this CastSource <bool> source) { return(source.value ? "true" : "false"); }
public void PutOnCooldown(CastSource castSource) { CooldownManager.instance.StartCooldown(this, castSource); }
public static string AsString(this CastSource <bool> source) { return(source.value ? "True" : "False"); }
public static string AsString(this CastSource <sbyte> source) { return(source.value.ToString()); }
public static string AsString(this CastSource <float> source) { return(source.value.ToString("0.#########")); // 6-9 digits of precision }