Exemplo n.º 1
0
    /**
     * Use this for initialization
     */
    void Start()
    {
        currentAcidLevel = "neutral";


        // make sure game is not paused
        Time.timeScale  = 1;
        deadcellcounter = 0;

        totalfoodcounter    = 0;
        disolvedfoodcounter = 0;



        // get references
        cellManager   = FindObjectOfType(typeof(CellManager)) as CellManager;
        sFM           = FindObjectOfType(typeof(StomachFoodManager)) as StomachFoodManager;
        endGameScript = FindObjectOfType(typeof(BadgePopupSystem)) as BadgePopupSystem;

        // initialize arrays
        elapsedTime        = new float[cellManager.cellScripts.Length];
        nextCellActionTime = new float[cellManager.cellScripts.Length];
        lastCellState      = new string[cellManager.cellScripts.Length];

        deathsForThisCellInARow = new int[cellManager.cellScripts.Length];


        // populate arrays
        for (int i = 0; i < cellManager.cellScripts.Length; i++)
        {
            nextCellActionTime[i] = Mathf.Infinity;
            elapsedTime[i]        = 0f;
        }
    }
Exemplo n.º 2
0
 /**
  * Use this for initialization
  */
 void Start()
 {
     // get references
     pm             = FindObjectOfType(typeof(poopmeter)) as poopmeter;
     WS             = FindObjectOfType(typeof(LI_WaterScript)) as LI_WaterScript;
     ligm           = FindObjectOfType(typeof(LargeIntestGameManager)) as LargeIntestGameManager;
     LIbps          = FindObjectOfType(typeof(BadgePopupSystem)) as BadgePopupSystem;
     gameOverStatus = 0;
 }
Exemplo n.º 3
0
    /**
     * called for initialization
     * gets all references and resets stats
     */
    void Start()
    {
        resetStats();                                                     // reset the vars in player prefs for later

        spawnScript = gameObject.GetComponent <SpawnManager> ();          // find the referrence to the spawn script

        nutrientsText = nutrientsCounter.GetComponent <NutrientsText> (); // set the nutrients text script

        drawHealthFace = healthFace.GetComponent <DrawHealthFace> ();     // get the script on the healthFace object

        drawHealthBar = healthBar.GetComponent <DrawHealthBar> ();        // get the script on the healthBar object

        SIbps = FindObjectOfType(typeof(BadgePopupSystem)) as BadgePopupSystem;

        // draw the initial nutrients text
        nutrientsText.updateText(nutrients);
    }