Esempio n. 1
0
 public void reinitDomsWithTimes(float startTime, float endTime)
 {
     foreach (var dom in doms)
     {
         BallExpander cm = dom.Value.gameObject.GetComponent <BallExpander>();
         cm.Initialize(startTime, endTime);
     }
 }
Esempio n. 2
0
    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);
        }
    }
Esempio n. 3
0
 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);
         }
     }
 }
Esempio n. 4
0
    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);
    }