// OnStateEnter is called when a transition starts and the state machine starts to evaluate this state override public void OnStateEnter(Animator animator, AnimatorStateInfo stateInfo, int layerIndex) { voicePack = animator.GetComponent <AIConfig>().voicePack; animator.GetComponent <NavMeshAgent>().speed = 1.5f; animator.GetComponent <NavMeshAgent>().angularSpeed = 240.0f; animator.GetComponent <NavMeshAgent>().isStopped = false; animator.GetComponent <Ears>().StartFollowingSound(); voiceDelay = Random.Range(AIConfig.minTalkInterval, AIConfig.maxTalkInterval); }
override public void OnStateEnter(Animator animator, AnimatorStateInfo stateInfo, int layerIndex) { voicePack = animator.GetComponent <AIConfig>().voicePack; animator.GetComponent <NavMeshAgent>().speed = 3.0f; animator.GetComponent <NavMeshAgent>().angularSpeed = 360.0f; animator.GetComponent <NavMeshAgent>().acceleration = 10.0f; animator.GetComponent <NavMeshAgent>().isStopped = false; voicePack.PlaySpotted(); FindObjectOfType <MusicManager>().IncrementChasing(); voiceDelay = Random.Range(AIConfig.minTalkInterval, AIConfig.maxTalkInterval); }
//OnStateEnter is called when a transition starts and the state machine starts to evaluate this state override public void OnStateEnter(Animator animator, AnimatorStateInfo stateInfo, int layerIndex) { voicePack = animator.GetComponent <AIConfig>().voicePack; animator.GetComponent <NavMeshAgent>().speed = 1.0f; animator.GetComponent <NavMeshAgent>().angularSpeed = 120.0f; animator.GetComponent <NavMeshAgent>().isStopped = false; patrolStations = animator.gameObject.GetComponent <PatrolStations>(); patrolStations.StartPatrolling(); voiceDelay = Random.Range(AIConfig.minTalkInterval, AIConfig.maxTalkInterval); }
private void btn_AddToQueue_Click(object sender, EventArgs e) { VoicePack selectedItem = (VoicePack)this.cbxAddToQueue.SelectedItem; this.packsDownloader.AddToQueue(selectedItem); if (this.cbxAddToQueue.SelectedIndex + 1 >= this.cbxAddToQueue.Items.Count) { this.cbxAddToQueue.SelectedIndex = 0; return; } ComboBox selectedIndex = this.cbxAddToQueue; selectedIndex.SelectedIndex = selectedIndex.SelectedIndex + 1; }
void Awake() { DynamicCharacterAvatar avatar = GetComponent <DynamicCharacterAvatar>(); switch (characterConfig) { case CharacterConfig.FemaleJanitor: avatar.activeRace.name = "HumanFemale"; voicePack = GameObject.Find("VoicePacks/FemaleJanitor").GetComponent <VoicePack>(); break; case CharacterConfig.MaleBodyguard: avatar.activeRace.name = "HumanMale"; voicePack = GameObject.Find("VoicePacks/MaleBodyguard").GetComponent <VoicePack>(); break; default: Debug.Log("Please select character version first for your AI"); break; } }
private static IEnumerable <Download> GetDownloadList(VoicePack pack) { string patchPathFromUrl = PacksDownloader.GetPatchPathFromUrl(pack.BaseUrl); PatchInfoReader patchInfoReader = PatchInfoReader.Download(Path.Combine(patchPathFromUrl, "patchinfo.xml")); foreach (string kom in pack.Koms) { IEnumerable <PatchInfoEntry> entries = patchInfoReader.Entries; PatchInfoEntry patchInfoEntry = entries.FirstOrDefault <PatchInfoEntry>((PatchInfoEntry e) => e.FileName.Equals(kom, StringComparison.OrdinalIgnoreCase)); if (patchInfoEntry == null) { continue; } string str = Path.Combine(Paths.Main.Packs, pack.PackName, kom); if (File.Exists(str) && patchInfoEntry.Equals(str)) { continue; } str = string.Concat(str, ".tmp"); Uri uri = new Uri(Path.Combine(patchPathFromUrl, "data", kom)); yield return(new Download(uri, patchInfoEntry.Size, str, pack)); } }
// OnStateEnter is called when a transition starts and the state machine starts to evaluate this state override public void OnStateEnter(Animator animator, AnimatorStateInfo stateInfo, int layerIndex) { voicePack = animator.GetComponent <AIConfig>().voicePack; timer = 0.0f; animator.GetComponent <NavMeshAgent>().isStopped = true; }
public void RemoveFromQueue(VoicePack pack) { this._downloadQueue.RemoveAll((Download d) => d.VoicePack == pack); this.PacksQueue.Remove(pack); }
public static bool HasUpdates(VoicePack pack) { return(PacksDownloader.GetDownloadList(pack).Any <Download>()); }
public void AddToQueue(VoicePack pack) { this.PacksQueue.AddIfNew <VoicePack>(pack); }