//---------------------------------------------------------------------
 internal void AddDataBinder(UIDataBinder dataBinder)
 {
     if (!m_DataBinderList.Contains(dataBinder))
     {
         m_DataBinderList.Add(dataBinder);
     }
 }
    public void Apply()
    {
        binder           = GetComponentInParent <UIDataBinder>();
        experiencePoints = binder.GetExperiencePoints();

        levelIndicator = levelIndicatorObject.GetComponent <LevelIndicator>();
        levelIndicator.ApplyChanges(experiencePoints.level);

        controller.SetFill(experiencePoints.currentProgress);

        switch (controller.FillType)
        {
        case BarFillType.Static:
            binder.SaveExperience();
            controller.SetFill(experiencePoints.currentProgress);
            controller.UpdateIndicator(experiencePoints.level);
            break;

        case BarFillType.Animated:
            if (experiencePoints.nextProgress != experiencePoints.currentProgress)
            {
                StartCoroutine(AnimateBar());
            }
            break;

        default:
            throw new System.Exception("LevelBarController::Apply() called BarFillController::FillType and it returned null.");
        }
    }
Exemple #3
0
    // Start is called before the first frame update
    void Start()
    {
        Item item;

        levelScrollManager = GetComponent <ItemScrollManager>();
        container          = GetComponent <ItemSpawner>();
        snapManager        = GetComponent <SnapManager>();
        binder             = GetComponentInParent <UIDataBinder>();
    }
    private void Start()
    {
        binder = GetComponentInParent <UIDataBinder>();

        manager = GetComponent <ItemScrollManager>();
        snap    = GetComponent <SnapManager>();

        ControlState();
    }
    //---------------------------------------------------------------------
    public virtual void RefreshDataBinders(UIDataRefreshRate refreshType)
    {
        for (int index = 0; index < m_DataBinderList.Count; ++index)
        {
            UIDataBinder dataBinder = m_DataBinderList[index];
            if (dataBinder.refreshRate == refreshType)
            {
                m_DataBinderList[index].Refresh();
            }
        }

        OnRefresh(refreshType);
    }
Exemple #6
0
    private void Start()
    {
        binder = transform.parent.GetComponent <UIDataBinder>();

        killIndicatorObject = FindObjectOfType <KillIndicator>().GetIndicateObject();
        coinIndicatorObject = FindObjectOfType <CoinIndicator>().GetIndicateObject();

        killIndicator = killIndicatorObject.GetComponent <KillIndicator>();
        coinIndicator = coinIndicatorObject.GetComponent <CoinIndicator>();


        Apply();
    }
    private void Start()
    {
        uiBinder = GetComponentInParent <UIDataBinder>();

        scrollManager = GetComponent <ItemScrollManager>();
        snapManager   = GetComponent <SnapManager>();
        items         = scrollManager.GetItems();

        if (actionType == ActionType.UI)
        {
            newMapInfo.SetActive(false);
            if (PlayerData.instance.GetPlayerLevelUp() != 0)
            {
                newMapInfo.SetActive(true);
                newMapInfo.GetComponent <NewMapInfoAnimController>().Animate();
            }
        }

        if (actionType == ActionType.Shop)
        {
            shopBinder = GetComponentInParent <ShopDataBinder>();
        }
    }
 //---------------------------------------------------------------------
 internal void RemoveDataBinder(UIDataBinder dataBinder)
 {
     m_DataBinderList.Remove(dataBinder);
 }
Exemple #9
0
    private void Start()
    {
        binder = GetComponentInParent <UIDataBinder>();

        input.SetDefaultName(binder.GetName());
    }