List <string> CreateSentence(Photo.PhotoInstance p) // eventually we should change what this method is when we get scoring going!
    {
        List <string> sentences = new List <string>();

        if (p.nameOfMainMonster.ToLower() == "no monster")
        {
            sentences.Add("I can't clearly see a creature in this picture! No points!");
            return(sentences);
        }

        // What's the name of the monster?
        sentences.Add("So this is a picture of " + p.nameOfMainMonster + ". ");

        // How close is it to the camera?

        switch (p.distanceScore)
        {
        case 100:
            sentences.Add("This creature is pretty far away so...100 points! ");
            break;

        case 200:
            sentences.Add("...You're almost at the perfect distance, but not quite. 200 points! ");
            break;

        case 500:
            sentences.Add("I can perfectly see this creature! 500 points! ");
            break;
        }



        // Are there extra creatures?

        if (p.monsters.Count > 1)
        {
            sentences.Add("Woah there are " + p.monsters.Count + " creatures in this photo! " + 20 * p.monsters.Count + " points! ");
        }
        // Is it in a specific pose!
        if (p.pose)
        {
            sentences.Add(p.nameOfMainMonster + p.poseString);
        }

        // Is it centered?

        if (p.isInCenter)
        {
            sentences.Add(p.nameOfMainMonster + " is perfectly centered. Your score is getting doubled! ");
        }

        return(sentences);
    }
Beispiel #2
0
    // " Will be called from camera after regular rendering is done. "
    private void OnPostRender()
    {
        if (canTakePicture && (GameManager.gm.storedPhotos.Count < GameManager.gm.maxFilm))
        {
            Photo.PhotoInstance newPhoto = new Photo.PhotoInstance();
            monstersInPhoto = new List <MonsterScript>();
            for (int i = 0; i < MonsterManager.monsters.Count; i++)
            {
                MonsterManager.monsters[i].isVisible();
                if (MonsterManager.monsters[i].isinCamera)
                {
                    MonsterManager.monsters[i].SetDistanceFromCamera();
                    MonsterManager.monsters[i].SetPositionFromCenter();

                    if (MonsterManager.monsters[i]._distance < 1000)
                    {
                        monstersInPhoto.Add(MonsterManager.monsters[i]);
                        newPhoto.monsters.Add(MonsterManager.monsters[i]);
                    }
                }
                else
                {
                    MonsterManager.monsters[i]._distance = 0;
                }
            }
            newPhoto.PickMainMonster();
            newPhoto.CalculateScore();

            Texture2D newTexture;                                                                // here's the new texture we're about to add to our list of screenshots
            newTexture = new Texture2D(Screen.width, Screen.height, TextureFormat.RGB24, false); // getting screenshot by getting screen width/height and colord
            newTexture.ReadPixels(new Rect(0, 0, Screen.width, Screen.height), 0, 0, false);     // reading all the pictures on the screen to be stored for our screenshot
            newTexture.Apply();                                                                  // making sure that texture is UP TO DATE!

            newPhoto.photoImage = newTexture;                                                    // setting screenshot to the Photo object
            screenshots.Add(newPhoto);                                                           // adding photo to list of screenshots!
            GameManager.gm.storedPhotos.Add(newPhoto);

            numberOfFilmLeft.text = "Film Left: " + (GameManager.gm.maxFilm - GameManager.gm.storedPhotos.Count);

            ShowNewPhotoOnCanvas(newTexture); // show the picture!


            PlaySounds pse = transform.parent.GetComponent <PlaySounds>();
            pse.PlaySFX(2);         // 0 is zoom in, 1 is zoom out, 2 is pic noise

            canTakePicture = false; // you can't take another one at the moment
        }
    }
 Sprite ChangeToSprite(Photo.PhotoInstance p)
 {
     return(GameManager.gm.TurnTextureIntoSprite(p.photoImage));
 }