void Awake() { if (instance == null) { instance = this; } }
void Start() { if (instance == null) { instance = this; } //Application.targetFrameRate = 60; _parent = new GameObject("_metaBalls"); _parent.hideFlags = HideFlags.HideInHierarchy; WaterDropsObjects [0].transform.SetParent(_parent.transform); WaterDropsObjects [0].transform.localScale = new Vector3(size, size, 1f); WaterDropsObjects [0].GetComponent <MetaballParticleClass>().Active = false; for (int i = 1; i < WaterDropsObjects.Length; i++) { WaterDropsObjects[i] = Instantiate(WaterDropsObjects[0], gameObject.transform.position, new Quaternion(0, 0, 0, 0)) as GameObject; WaterDropsObjects [i].GetComponent <MetaballParticleClass>().Active = false; WaterDropsObjects [i].transform.SetParent(_parent.transform); WaterDropsObjects [i].transform.localScale = new Vector3(size, size, 1f); } AllBallsCount = WaterDropsObjects.Length; microSpawns = new List <microSpawn>(5); // Up to 5 microspwawn }
void Awake() { if (instance == null) { instance = this; } var aud = GetComponent <AudioSource>(); if (aud) { aud.volume = PlayerPrefs.GetFloat("SE"); } }
void InstantiateStage(int StageNum) { if (StageNum <= ListSize) { if (StageObject) { Destroy(StageObject); } StageObject = Instantiate(gameObjects[StageNum]); StageObject.transform.SetParent(transform); CurrentStageNum = StageNum; Water2D_Spawner = GameObject.Find("Water2D_Spawner").GetComponent <Water2D.Water2D_Spawner>(); goal = GameObject.Find("Goal").GetComponent <Goal>(); ball = GameObject.Find("Ball").GetComponent <Ball>(); Invoke("DelayMethod_Sawn", StartDelay); } }
// Start is called before the first frame update void Start() { Time.timeScale = 1.0f; spawner = GetComponentInChildren <Water2D.Water2D_Spawner>(); gyroAvailable = EnableGyro(); if (levelComplete != null) { levelComplete.SetActive(false); } if (pauseMenu != null) { pauseMenu.SetActive(false); } if (autoStart) { spawner.Spawn(); } }
// Start is called before the first frame update void Start() { world = GetComponentInParent <WorldController>(); spawner = world.GetComponentInChildren <Water2D.Water2D_Spawner>(); col = GetComponent <Collider2D>(); }