示例#1
0
    void NewPerson(bool valid)
    {
        peopleLeft--;

        valid = (forceFake)? false : valid;

        currentPersonValid = valid;

        person.SetData(validPassports[Random.Range(0, validPassports.Count)]);
        if (!valid)
        {
            person.personData.ID = -1;
        }

        person.NewPerson();
        person.transform.position = new Vector3(-3.2f, 0.25f, 0.0f);
        float randomScale = Random.Range(1.45f, 1.65f);
        float squashness  = Random.Range(0.9f, 1.1f);

        person.transform.localScale = new Vector3(randomScale * squashness, randomScale, 1.0f);


        passport.SetData(person.personData);
        passport.SetSprites(person);
        passport.SetDisplay(person);
        passport.transform.position = person.transform.position;
        passport._collider.size     = new Vector2(0.2f, 0.25f);
        passport.ClosePassport();
        passport.enabled = false;

        visa.SetData(person.personData, today);
        visa.SetDisplay(person);
        visa.transform.position = person.transform.position;
        visa._collider.size     = new Vector2(0.54f, 0.26f);
        visa.CloseVisa();
        visa.enabled = false;

        if (person.personData.ID == -1)
        {
            switch (Random.Range(0, 6))
            {
            case 0:
            case 1:
            case 2:
                print("False passport");
                passport.Falsify();
                passport.SetDisplay(person);
                break;

            case 3:
            case 4:
                if (person.personData.nationality != 3)
                {
                    print("False visa");
                    visa.Falsify();
                    visa.SetDisplay(person);
                }
                else
                {
                    print("False passport");
                    passport.Falsify();
                    passport.SetDisplay(person);
                }
                break;

            case 5:
                print("False both");
                visa.Falsify();
                visa.SetDisplay(person);
                passport.Falsify();
                passport.SetDisplay(person);
                break;
            }
        }
        else
        {
            print("Legit");
        }

        enterSound.Play();

        state = State.PersonComing;
    }