Esempio n. 1
0
    // Start is called before the first frame update
    void Start()
    {
        ColorRandomizer();
        assignPartyNames();


        if (isJob)
        {
            companyNumber = Random.Range(0, 9);
            eventName     = GameObject.FindGameObjectWithTag("Company Manager").GetComponent <CompanyManager>().CompanyList[companyNumber].name;
            eventSpriteRenderer.sprite = jobSprite;
        }
        else // is a party
        {
            theme       = (CompanyManager.trend)Random.Range(0, 12); // picks a random theme
            themeString = "Theme: " + theme.ToString(); // gets the theme name string to display
            eventSpriteRenderer.sprite = partySprite;
            salary    = 0;
            eventName = partyNameOptions[Random.Range(0, partyNameOptions.Length)];
        }

        //Appear animation. Starts small
        transform.localScale = InitialScale;

        //Tooltips setup
        /*tooltip is child object of the Event prefab*/
        tooltip = transform.Find("Tooltip(Canvas)");
        tooltip.gameObject.SetActive(false);
        salaryTooltip.text = "Salary: " + salary.ToString();
        themeTooltip.text  = themeString;
        nameTooltip.text   = eventName;

        //For tooltips blocked by the right edge of the screen, have them appear on the left
        if (transform.parent.name == "City1" ||
            transform.parent.name == "City2" ||
            transform.parent.name == "City6" ||
            transform.parent.name == "City10")
        {
            tooltip.gameObject.transform.position = new Vector3(tooltip.gameObject.transform.position.x - 0.5f,
                                                                tooltip.gameObject.transform.position.y, tooltip.gameObject.transform.position.z);
        }
    }
Esempio n. 2
0
    public int determinePartySuccess()
    {
        int result = 0;

        CompanyManager.trend playerHeadStyle = GameObject.FindGameObjectWithTag("Player").GetComponent <PlayerBehavior>().headStyle;
        CompanyManager.trend playerBodyStyle = GameObject.FindGameObjectWithTag("Player").GetComponent <PlayerBehavior>().bodyStyle;

        //  if the players head AND body in the theme
        if ((playerHeadStyle == theme) && (playerBodyStyle == theme))
        {
            result = 2;
        }
        // if the players head OR body in the theme
        else if ((playerHeadStyle == theme) || (playerBodyStyle == theme))
        {
            result = 1;
        }

        return(result);
    }
Esempio n. 3
0
    public int determineJobSuccess()
    {
        int result = 0;

        CompanyManager.trend playerHeadStyle = GameObject.FindGameObjectWithTag("Player").GetComponent <PlayerBehavior>().headStyle;
        CompanyManager.trend playerBodyStyle = GameObject.FindGameObjectWithTag("Player").GetComponent <PlayerBehavior>().bodyStyle;
        CompanyManager.trend jobWant1        = GameObject.FindGameObjectWithTag("Company Manager").GetComponent <CompanyManager>().CompanyList[companyNumber].itWants[0];
        CompanyManager.trend jobWant2        = GameObject.FindGameObjectWithTag("Company Manager").GetComponent <CompanyManager>().CompanyList[companyNumber].itWants[1];

        // only head OR body is what the company likes
        if ((playerHeadStyle == jobWant1) || (playerHeadStyle == jobWant2) ||
            (playerBodyStyle == jobWant1) || (playerBodyStyle == jobWant2))
        {
            result = 1;
        }
        // both head and body is what the company likes
        if (((playerHeadStyle == jobWant1) || (playerHeadStyle == jobWant2)) &&
            ((playerBodyStyle == jobWant1) || (playerBodyStyle == jobWant2)))
        {
            result = 2;
        }

        return(result);
    }