// Use this for initialization
    void Start()
    {
        GM     = GameObject.Find("GameManager").GetComponent <scr_GameManager>();
        BM     = GameObject.FindGameObjectWithTag("bag").GetComponent <scr_bagMovement>();
        ISM    = GM.GetComponent <scr_IngameSoundManager>();
        pooler = GameObject.FindGameObjectWithTag("pooler").GetComponent <scr_obp>();
        FH     = GM.GetComponent <scr_FileHandler>();
        PE     = GM.GetComponent <scr_PotionEffects>();

        collectedParticles = 0;
        m_particle_1_score = GM.GetParticleScore(0);
        m_particle_2_score = GM.GetParticleScore(1);
        m_particle_3_score = GM.GetParticleScore(2);

        //The actual amount of particles;
        maxParticles = GM.GetMaxWinParticles() * GM.GetMaxBagAmount();
        maxScore     = maxParticles * (int)m_particle_2_score;

        //Håkans particle systems for when particles enters the glassjar
        emitPosition1 = transform.GetChild(0);
        PS1           = emitPosition1.GetComponent <ParticleSystem>();
        PS1.Stop();

        emitPosition2 = transform.GetChild(1);
        PS2           = emitPosition2.GetComponent <ParticleSystem>();
        PS2.Stop();

        emitPosition3 = transform.GetChild(2);
        PS3           = emitPosition3.GetComponent <ParticleSystem>();
        PS3.Stop();
        //End Håkans potions
    }
示例#2
0
 void Awake()
 {
     M_DelayBeforeLvlSwap = 30;
     PopUpMenu            = GameObject.Find("PopUpMenu").GetComponent <Transform>();
     CanvasStuff          = PopUpMenu.GetComponent <scr_CanvasStuff>();
     scaleUpwards         = true;
     activeButton         = null;
     OpenSurveyOnce       = true;
     m_BT           = BagType.def;
     Time.timeScale = 1;
     m_Camera       = Camera.main.GetComponent <scr_CameraScript>();
     m_EGS          = EndGameState.none;
     ISM            = GetComponent <scr_IngameSoundManager>();
     PE             = GetComponent <scr_PotionEffects>();
     FH             = GetComponent <scr_FileHandler>();
     if (m_bagAmount > 0 && !GameObject.FindGameObjectWithTag("bag"))
     {
         Instantiate(bag, m_bagSpawnPos.position, Quaternion.identity);
         bag.SetActive(true);
         m_bagAmount -= 1;
     }
     m_showEndGameMenu = false;
     m_DisplayOnce     = true;
 }