Don't like ads? PRO users don't see any ads ;-)
Guest

Untitled

By: a guest on May 7th, 2012  |  syntax: C#  |  size: 0.83 KB  |  hits: 15  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1. using UnityEngine;
  2. using System.Collections;
  3.  
  4. public class ResourceSystem : MonoBehaviour {
  5.         //Array will be of "arraySize" and be [,]
  6.         //For either current or income, it will contain each resource's values.z
  7.         static public int groupSize=2;
  8.         static public int enumSize=6;
  9.         public static int arraySize=6;
  10.         enum tableSide {current=0, income=1}
  11.         enum resource {energy=0, food=1, minerals=2, ore=3, crystal=4, metal=5, population=6};
  12.         //enum resourceIncome {energy=0, food=1, minerals=2, ore=3, crystal=4, metal=5, population=6};
  13.         float[,] resourceArray=new float[resource, tableSide];
  14.        
  15.         void populateTable(float[] table){
  16.                 table[energy,current]=100.0f;
  17.                 table[energy,income]=10.0f;//per second
  18.                        
  19.         }
  20.  
  21.         // Use this for initialization
  22.         void Start () {
  23.        
  24.         }
  25.        
  26.         // Update is called once per frame
  27.         void Update () {
  28.        
  29.         }
  30. }