public GameObject AddDOM(DOM parent, int domID, Vector3 pos) { if (prefab == null) { prefab = Resources.Load <singleBall>("Prefabs/sBall"); Debug.Log(prefab); } singleBall exp = Instantiate <singleBall>(prefab); //exp.gameObject.GetComponent<MeshRenderer>().sharedMaterial = parent.material; exp.gameObject.name = "String " + this.id + " DOM " + domID; //exp.absSpeed=decOffset; //exp.decExp=0.8f+Mathf.Min(decOffset/450.0f,0.1f); this.balls.Add(domID, exp); // Dom dom = exp.gameObject.AddComponent<Dom>(). // Initialize(parent, domID, pos); //this.id = id; //this.mesh = parent.mesh; //this.material = parent.material; float rradius = 0.01651f * cfg.domScale * cfg.globalScale; exp.transform.parent = parent.transform; exp.transform.localScale = Vector3.one * rradius; //relative exp.transform.localPosition = pos; // this.doms.Add(domID, dom); this.maxZ = System.Math.Max(this.maxZ, pos.y); this.minZ = System.Math.Min(this.minZ, pos.y); return(exp.gameObject); }
public singleBallList(int lst) { balls = new singleBall[lst]; }
public void setBall(int sid, int did, singleBall sball) { registerDomId(sid, did); ballArray[sid].balls[did] = sball; }