Skip to content

Instantly share code, notes, and snippets.

@radiatoryang
Created March 10, 2014 20:41
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save radiatoryang/9473879 to your computer and use it in GitHub Desktop.
Save radiatoryang/9473879 to your computer and use it in GitHub Desktop.
simple card instantiation for Charles "hard way" Pratt
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