Example #1
0
    public override void SetPanel()
    {
        if (mObject == null)
        {
            LeaveBlank(); return;
        }
        timerText.text = "Available in " + timer + " days";

        GetComponent <Button>().onClick.RemoveAllListeners();
        //buyDollars.onClick.RemoveAllListeners();
        buyCoins.onClick.RemoveAllListeners();
        watchAdd.onClick.RemoveAllListeners();
        Nametxt.text      = mObject.description.Name;
        priceInCoins.text = mObject.priceInCoins.ToString();
        priceDollars.text = mObject.priceInDollars.ToString() + " $";
        image.sprite      = mObject.description.sprite;
        watchAdd.gameObject.SetActive(false);
        buyCoins.gameObject.SetActive(false);
        if (mObject.canBeWatched)
        {
            watchAdd.gameObject.SetActive(true);
            if (timer <= 0 && GetComponentInChildren <ParticleSystem>() != null)
            {
                watchAdd.GetComponentInChildren <ParticleSystem>().Play();
            }
            //watch add here, if successfull then
            watchAdd.onClick.AddListener(delegate { ConfirmPurchase("ad"); });
        }
        else if (mObject.priceInCoins > 0)
        {
            buyCoins.gameObject.SetActive(true);
            buyCoins.onClick.AddListener(delegate { ConfirmPurchase("coins"); });
        }
        // buyDollars.onClick.AddListener(delegate { ConfirmPurchase("dollars"); });

        GetComponent <Button>().onClick.AddListener(delegate { hintPanel.SetPanel(mObject.description.description, mObject.description.Name, mObject.description.sprite); });
    }
Example #2
0
 public void GetHint(string text)
 {
     hint.SetPanel(Input.mousePosition, text);
 }
Example #3
0
    // Use this for initialization

    /*void Start () {
     *  List<int> valueList = new List<int>() { 5000, 98000, 5600, 30000, 22000, 1700, 15000, 130000, 1700,-2000,10000,140000,9000,6000 };
     *  List<int> valueList2 = new List<int>() { -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000 };
     *  IPlotVisual visual  = new LineGraphVisual(plotContainer, dotSprite, dotSize, true, Color.red, Color.white);
     *  IPlotVisual barVisual = new BarChartVisual(plotContainer, Color.cyan, 0.92f);
     *  IPlotVisual redVisual = new LineGraphVisual(plotContainer, dotSprite, dotSize, false, Color.red, Color.white);
     *  List<float> extrems = ShowPlot(valueList, barVisual, 12,0,0,
     *      (int i) =>  GameDate.CreateDate(Month.January, 2000 + i, 1).year.ToString(),
     *      (float f) => String.Format("{0:n0} $", Mathf.RoundToInt(f)));
     *
     *  ShowPlot(valueList,visual,12,extrems[0], extrems[1], displayGrid:false);
     *
     * }*/

    private void ShowTooltip(Vector2 position, string text)
    {
        tooltip.autoHide = true;
        tooltip.SetPanel(position, text);
    }