public CoinGroup CreateCoinGroupAt(Vector3 position, CoinGroup.CoinType type) { CoinGroup coinGroupPreFab = GetCoinGroupByGroupType(type); CoinGroup coinGroup = CoinGroup.Instantiate(coinGroupPreFab); coinGroup.gameObject.SetActive(true); coinGroup.transform.position = position; Debug.Log("Entrou"); return(coinGroup); }
private void CreateCoins() { int coinCount = Random.Range(0, (this.coinPlaceHolders.Length + 1)); this.cont++; for (int i = 0; i < coinCount; i++) { int coinIndex = Random.Range(0, this.coinPlaceHolders.Length); CoinPlaceholder placeHolder = this.coinPlaceHolders [coinIndex]; if (!placeHolder.wasUsed) { placeHolder.wasUsed = true; Vector3 placeHolderPosition = placeHolder.transform.position; CoinGroup newCoinGroup = CoinManager.GetIntance().CreateCoinGroupAt(placeHolderPosition, placeHolder.GetRandomGroupType()); coins.Add(newCoinGroup); //newCoinGroup.transform.SetParent (this.transform, false); } } }