void PrepareAssets() { loader.FadeIn(0.5f); objects.transform.localScale = new Vector3(0, 0, 0); ui.transform.position = new Vector3(0, 20f, 0); objects.transform.DOScale(new Vector3(0.9f, 0.9f, 0.9f), 0.7f).SetEase(Ease.OutBack).SetDelay(1f) .OnStart( () => { shewSound.Play(); } ); ui.transform.DOMove(new Vector3(0, 0, 0), 0.5f).SetDelay(1.5f).SetEase(Ease.OutQuart) .OnStart(() => { shewSound.Play(); }) .OnComplete(StartGame); }
// Use this for initialization void Start() { loader = GameObject.FindGameObjectWithTag("Loader").GetComponent <LoadingControl>(); loader.FadeIn(1.5f); GameObject bgm = GameObject.FindGameObjectWithTag("BGM"); if (bgm == null) { bgm = Instantiate(BGMPrefab, new Vector3(0, 0, 0), Quaternion.identity) as GameObject; DontDestroyOnLoad(bgm); } else { //bgm.transform.position = new Vector3(1.0f, 1.0f, 1.0f); } }