private ContractGameObject getContractGameObject(CampContract campContract) { GameObject contractInstance = GameObject.Instantiate(contractPrefab, new Vector3(0, 0, 0), Quaternion.identity); ContractGameObject contractGameObject = contractInstance.GetComponent <ContractGameObject>(); contractGameObject.initialize(contractInstance, campContract); return(contractGameObject); }
public void initialize(GameObject campContractPrefab, CampContract campContract) { this.campContract = campContract; this.campContractInstance = campContractPrefab; this.background = campContractInstance.GetComponent <Image>(); TextMeshProUGUI textObject = campContractInstance.GetComponentInChildren <TextMeshProUGUI>(); textObject.text = campContract.getDescription(); }
public void showCampContract(CampContract campContract) { ContractGameObject contractInstance = getContractGameObject(campContract); contractInstance.transform.SetParent(campContracts.transform, false); }