// Use this for initialization void Awake () { // Fill the components audioSource = this.GetComponent<AudioSource> (); collider = this.GetComponent<BoxCollider2D> (); sprite = this.GetComponent<SpriteRenderer> (); if (mouthManager != null) { mouthManager.AudioSource = audioSource; } // Subscribe to talkset events onTalkSet = new TalkEventManager.TalkEvent(OnTalkSet); onTalkStop = new TalkEventManager.TalkEvent (OnTalkStop); TalkEventManager.TalkSet += onTalkSet; TalkEventManager.TalkStop += onTalkStop; // Fill the list of played audioclips audioClipsPlayed = new List<bool> (); foreach(AudioClip clip in audioClips) { audioClipsPlayed.Add (false); } if (newMessageUiPrefab && !newMessageUi) { // Adds the UI part newMessageUi = Instantiate (newMessageUiPrefab); newMessageUi.transform.SetParent (this.transform); IsNew = false; // Try to position it according to sprite bounds if (sprite) newMessageUi.transform.position = new Vector3 (sprite.bounds.center.x + sprite.bounds.size.x / 2, sprite.bounds.center.y + sprite.bounds.size.y / 2, sprite.bounds.center.z); } }
void OnAnimationComplete() { state = STATE_SAD; TalkEventManager.TriggerTalkSet(new TalkEventArgs { ID = "piri", AudioClipId = 0, Autoplay = false }); onTalkEnded = new TalkEventManager.TalkEvent (OnTalkEnded);; TalkEventManager.TalkEnded += onTalkEnded; }
void OnAnimationComplete() { state = STATE_SAD; this.gameObject.transform.localScale = new Vector3 (initialScale.x, initialScale.y, initialScale.z);; TalkEventManager.TriggerTalkSet (new TalkEventArgs { ID = "piri", AudioClipId = 0, Autoplay = false }); onTalkEnded = new TalkEventManager.TalkEvent (OnTalkEnded); TalkEventManager.TalkEnded += onTalkEnded; }
// Use this for initialization void Start () { animator = this.GetComponent<Animator> (); initialScale = this.transform.localScale; TalkEventManager.TriggerTalkSet (new TalkEventArgs { ID="piri", AudioClipId=0, Autoplay=false }); onTalkEnded = new TalkEventManager.TalkEvent (OnTalkEnded); TalkEventManager.TalkEnded += onTalkEnded; onWolfStateChange = new WolfEventManager.WolfEvent (OnWolfStateChange); WolfEventManager.WolfChangeState += onWolfStateChange; }
// Use this for initialization void Start () { audioSource = this.GetComponent<AudioSource> (); question1Wrapper.SetActive (false); question2Wrapper.SetActive (false); onTalkEnded = new TalkEventManager.TalkEvent (OnTalkEnded); TalkEventManager.TalkEnded += onTalkEnded; TalkEventManager.TriggerTalkSet (new TalkEventArgs { ID = "brother", AudioClipId = 0, Autoplay = false }); }
// Use this for initialization void Start () { animator = this.GetComponent<Animator>(); listenToCollider = listenTo.GetComponent<BoxCollider2D> (); initialPosition = this.gameObject.transform.position; TalkEventManager.TriggerTalkSet (new TalkEventArgs { ID = "piri", AudioClipId = 0, Autoplay = false }); onTalkEnded = new TalkEventManager.TalkEvent (OnTalkEnded); TalkEventManager.TalkEnded += onTalkEnded; onSoundCapBegin = new MicEventManager.MicEvent (OnSoundCapBegin); MicEventManager.SoundCapBegin += onSoundCapBegin; }
// Use this for initialization void Start () { animator = GetComponent<Animator> (); audioSource = this.GetComponent<AudioSource>(); onTalkEnded = new TalkEventManager.TalkEvent (OnTalkEnded); TalkEventManager.TalkEnded += onTalkEnded; onBlowBegin = new MicEventManager.MicEvent (OnBlowBegin); MicEventManager.BlowBegin += onBlowBegin; onBackdoorToggle = new BackdoorEventManager.BackdoorEvent (OnBackdoorToggle); BackdoorEventManager.BackdoorToggle += onBackdoorToggle; }
// Use this for initialization void Start () { animator = this.GetComponent<Animator> (); hiddenBy_BC = hiddenBy.GetComponent<BoxCollider2D> (); boxCollider = this.GetComponent<BoxCollider2D> (); audioSource = this.GetComponent<AudioSource>(); onTalkEnded = new TalkEventManager.TalkEvent (OnTalkEnded); TalkEventManager.TalkEnded += onTalkEnded; onSoundCapBegin = new MicEventManager.MicEvent (OnSoundCapBegin); MicEventManager.SoundCapBegin += onSoundCapBegin; StartCoroutine (BeginTheTalk ()); }
// Use this for initialization void Start () { bloom = this.GetComponent<BloomOptimized> (); vignette = this.GetComponent<VignetteAndChromaticAberration> (); audioSource = this.GetComponent<AudioSource>(); Hashtable ht = new Hashtable (); ht.Add ("from", 2.5); ht.Add ("to", bloom.intensity); ht.Add ("time", 3); ht.Add ("onupdate", "OnBloomUpdate"); iTween.ValueTo (gameObject, ht); onTalkEnded = new TalkEventManager.TalkEvent (OnTalkEnded); TalkEventManager.TalkEnded += onTalkEnded; }