// Use this for initialization void Start() { this.hero = Hero.singleton; this.background = BackgroundClick.singleton; this.backgroundAudioSource = this.GetComponent <AudioSource> (); this.zapAudioSource = this.gameObject.AddComponent <AudioSource> (); this.zapAudioSource.clip = this.noteFailClip; this.noteNameToSource = new Dictionary <string, AudioSource> (); foreach (AudioClip clip in this.noteClips) { AudioSource src = this.gameObject.AddComponent <AudioSource>(); src.clip = clip; clip.LoadAudioData(); this.noteNameToSource[clip.name] = src; } this.InitLives(); AudioClip backgroundClip = buildingsBackground; this.backgroundAudioSource.clip = backgroundClip; this.backgroundAudioSource.Play(); completingLevel = false; if (this.tutorial != null) { finishedTutorial = false; StartCoroutine(StartTutorial()); } }
// Use this for initialization void Start() { if (!this.isTutorialLevel) { this.tutorialLevelIndicator.GetComponent <SpriteRenderer> ().enabled = false; } this.hero = Hero.singleton; this.background = BackgroundClick.singleton; this.backgroundAudioSource = this.GetComponent <AudioSource> (); this.zapAudioSource = this.gameObject.AddComponent <AudioSource> (); this.zapAudioSource.clip = this.noteFailClip; this.noteNameToSource = new Dictionary <string, AudioSource> (); foreach (AudioClip clip in this.noteClips) { AudioSource src = this.gameObject.AddComponent <AudioSource>(); src.clip = clip; clip.LoadAudioData(); this.noteNameToSource[clip.name] = src; } this.InitLives(); AudioClip backgroundClip = buildingsBackground; this.backgroundAudioSource.clip = backgroundClip; this.backgroundAudioSource.Play(); this.InitTutorials(); }
protected void Start() { this.supporting = new List <Minion>(); this.initialPosition = this.transform.position; this.lastRestingPosition = this.initialPosition; this.hero = Hero.singleton; this.clicksEnabled = true; this.background = BackgroundClick.singleton; this.backgroundCollider = background.GetComponent <Collider2D> (); LevelManager.singleton.RegisterMinion(this); this.height = this.GetComponent <SpriteRenderer>().bounds.size.y; this.width = this.GetComponent <SpriteRenderer>().bounds.size.x; }
public override void Update(GameTime gameTime) { // Ignore all mouse events outside the dialog area if (!GameRoot.Mouse.Hovers(Rectangle) && GameRoot.Mouse.LeftButtonClicked()) { if (isCancellableThroughBackground) { BackgroundClick?.Invoke(this, null); } else { return; } } foreach (var c in components) { c.Update(gameTime); } }
protected void Awake() { BackgroundClick.singleton = this; }
protected void Start() { this.supporting = new List<Minion>(); this.initialPosition = this.transform.position; this.lastRestingPosition = this.initialPosition; this.hero = Hero.singleton; this.clicksEnabled = true; this.background = BackgroundClick.singleton; this.backgroundCollider = background.GetComponent<Collider2D> (); LevelManager.singleton.RegisterMinion (this); this.height = this.GetComponent<SpriteRenderer>().bounds.size.y; this.width = this.GetComponent<SpriteRenderer>().bounds.size.x; }
// Use this for initialization void Start() { if (!this.isTutorialLevel) this.tutorialLevelIndicator.GetComponent<SpriteRenderer> ().enabled = false; this.hero = Hero.singleton; this.background = BackgroundClick.singleton; this.backgroundAudioSource = this.GetComponent<AudioSource> (); this.zapAudioSource = this.gameObject.AddComponent<AudioSource> (); this.zapAudioSource.clip = this.noteFailClip; this.noteNameToSource = new Dictionary<string, AudioSource> (); foreach (AudioClip clip in this.noteClips) { AudioSource src = this.gameObject.AddComponent<AudioSource>(); src.clip = clip; clip.LoadAudioData(); this.noteNameToSource[clip.name] = src; } this.InitLives (); AudioClip backgroundClip = buildingsBackground; this.backgroundAudioSource.clip = backgroundClip; this.backgroundAudioSource.Play (); this.InitTutorials (); }