Created
March 10, 2014 20:41
-
-
Save radiatoryang/9473879 to your computer and use it in GitHub Desktop.
simple card instantiation for Charles "hard way" Pratt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using UnityEngine; | |
using System.Collections; | |
using System.Collections.Generic; | |
public class PrattCards : MonoBehaviour { | |
public Renderer cardPrefab; | |
public List<Texture2D> cardFronts; | |
public int[] cardFrequency; | |
// Use this for initialization | |
void Start () { | |
foreach ( Texture2D front in cardFronts) { | |
for (int i=0; i<cardFrequency[cardFronts.IndexOf(front)]; i++) { | |
Renderer cardMesh = Instantiate (cardPrefab) as Renderer; | |
cardMesh.material.mainTexture = front; | |
} | |
} | |
} | |
// Update is called once per frame | |
void Update () { | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment