// Start is called before the first frame update void Start() { data = new float[plotNum]; if (modelType == "HH") { HHscript = GameObject.Find("HH-Neuron").GetComponent <HodgkinHuxleyModel>(); for (int i = 0; i < plotNum; i++) { data[i] = HHscript.states[0]; } } else if (modelType == "Izhikevich") { izhikevichscript = GameObject.Find("IzhikevichPrefab1").GetComponent <IzhikevichModelWithSynapse>(); for (int i = 0; i < plotNum; i++) { data[i] = (float)izhikevichscript.v; } } voltage_text = GameObject.Find("VoltageText").GetComponent <Text>(); inputCurrent_text = GameObject.Find("InputCurrentText").GetComponent <Text>(); renderer = gameObject.GetComponent <LineRenderer>(); canvas = gameObject.GetComponent <Canvas>(); renderer.SetWidth(0.05f, 0.05f); // 線の太さ renderer.SetVertexCount(plotNum); // 頂点の数 for (int i = 0; i < plotNum; i++) { renderer.SetPosition(i, convertWorldToCanvas(new Vector2((i - plotNum / 2) * 10f / plotNum, FitDataToGraph(data[i])), canvas)); //Debug.Log(data[i]); } }
// Start is called before the first frame update void Start() { voltage_text = voltageTextObject.GetComponent <Text>(); postNeuronScript = postNeuron.GetComponent <IzhikevichModelWithSynapse>(); }