Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System.Collections;
- using System.Collections.Generic;
- using UnityEngine;
- public class GameManager : MonoBehaviour
- {
- public bool GameOver;
- //Populate this list...
- public List<Shape> CurrentShapeList = new List<Shape>();
- public GameObject[] Prefabs;
- public Color[] colors;
- void ConvertPrefabsToShapes()
- {
- foreach(GameObject Prefab in Prefabs)
- {
- Shape newShape = new Shape();
- newShape.CreateShape(
- Prefab.gameObject,
- Prefab.GetComponentsInChildren<SpriteRenderer>(),
- new Vector2(1000,1000),
- Prefab.transform.rotation
- );
- CurrentShapeList.Add(newShape);
- }
- }
- private void Awake() {
- ConvertPrefabsToShapes();
- RandomiseShapeColours();
- }
- void RandomiseShapeColours()
- {
- foreach(Shape shape in CurrentShapeList)
- {
- shape.SetShapeRandomColours(colors, shape);
- }
- }
- // Update is called once per frame
- void Update()
- {
- if(GameOver)
- {
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement