protected new void Start() { //Cache Components. animator = GetComponent <Animator>(); sprite = GetComponent <SpriteRenderer>(); audioSource = GetComponent <AudioSource>(); ZDAudioSource.SetupAudioSource(audioSource); //Setup TeamID. if (photonView.Owner.CustomProperties.ContainsKey("Team")) { TeamID = (int)photonView.Owner.CustomProperties["Team"]; } else { TeamID = -1; } //Register To GameManager. if (ZDGameManager.Instance) { ZDGameManager.Instance.CharacterList.Add(this); } //Setup Depth if (photonView.IsMine) { ActorType = EActorType.LocalCharacter; } else { ActorType = EActorType.RemoteCharacter; } base.Start(); }
public void DoDeadRpc() { if (animator) { animator.SetTrigger("Die"); } ZDAudioSource.PlayAtPoint(DeathSound, transform.position, 1, false); }
protected new void Start() { ActorCustomDepthShift = (int)ZDGameRule.WorldToUnit(transform.position).x % 2 == 0 ? -1e-5f :1e-5f; base.Start(); animator = GetComponent <Animator>(); audioSource = GetComponent <AudioSource>(); ZDAudioSource.SetupAudioSource(audioSource); //StartCoroutine(PauseAndPlay()); }
void PerformBroken() { if (BrokenEffect) { Instantiate(BrokenEffect, transform.position, Quaternion.identity); } if (BrokenAudio) { ZDAudioSource.PlayAtPoint(BrokenAudio, transform.position, 1.0f); } if (animator) { animator.SetTrigger("Broken"); } }
// Start is called before the first frame update void Start() { audioSource = GetComponent <AudioSource>(); if (audioSource) { ZDAudioSource.SetupAudioSource(audioSource); audioSource.clip = clip; audioSource.volume = vol; audioSource.loop = loop; audioSource.Play(); enabled = true; } else { Destroy(gameObject); } }
public void PlaySound(AudioClip clip) { ZDAudioSource.PlayAtPoint(clip, transform.position, PlaySoundVolume); }