private void Awake() { myStudyMaterials = this.GetComponentInChildren <StudyMaterialType>(); // print(myStudyMaterials.gameObject.name); if (myStudyMaterials != null) { myStudyMaterials.gameObject.SetActive(true); } if (studyMaterialsToShowAtStart == null) { if (myStudyMaterials != null) { myStudyMaterials.RandomlyShowOrHideStudyMaterialsOnDesk(); // only do random hiding if study materials to show is not present for the scenario } } else { if (myStudyMaterials != null) { myStudyMaterials.HideByDefaultStudyMaterials(); if (deskOccupied) { foreach (StudyMaterial sm in studyMaterialsToShowAtStart) { myStudyMaterials.SetStudyMaterialVisiblity(sm, true); } } } } }
public void EnableMyItems(bool val) { myStudyMaterials.gameObject.SetActive(val); if (studyMaterialsToShowAtStart == null) { if (deskOccupied) { if (myStudyMaterials != null) { myStudyMaterials.RandomlyShowOrHideStudyMaterialsOnDesk(); // only do random hiding if study materials to show is not present for the scenario } } } else { if (myStudyMaterials != null) { myStudyMaterials.HideByDefaultStudyMaterials(); if (deskOccupied) { foreach (StudyMaterial sm in studyMaterialsToShowAtStart) { myStudyMaterials.SetStudyMaterialVisiblity(sm, val); } } } } }
private void Start() { StudyMaterialType myStudyMaterialtype = this.GetComponentInChildren <StudyMaterialType>(); if (studyMaterialsToShowAtStart == null) { if (myStudyMaterialtype != null) { myStudyMaterialtype.RandomlyShowOrHideStudyMaterialsOnDesk(); // only do random hiding if study materials to show is not present for the scenario } } else { if (myStudyMaterialtype != null) { myStudyMaterialtype.HideByDefaultStudyMaterials(); if (StudentSittingOnMe != null) { foreach (StudyMaterial sm in studyMaterialsToShowAtStart) { myStudyMaterialtype.SetStudyMaterialVisiblity(sm, true); } } } } }