Beispiel #1
0
 // Update is called once per frame
 protected override void Update()
 {
     if (!Globals.canvas.dialogue)
     {
         base.Update();
         if (noBomb)
         {
             frames++;
             if (frames >= regrowFrames)
             {
                 noBomb = false;
                 frames = 0;
                 GameObject newBomb = (GameObject)Instantiate(bombObject, this.gameObject.transform.position, Quaternion.identity);
                 bomb = newBomb.GetComponent <BombObject>();
                 bomb.setBombPlantObject(this);
             }
         }
     }
     if (isDying)
     {
         dyingFrame++;
         if (dyingFrame >= numDyingFrames)
         {
             Destroy(this.gameObject);
         }
     }
 }
Beispiel #2
0
    // Use this for initialization
    protected override void Start()
    {
        base.Start();
        noBomb = false;
        frames = 0;
        GameObject newBomb = (GameObject)Instantiate(bombObject, this.gameObject.transform.position, Quaternion.identity);

        bomb = newBomb.GetComponent <BombObject>();
        bomb.setBombPlantObject(this);
    }