예제 #1
0
 void Awake()
 {
     if (instance == null)
     {
         instance = this;
     }
 }
예제 #2
0
        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
        }
예제 #3
0
        void Awake()
        {
            if (instance == null)
            {
                instance = this;
            }
            var aud = GetComponent <AudioSource>();

            if (aud)
            {
                aud.volume = PlayerPrefs.GetFloat("SE");
            }
        }
예제 #4
0
    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);
        }
    }
예제 #5
0
 // 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();
     }
 }
예제 #6
0
 // Start is called before the first frame update
 void Start()
 {
     world   = GetComponentInParent <WorldController>();
     spawner = world.GetComponentInChildren <Water2D.Water2D_Spawner>();
     col     = GetComponent <Collider2D>();
 }