Unity Rolly Vortex Game - (E12): Simple Shop System - (Part 2)

Поделиться
HTML-код
  • Опубликовано: 26 ноя 2022
  • Let's finish our shop system in unity!
    ● Playlist Link: bit.ly/3NLfNPQ
    ● Game Assets: bit.ly/3xiJMsy
    ♥ Don't Click This! : bit.ly/2Zi3vu9
    ♥ My Second Channel: bit.ly/3jvI8g6
    --------------------------------------------------------------------
    ✅ My current Productivity Setup 👇:
    ● Gaming Headset: amzn.to/3HyXgp2
    ● Gaming Mouse: amzn.to/3ni4Ygp
    ● Best Webcam: amzn.to/44pVUqw
    ● Keyboard: amzn.to/3ALXB3M
    ● GPU: amzn.to/42mylNt
    ● CPU: amzn.to/44lOBjs
    --------------------------------------------------------------------
    FOLLOW ME:
    ● Facebook: / developer3.5pro
    ● Sketchfab: sketchfab.com/GDTitans
    --------------------------------------------------------------------
    ► All content by GDTitans is 100% free. I believe that education should be freely available to everyone.

Комментарии • 14

  • @khmerblog-n8z
    @khmerblog-n8z 15 дней назад +1

    ❤❤❤❤❤❤

  • @bedaprakashsaidarsansahoo6274
    @bedaprakashsaidarsansahoo6274 Год назад +2

    Thanks for this tutorial😍

  • @HD_TOON
    @HD_TOON Год назад +1

    Very helpful video bro👍

    • @GDTitans
      @GDTitans  Год назад +3

      Really appreciate it

  • @tirupatimaity
    @tirupatimaity Год назад +1

    Good job bro

  • @acesaboluffy-sr8jf
    @acesaboluffy-sr8jf 9 месяцев назад

    hello
    i followed your tutorial perfectely fine until the end;when i start collecting jems to bye skins-when i die all the collected jems reset to zero

  • @chiewcck
    @chiewcck Год назад +1

    Waiting or your next video for this series.

    • @GDTitans
      @GDTitans  Год назад +1

      What do you suggest?

    • @sandeshjamakatel8742
      @sandeshjamakatel8742 Год назад

      you still working on this project my unlock system is not working it would be grateful of you to check my code once
      using System.Collections;
      using System.Collections.Generic;
      using UnityEngine;
      using UnityEngine.UI;
      public class BallSelector : MonoBehaviour
      {
      public GameObject[] ballSkins;
      int selectedBall;
      public Ball[] balls;
      public Button[] buttons;
      public Button unlockButton;
      public void Awake()
      {
      int counter = 0;
      foreach(Ball b in balls)
      {
      b.index = counter;
      if(counter == 0)

      b.isLocked = false;
      else
      {
      if (PlayerPrefs.GetInt(b.index.ToString(), 1) == 1)
      b.isLocked = true;
      else
      b.isLocked = false;
      buttons[b.index].interactable = !b.isLocked;
      }
      counter++;
      }
      }
      // Start is called before the first frame update
      void Start()
      {
      selectedBall = PlayerPrefs.GetInt("SelectedBall", 0);
      foreach(GameObject skin in ballSkins)
      {
      skin.SetActive(false);
      }
      ballSkins[selectedBall].SetActive(true);
      }
      // Update is called once per frame
      public void Update()
      {
      if (PlayerPrefs.GetInt("TotalGems", 0) < 500)
      unlockButton.interactable = false;
      else
      unlockButton.interactable = true;
      }
      public void ChangeBall(int index)
      {
      ballSkins[selectedBall].SetActive(false);
      selectedBall = index;
      ballSkins[selectedBall].SetActive(true);
      PlayerPrefs.SetInt("SelectedBall", index);
      }
      public void Unlock()
      {
      List lockedBalls = new List();
      foreach(Ball b in balls)
      {
      if(b.isLocked)
      {
      lockedBalls.Add(b);
      }
      if (lockedBalls.Count == 0)
      return;
      int randomBall = Random.Range(0, lockedBalls.Count);
      int ballIndex = lockedBalls[randomBall].index;
      balls[ballIndex].isLocked = false;
      buttons[ballIndex].interactable = true;
      PlayerPrefs.SetInt(ballIndex.ToString(), 0);
      PlayerPrefs.SetInt("TotalGems", PlayerPrefs.GetInt("TotalGems") - 500);
      buttons[ballIndex].onClick.Invoke();
      }
      }
      }

  • @sandeshjamakatel8742
    @sandeshjamakatel8742 Год назад

    Hey titan my scripts are same but unlocking system isnot working for me
    using System.Collections;
    using System.Collections.Generic;
    using UnityEngine;
    using UnityEngine.UI;
    public class BallSelector : MonoBehaviour
    {
    public GameObject[] ballSkins;
    int selectedBall;
    public Ball[] balls;
    public Button[] buttons;
    public Button unlockButton;
    public void Awake()
    {
    int counter = 0;
    foreach(Ball b in balls)
    {
    b.index = counter;
    if(counter == 0)

    b.isLocked = false;
    else
    {
    if (PlayerPrefs.GetInt(b.index.ToString(), 1) == 1)
    b.isLocked = true;
    else
    b.isLocked = false;
    buttons[b.index].interactable = !b.isLocked;
    }
    counter++;
    }
    }
    // Start is called before the first frame update
    void Start()
    {
    selectedBall = PlayerPrefs.GetInt("SelectedBall", 0);
    foreach(GameObject skin in ballSkins)
    {
    skin.SetActive(false);
    }
    ballSkins[selectedBall].SetActive(true);
    }
    // Update is called once per frame
    public void Update()
    {
    if (PlayerPrefs.GetInt("TotalGems", 0) < 500)
    unlockButton.interactable = false;
    else
    unlockButton.interactable = true;
    }
    public void ChangeBall(int index)
    {
    ballSkins[selectedBall].SetActive(false);
    selectedBall = index;
    ballSkins[selectedBall].SetActive(true);
    PlayerPrefs.SetInt("SelectedBall", index);
    }
    public void Unlock()
    {
    List lockedBalls = new List();
    foreach(Ball b in balls)
    {
    if(b.isLocked)
    {
    lockedBalls.Add(b);
    }
    if (lockedBalls.Count == 0)
    return;
    int randomBall = Random.Range(0, lockedBalls.Count);
    int ballIndex = lockedBalls[randomBall].index;
    balls[ballIndex].isLocked = false;
    buttons[ballIndex].interactable = true;
    PlayerPrefs.SetInt(ballIndex.ToString(), 0);
    PlayerPrefs.SetInt("TotalGems", PlayerPrefs.GetInt("TotalGems") - 500);
    buttons[ballIndex].onClick.Invoke();
    }
    }
    }

    • @vinhvungoc3123
      @vinhvungoc3123 Год назад

      In unlock() function, the first value of b = 0 is unlock so count =0, it alaways return

  • @ZenoFar853
    @ZenoFar853 Год назад

    Update free fire joystick character controller for mobile tutorial

  • @cherryblack6991
    @cherryblack6991 Год назад

    Bro how to random spawn magnet or some power system in endless run game