Example #1
0
 private void Awake()
 {
     if (instance == null)
     {
         instance = this;
     }
 }
Example #2
0
        public override void SetUpReferences()
        {
            base.SetUpReferences();

            spawner     = GetComponent <GameSpawner>();
            progression = GetComponent <GameProgression>();
            pooler      = GetComponent <GamePooler>();
            sounds      = GetComponent <GameSounds>();
        }
Example #3
0
        public void Setup(GamePooler pooler, int type, float in_seed)
        {
            if (ren == null)
            {
                ren = GetComponentInChildren <Renderer>();
            }
            rigid.velocity = Vector3.zero;
            seed           = in_seed;


            origin1 = GameObject.FindGameObjectWithTag("Player").transform;
            player  = origin1.GetChild(0).transform;
            if (useRandomSize)
            {
                maxSize = Random.Range(randomMinSize, randomMaxSize);
            }
            if (randomRotate)
            {
                transform.Rotate(new Vector3(Random.Range(0, 360), Random.Range(0, 360), Random.Range(0, 360)));
            }

            transform.Rotate(0, 0, Random.Range(0, randomZRotate));


            if (texRandom)
            {
                texRandom.SetRandom();
            }
            if (meshRandom)
            {
                meshRandom.SetRandom();
            }
            if (galaxyTint)
            {
                galaxyTint.ReTint();
            }



            if (isHoop)
            {
                RandomHoopSpawn();
            }
            else
            {
                RandomSpawn();
            }

            gamePooler = pooler;
            objectType = type;

            isActive = true;
        }