Ejemplo n.º 1
0
    //Sets Container Position with PlayerData Stats
    private void SetContainerPosition()
    {
        float position = -1;

        position *= spawner.ItemDistance;
        switch (type)
        {
        case ItemType.Map:
            position *= GetComponentInParent <UIDataBinder>().GetMapIndex();
            break;

        case ItemType.Body:
            position *= GetComponentInParent <ShopDataBinder>().GetBodyIndex();
            break;

        case ItemType.Extra:
            switch (extraType)
            {
            case ExtraItemType.Top:
                position *= GetComponentInParent <ShopDataBinder>().GetTopIndex();
                break;

            case ExtraItemType.Front:
                position *= GetComponentInParent <ShopDataBinder>().GetFrontIndex();
                break;

            case ExtraItemType.Down:
                position *= GetComponentInParent <ShopDataBinder>().GetDownIndex();
                break;

            default:
                position *= 0f;
                break;
            }
            break;

        case ItemType.Special:
            position *= GetComponentInParent <ShopDataBinder>().GetSpecialIndex();
            break;

        case ItemType.Flag:
            ShopDataBinder shopBinder = GetComponentInParent <ShopDataBinder>();
            position *= shopBinder.GetFlagIcon();
            break;

        default:
            position *= 0f;
            break;
        }

        itemContainer.anchoredPosition = new Vector2(position, 0f);
    }
Ejemplo n.º 2
0
    private void Start()
    {
        shopBinder = GetComponentInParent <ShopDataBinder>();

        string tempFramePath = specialFramePath + " " + shopBinder.GetSpecialIndex().ToString();

        Sprite[] frames = ItemSpawner.LoadSprites(tempFramePath);

        if (frames.Length != 0)
        {
            specialFrameVisual_1.SetVisual(frames[0]);
            specialFrameVisual_2.SetVisual(frames[1]);
            specialFrameVisual_3.SetVisual(frames[2]);
        }
    }
Ejemplo n.º 3
0
    // Start is called before the first frame update
    void Start()
    {
        shopBinder = GetComponentInParent <ShopDataBinder>();

        Sprite[] sprites = ItemSpawner.LoadSprites(topPath);
        topVisual.SetVisual(sprites[shopBinder.GetTopIndex()]);
        Debug.Log("Top : " + shopBinder.GetTopIndex());

        sprites = ItemSpawner.LoadSprites(frontPath);
        frontVisual.SetVisual(sprites[shopBinder.GetFrontIndex()]);

        sprites = ItemSpawner.LoadSprites(downPath);
        downVisual.SetVisual(sprites[shopBinder.GetDownIndex()]);
        Debug.Log("Down : " + shopBinder.GetDownIndex());

        sprites = null;

        GC.Collect();
    }
Ejemplo n.º 4
0
    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>();
        }
    }
Ejemplo n.º 5
0
 private void Start()
 {
     binder        = GetComponentInParent <ShopDataBinder>();
     scrollManager = GetComponent <ItemScrollManager>();
     snapManager   = GetComponent <SnapManager>();
 }