public void addElement(ListGameObject toAdd) { elements.Add(toAdd); configureElementTransform(toAdd); resetContentSize(); }
public Ritual(string newName, int cost, int time, string desc, int newRange, int newTargets, ListGameObject ability) { zealCost = cost; prepTime = time; name = newName; description = desc; range = newRange; numTargets = newTargets; Activate = ability; }
void DestoryGuideBar() { for (int i = 0; i < ListGameObject.Count; i++) { DestroyObject(ListGameObject [i]); } ListGameObject.Clear(); dicGuideObjectPos.Clear(); dicGuideObjectWidth.Clear(); }
private void configureElementTransform(ListGameObject element) { element.GetListObjectTransform().SetParent(allElementsPanel.transform); Vector3 position = element.GetListObjectTransform().anchoredPosition3D; position.z = 0.0f; element.GetListObjectTransform().anchoredPosition3D = position; element.GetListObjectTransform().localScale = new Vector3(1.0f, 1.0f, 1.0f); }
void DrawGuideLineNew() { if (Ag.mgIsKick) { DrawXStart = 0.2f; DrawXWidth = 0.6f; } else { DrawXStart = 0.56f; DrawXWidth = 0.425f; } mGuideBar = new List <GameObject> (); dicGuideObjectPos = new Dictionary <int, float> (); dicGuideObjectWidth = new Dictionary <int, float> (); GameObject Guidebar; int i, num; if (Ag.mgIsKick) { num = myCard.arrArea.Count; } else { num = EnemCard.arrArea.Count; } for (int j = 0; j < num; j++) { dicGuideObjectPos.Add(j, mPos); dicGuideObjectWidth.Add(j, mWidth); } for (i = 0; i < num; i++) { int[] curVal = Ag.mgIsKick ? (int[])myCard.arrArea [i] : (int[])EnemCard.arrArea [i]; int color = curVal [0]; int sta = curVal [1], end = curVal [2]; //Debug.Log ("Color " + curVal [0] + "Start " + curVal [1] + "End " + curVal [2]); float staX = (float)(sta / 1000.0f); float width = (float)((end - sta) / 1000.0f); Guidebar = (GameObject)Instantiate(Resources.Load("prefab_General/IngameKickBar")); Guidebar.transform.parent = dicGameSceneMenuList ["MainBar"].transform; Guidebar.transform.localPosition = new Vector3((staX * 580) - 290, -260, -0.29f); Guidebar.GetComponent <UISprite> ().spriteName = "kickbar" + color; if (color == 0 && width * 580 < 0) { width = 0; } Guidebar.transform.localScale = new Vector3(width * 580, 24, 1); ListGameObject.Add(Guidebar); if (!Ag.mgIsKick) { dicGameSceneMenuList ["Kickerinfo"].transform.localPosition = new Vector3(260, -180, 0); for (int j = 0; j < ListGameObject.Count; j++) { ListGameObject [j].transform.parent = dicGameSceneMenuList ["Kickerinfo"].transform.FindChild("DirectionBar").transform; Guidebar.transform.localPosition = new Vector3((staX * 508) - 254, 0, -8); Guidebar.transform.localScale = new Vector3(width * 508, 24, 1); } //StartCoroutine (CorutineTest ()); } } }