public void AddProcessUnit(ObjectCreatManager.RobotCreateControllor rcc ) { GameObject unitObj = Instantiate(Resources.Load("UI/Prefab/CreateProcessUnit") as GameObject) as GameObject; CreateProcessUnit unitCom = unitObj.GetComponent<CreateProcessUnit>(); unitObj.transform.parent = this.transform; units.Add(unitCom); unitCom.Init(rcc,units.Count ); }
public void Init(ObjectCreatManager.RobotCreateControllor _rcc , int order ) { rcc = _rcc; Debug.Log("CreateProcessUnit Init " + Global.UI_ROBOT_PATH + rcc.GetInfo().bodyName.ToString()); body.sprite = Resources.Load<Sprite>(Global.UI_ROBOT_PATH + rcc.GetInfo().bodyName.ToString()); for(int i = 0 ; i < 3 ; ++ i ) { equipments[i].sprite = Resources.Load<Sprite>(Global.UI_ROBOT_PATH + rcc.GetInfo().equipments[i].ToString()); } equipments[3].sprite = equipments[1].sprite; Vector2 pos = back.rectTransform.anchoredPosition; pos.x = 60f + order * 100f; back.rectTransform.anchoredPosition = pos; }
public ObjectCreatManager() { s_Instance = this; }