/// <summary> /// オブジェクトの生成 /// </summary> /// <param name="_transform"></param> /// <returns></returns> static public UnitBGPanelUnitIcon Create(Transform _transform) { GameObject prefab = Resources.Load <GameObject>("Prefab/UnitBGPanel/UnitBGPanelUnitIcon"); if (prefab != null) { GameObject obj = Instantiate(prefab); if (obj != null) { obj.transform.SetParent(_transform, false); UnitBGPanelUnitIcon unitIcon = obj.GetComponent <UnitBGPanelUnitIcon>(); unitIcon.SetPosition(Vector2.zero); return(unitIcon); } } return(null); }
private void Awake() { GetComponent <M4uContextRoot>().Context = this; IsViewPanel = false; IsViewExecButton = false; IsActiveExecButton = true; IsViewReturnButton = false; IsViewEvolve = false; IsViewIcon = true; IsViewResetButton = true; IsEnableResetButton = false; IsActiveLink = false; IsViewSale = false; IsLinkStatus = false; Title = ""; ExecButtonImage = null; SetUpButtons(); //----------------------------------------------------- // ユニットアイコンの生成 //----------------------------------------------------- UnitIcon = UnitBGPanelUnitIcon.Create(m_unitIconRoot.transform); UnitIcon.IsActiveIcon = false; UnitIcon.IconColor = new Color(1, 1, 1, 1); UnitIcon.DidSelectIcon = OnSelectIcon; UnitIcon.DidSelectIconLongpress = OnSelectIconLongpress; EvolUnitIcon = UnitBGPanelUnitIcon.Create(m_evolUnitIconRoot.transform); EvolUnitIcon.IsActiveIcon = false; EvolUnitIcon.DidSelectIcon = OnSelectEvolveIcon; EvolUnitIcon.DidSelectIconLongpress = OnSelectEvolveIconLongpress; LinkStatusImage = ResourceManager.Instance.Load("btn_status_off", ResourceType.Common); LinkSkillImage = ResourceManager.Instance.Load("btn_skill_off", ResourceType.Common); }