public void CreateTable(int size) { _Table = gameObject.GetComponent <UITable>(); if (_Table == null) { Debug.Log("UITable not initialized "); return; } GameObject sourcePrefab = Resources.Load(SOURCE_PATH) as GameObject; if (sourcePrefab == null) { Debug.Log("Could not load source from path " + SOURCE_PATH); } ShanghaiUtils.RemoveAllChildren(transform); for (int x = 0; x < size; x++) { GameObject source = GameObject.Instantiate(sourcePrefab) as GameObject; SourceController sourceCtr = source.GetComponent <SourceController>(); sourceCtr.Key = x; source.name = string.Format("{0}", x); source.transform.parent = transform; source.transform.localPosition = Vector3.zero; source.transform.localScale = Vector3.one; } _Table.repositionNow = true; }
private void OnSourceCellUpdated(SourceCell sourceCell) { Transform sourceTrans = transform.Find(string.Format("{0}", sourceCell.Key)); if (sourceTrans != null) { SourceController sourceCtr = sourceTrans.GetComponent <SourceController>(); if (sourceCtr != null) { sourceCtr.UpdateSource(sourceCell); } } }
private void OnTelegramOver(SourceController srcCont) { _OverSource = srcCont; }