Source

PcapAnalyzeTest / unity / Assets / MyScripts / Main.cs

Full commit
using UnityEngine;
using System.Collections.Generic;
using System.Collections;
using System.IO;

public class Main : MonoBehaviour {

	// Use this for initialization
	private Texture2D texture;
	private float timer = 0.0f;
	private Dictionary<int,int> sumTcpPorts = new Dictionary<int, int>();
	private Dictionary<int,int> sumUcpPorts = new Dictionary<int, int>();
	
	void Start () {
		texture = new Texture2D(600,400,TextureFormat.RGBA32,false);
		StreamReader streamReader = new StreamReader(Application.dataPath+"/../../tmp/summary.txt");
		string fileContents = "";
		fileContents = streamReader.ReadToEnd();
		print (fileContents);
		drawColor();
		
	
	}
	void OnGUI()
	{
		if(texture != null) GameObject.Find("Plane").renderer.material.mainTexture = texture;
	}
	// Update is called once per frame
	void Update () {
		/*
		timer += Time.deltaTime;
		if(timer >= 1.0f)
		{
			timer = 0.0f;
			drawColor();
		}
		*/
	
	}
	void drawColor()
	{
	        Color myColor = new Color();
            texture.SetPixel(20,20,Color.red);
        	texture.Apply();
	}
}