Esempio n. 1
0
 // Update is called once per frame
 void Update()
 {
     if (poem.hasCollected(hideWhenFound))
     {
         if (poem.hasCollected(showWhenFound))
         {
             gameObject.GetComponent <SpriteRenderer>().enabled = true;
         }
         else
         {
             gameObject.GetComponent <SpriteRenderer>().enabled = false;
         }
     }
 }
Esempio n. 2
0
    // Update is called once per frame
    void Update()
    {
        bool canTrigger = true;

        foreach (int id in triggerScripts)
        {
            canTrigger = canTrigger && poem.hasCollected(id);
        }

        if (canTrigger)
        {
            if (destroyOnTrigger)
            {
                Destroy(gameObject);
                return;
            }


            foreach (FloorControler fc in GetComponentsInChildren <FloorControler>())
            {
                if (chargeOnTrigger)
                {
                    fc.charge      = 1;
                    fc.noDischarge = true;
                }

                if (changeColorOnTrigger)
                {
                    fc.colors = colors;
                }
            }
        }
    }
Esempio n. 3
0
 // Update is called once per frame
 void Update()
 {
     if (poem.hasCollected(triggerId))
     {
         GameObject.Find("player").rigidbody2D.velocity    = new Vector2(0, -3);
         GameObject.Find("player").rigidbody2D.angularDrag = 0;
         GameObject.Find("player").transform.position      = transform.position;
         Physics2D.gravity = new Vector2(0, 0);
         Destroy(gameObject);
     }
 }
Esempio n. 4
0
    // Update is called once per frame
    void Update()
    {
        if (enableLightsOff && poem.hasCollected(lightsOffScirpt))
        {
            GetComponent <SpriteRenderer>().sprite = noLight;
            return;
        }

        updated = !(Time.timeSinceLevelLoad - lastUpdate >= currentInterval);

        if (!updated)
        {
            updateSprite();
        }
    }
Esempio n. 5
0
    void OnGUI()
    {
        GUI.skin = skin;

        GUILayout.BeginArea(new Rect(10, 0, 250, 600));

        GUILayout.BeginScrollView(scrollPosition, true, false);
        GUILayout.EndScrollView();

        scrollPosition = GUILayout.BeginScrollView(scrollPosition, GUIStyle.none);


        GUILayout.BeginVertical();

        for (int stanza = 0; stanza < poem.getStanzaCount(); stanza++)
        {
            GUILayout.BeginHorizontal();

            GUILayout.BeginVertical();
            GUILayout.Label((stanza + 1).ToString());
            GUILayout.EndVertical();


            GUILayout.BeginVertical();
            for (int verse = 0; verse < poem.getVerseCount(stanza); verse++)
            {
                if (poem.hasCollected(stanza, verse))
                {
                    GUILayout.Label(poem.getVerse(stanza, verse));
                }
                else
                {
                    GUILayout.Label(". . .");
                }
            }
            GUILayout.EndVertical();
            GUILayout.EndHorizontal();
        }


        GUILayout.EndVertical();
        GUILayout.EndScrollView();
        GUILayout.EndArea();
    }
Esempio n. 6
0
 // Update is called once per frame
 void Update()
 {
     GetComponent <SpriteRenderer>().enabled = poem.hasCollected(triggerScript);
 }