Example #1
0
 public void SetMarketingState(GameProperties.AlbumMarketingState marketingState)
 {
     if (marketingState == GameProperties.AlbumMarketingState.MEGA_HIT)
     {
         this.albumUI.transform.Find("DelayedElements/elements/backgroundOverride").GetComponent <Image>().sprite = Resources.Load <Sprite>("Textures\\AlbumMEGA_HITOverlay");
     }
     else if (marketingState == GameProperties.AlbumMarketingState.FAIL)
     {
         this.albumUI.transform.Find("DelayedElements/elements/backgroundOverride").GetComponent <Image>().sprite = Resources.Load <Sprite>("Textures\\AlbumFAILOverlay");
     }
     this.marketingState       = marketingState;
     UImarketingStateText.text = marketingState.ToString();
 }
Example #2
0
    public Album(string name, GameObject albumUIPrefab)
    {
        this.id = GameGlobals.albumIdCount++;

        this.albumUI = Object.Instantiate(albumUIPrefab);

        this.UIbackgroundImageEventSystem = albumUI.transform.Find("button").GetComponent <Button>();

        //make the album ui selectable
        UIbackgroundImageEventSystem.onClick.AddListener(delegate() {
            Debug.Log("selected?");
            this.albumUI.transform.SetAsLastSibling();
        });

        this.UInameText           = albumUI.transform.Find("DelayedElements/elements/albumName").GetComponent <Text>();
        this.UIvalueText          = albumUI.transform.Find("DelayedElements/elements/valueElements/valueDisplay/albumValueText").GetComponent <Text>();
        this.UImarketingStateText = albumUI.transform.Find("DelayedElements/elements/marketingStateElements/albumMarketingStateText").GetComponent <Text>();

        this.UIinstrumentValuesTable = albumUI.transform.Find("DelayedElements/elements/valueElements/skillLevels").gameObject;


        this.albumUI.transform.Find("DelayedElements/elements/backgroundOverride").GetComponent <Image>().sprite = Resources.Load <Sprite>("Textures\\AlbumNON_PUBOverlay");

        this.marketingState       = GameProperties.AlbumMarketingState.NON_PUBLISHED;
        UImarketingStateText.text = marketingState.ToString();

        this.name            = name;
        this.UInameText.text = name;

        this.value            = 0;
        this.UIvalueText.text = value.ToString();

        instrumentValues = new Dictionary <GameProperties.Instrument, int>();

        //add values to the dictionary
        foreach (GameProperties.Instrument instrument in System.Enum.GetValues(typeof(GameProperties.Instrument)))
        {
            if (instrument == GameProperties.Instrument.NONE || instrument == GameProperties.Instrument.MARKETING)
            {
                continue;
            }
            instrumentValues[instrument] = 0;
            UIinstrumentValuesTable.GetComponentsInChildren <Text>()[(int)instrument].text = "0";
        }
    }