예제 #1
0
 public void displayInstruction()
 {
     handler = (imageHandler)GameObject.FindObjectOfType <imageHandler> ();
     setTextComponent("nameText0", "Instruction");
     setTextComponent("scientificNameText0", "");
     setTextComponent("nationalStatusText0", "");
     setTextComponent("provincialStatusText0", "");
     setTextComponent("descriptionText0", Repo.instruction);
     handler.loadImage("animalPicture7.jpg");
 }
예제 #2
0
    public void displayAnimal(int animalId)
    {
        handler = (imageHandler)GameObject.FindObjectOfType <imageHandler> ();
        if (!Repo.animalCache.ContainsKey(animalId))
        {
            Debug.Log("An animal ID was requested that does not exist in the animalCache.");
        }
        else
        {
            var animal = Repo.animalCache [animalId];

            // set the text values
            setTextComponent("nameText0", animal.name);
            setTextComponent("scientificNameText0", animal.scientificName);
            setTextComponent("nationalStatusText0", "National Status: " + animal.nationalStatus);
            setTextComponent("provincialStatusText0", "Provincial Status: " + animal.provincialStatus);
            setTextComponent("descriptionText0", animal.description);

            // set the images
            Debug.Log("Image: " + animal.images.First());
            handler.loadImage(animal.images.First());
        }
    }