Esempio n. 1
0
    // Use this for initialization
    void Start()
    {
        stomanager = FindObjectOfType(typeof(StomachGameManager)) as StomachGameManager;
        fm         = FindObjectOfType(typeof(StomachFoodManager)) as StomachFoodManager;
        sm         = FindObjectOfType(typeof(StomachEnzyme)) as StomachEnzyme;

        stomanager.addonefood();

        // choose a random number to choose a color and select the correct images
        index = Random.Range(0, 4);
        wholeRepresentation    = wholeFood [index];
        digestedRepresentation = digestedFood [index];

        // get the spawn location and assign the sprite image.

        //used to be 0.6, 0.85
        spawnLocation             = Random.Range(.4f * Screen.width, .6f * Screen.width);
        parent.transform.position = new Vector3(((spawnLocation * 15f / Screen.width) - 7.5f) * 10f,
                                                (11f - (0f * 11f / Screen.height) - 5.5f) * 10f, 90f);          //old z = -2.0f
        GetComponent <SpriteRenderer>().sprite = wholeRepresentation;
        GetComponent <AudioSource> ().clip     = breakSound;

        soundCounter = 0;
        currentState = 0;
    }
Esempio n. 2
0
 /**
  * Use this for initialization
  */
 void Start()
 {
     // get references
     fm             = FindObjectOfType(typeof(StomachFoodManager)) as StomachFoodManager;
     gm             = FindObjectOfType(typeof(StomachGameManager)) as StomachGameManager;
     cm             = FindObjectOfType(typeof(CellManager)) as CellManager;
     stEz           = FindObjectOfType(typeof(StomachEnzyme)) as StomachEnzyme;
     gameOverStatus = 0;
 }
Esempio n. 3
0
    // Use this for initialization
    void Start()
    {
        stEz = FindObjectOfType(typeof(StomachEnzyme)) as StomachEnzyme;
        i    = GetComponent <Image>();

        timer    = 0;
        subtimer = 0;
        popup    = false;
        popped   = false;
    }