コード例 #1
0
ファイル: GameEngine.cs プロジェクト: chopintzc/Dome-game
 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
ファイル: GameEngine.cs プロジェクト: chopintzc/Dome-game
    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());
        }
    }