Skip to content

Instantly share code, notes, and snippets.

@kazuooooo
Created January 6, 2015 14:57
Show Gist options
  • Save kazuooooo/e69e9bd21c5bf9df455b to your computer and use it in GitHub Desktop.
Save kazuooooo/e69e9bd21c5bf9df455b to your computer and use it in GitHub Desktop.
public class Array : MonoBehaviour {
// Use this for initialization
void Start () {
int[] data = { 98, 76, 63, 38, 8 };
int total;
foreach(int n in data){
total += n;
}
int ave = total/5;
guiText.text = "Total:"+total+"ave:"+ave;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment