Exemplo n.º 1
0
    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);
                    }
                }
            }
        }
    }
Exemplo n.º 2
0
    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);
                    }
                }
            }
        }
    }
Exemplo n.º 3
0
    public void ShowStudyMaterial(StudyMaterial whichone, bool showOrHide = true)
    {
        StudyMaterialType myStudyMaterialtype = this.GetComponentInChildren <StudyMaterialType>();

        if (myStudyMaterialtype != null)
        {
            myStudyMaterialtype.SetStudyMaterialVisiblity(whichone, showOrHide);
        }
    }