public void reinitDomsWithTimes(float startTime, float endTime) { foreach (var dom in doms) { BallExpander cm = dom.Value.gameObject.GetComponent <BallExpander>(); cm.Initialize(startTime, endTime); } }
public void RegisterPulse(int domID, float startTime, float width, float signal) { var iDom = doms[domID]; BallExpander cm = iDom.gameObject.GetComponent <BallExpander>(); if (cm != null) { cm.RegisterPulse(startTime, width, signal); } }
public void RegisterEmission(Vector3 pos, float energy) { foreach (KeyValuePair <int, Dom> iDom in doms) { BallExpander cm = iDom.Value.gameObject.GetComponent <BallExpander>(); if (cm != null) { cm.RegisterPhoton((cm.transform.position - pos).magnitude, energy); } } }
public void AddDOM(DOM parent, int domID, Vector3 pos) { if (prefab == null) { prefab = Resources.Load <BallExpander>("Prefabs/Ball"); //Debug.Log(prefab); } BallExpander exp = Instantiate <BallExpander>(prefab).Initialize(0, 1); exp.gameObject.name = "String " + this.id + " DOM " + domID; Dom dom = exp.gameObject.AddComponent <Dom>(). Initialize(parent, domID, pos); this.doms.Add(domID, dom); this.maxZ = System.Math.Max(this.maxZ, pos.y); this.minZ = System.Math.Min(this.minZ, pos.y); }