예제 #1
0
 // Use this for initialization
 void Start()
 {
     //gets the blockspawner object
     if (GameManager.instance.sceneName == "MainGame")
     {
         blockSpawner = transform.Find("BlockSpawner").GetComponent<BlockSpawner>();
     }
     cameraY = transform.position.y; //gets the latest poisiton y
     lastCameraY = cameraY; // set it equal to last positon y
     //the difference between cameraY and lastCameraY helps tp spawn new block
 }
예제 #2
0
        public GameObject startingItems; //ref to gameobject where starting items will be spawned as child

        void Awake()
        {
            if (instance == null)
                instance = this;
        }