Esempio n. 1
0
    // 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());
        }
    }
Esempio n. 2
0
    // 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();
    }
Esempio n. 3
0
    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;
    }
Esempio n. 4
0
        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);
            }
        }
Esempio n. 5
0
 protected void Awake()
 {
     BackgroundClick.singleton = this;
 }
Esempio n. 6
0
    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;
    }
 protected void Awake()
 {
     BackgroundClick.singleton = this;
 }
    // 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 ();
    }