public IEnumerator SetupStream(DressupData _data, Vector2Int _size) { while (LoadManager.Instance.IsLoading) { yield return(null); } LoadManager.Instance.IsLoading = true; Data = _data; Size = _size; yield return(null); BackgroundScale _backgroundScale = Instantiate(Data.BackgroundPrefab); Map = new int[_size.x, _size.y]; for (int x = 0; x < _size.x; x++) { for (int y = 0; y < _size.y; y++) { Map[x, y] = -1; } } yield return(null); _backgroundScale.SetSize(_size); Hakos = new HakoAnimation[1 + hakoMaxs * 4]; Hakos[0] = Instantiate(Data.X_Prefab); for (int i = 0; i < 4; i++) { yield return(null); HakoAnimation temp = Data.A_Prefab; if (i == 1) { temp = Data.B_Prefab; } if (i == 2) { temp = Data.C_Prefab; } if (i == 3) { temp = Data.D_Prefab; } for (int j = 0; j < hakoMaxs; j++) { Hakos[i * hakoMaxs + j + 1] = Instantiate(temp); } } LoadManager.Instance.IsLoading = false; }
// Use this for initialization void Start() { bg = GameObject.FindGameObjectWithTag("BG"); backgroundScale = GameObject.FindGameObjectWithTag("BG").GetComponent <BackgroundScale>(); bxCollider2d = GetComponent <BoxCollider2D>(); }
// Use this for initialization void Start() { bg = GameObject.FindGameObjectWithTag("BG"); backgroundScale = GameObject.FindGameObjectWithTag("BG").GetComponent<BackgroundScale>(); bxCollider2d = GetComponent<BoxCollider2D>(); }