#normally you would do wheelItems Count

1 messages · Page 1 of 1 (latest)

tepid echo
#

If we talk here i thinks its better

#

when i touch " volte para a roleta " he goes back to the start

#

and i want to appear other button who sends me to other wheel and not this button

#

this is the other wheel.

#

@dapper gate wheelItems.Count its counting how much items i got on my wheel

#

in my case i got 8

dapper gate
#

yea, i was just asking about the count being as i was following along with steve

#

i too didn't notice ur >= conditional

tepid echo
#

yes xd

#

can u got some solution to me??

dapper gate
#

not sure off hand.. what can u post ur code inside here too

#

soo all the info is together?

tepid echo
#

yes i can post it

dapper gate
#

👍

tepid echo
#

every game works by onclick steps

#

and if i start the game by the end

#

so in the last wheel

sand sigil
#

tbh, not sure of the problem you are having, your code has problems but probably not related. why can you not just activate another button if that is what you want

tepid echo
#

he works perfectly he spins 1 time i get the result, he shows me the button back to the first wheel

#

i stay spinning on the first wheel but when i got the reward 50$ i cant make anything to bring me back to the second wheel

sand sigil
#

so you need a parameter passed to the button to show which wheel to show?

tepid echo
#

No, i want when the Win Reward on the first wheel be like this

#

in other side dont appear this " Volte para a roleta" that means try again

#

and yes appear "Go to second wheel"

#

And activates to me the second wheel

sand sigil
#

so what, exactly is the problem?

tepid echo
# tepid echo

I got 2 wheels Steve, and i want when on the first wheel i got this reward

#

Dont show me this button " Volte para a roleta"

#

And yes show me other button saying "Go to the second wheel"

sand sigil
#

I get that, but why do you not just change the text of the button depending on the result of the first wheel?

tepid echo
#

because this button

#

is associated with this

sand sigil
#

but that is why I said you need a parameter

tepid echo
#

hummmm i understand now

sand sigil
#

or you do 2 buttons

if (win) button1.active = false else button2.active = false;

then you can use the inspector

dapper gate
#

i concur

sand sigil
tepid echo
#

ok, but this if (win)

#

this is not for a casino bro ahah

#

its an work

#

to my last school project 😦

tepid echo
dapper gate
sand sigil
dapper gate
#

^ that agood idea

#

if value == 1 u pressed button1 do that logic

#

etc

#

or 0, 1

sand sigil
dapper gate
#

@sand sigil side note,

#

do u handle the chances and odds of the games

sand sigil
#

yes

dapper gate
#

or do u get a design doc telling what they should be

sand sigil
#

we get both, depending on where the game is going to be used

dapper gate
#

i find that very interesting

#

got friends that work for Meta, and Respawn even

tepid echo
#

i change this to onclick(int value)

dapper gate
#

dont know anyone maknig casino games

tepid echo
#

sure?

dapper gate
#

thats legit

#

if u make a public function with a parameter to pass in u should be able to assign that value to the event u set up in the inspector

sand sigil
#

will give you much more flexibility

sand sigil
dapper gate
#

@tepid echo

#

now 1 function can do multiple things depending on what value we pass in as the integer

tepid echo
#

wow

#

so im fucked up

tepid echo
#

i will need to put

dapper gate
#

lol i havent browsed newgrounds in years LoL

tepid echo
#

how will i put everything this in code??

dapper gate
#

use ur judgement and figure out what u could do to modify it as least as possible to get ur desired results

dapper gate
sand sigil
sand sigil
dapper gate
#

i could see that.. i was thinking of getting into training sims

#

or kiosk applications

#

never thought of casino's for some reason

#

thats a good gig it sounds

sand sigil
#

kiosk is mainly what we do

dapper gate
#

yea i know what ur saying

#

those little machines they put up in the corner of a bowling alley

sand sigil
#

exactly

dapper gate
#

where the old guy sits and spends 50 dollars a night in quaters

#

playing black jack

#

😄

sand sigil
#

gotta horse racing and a dog racing game which brings in lots of cash

dapper gate
#

very interesting

#

sorry i highjacked the thread, i was just curious

sand sigil
#

np, good to know people are thinking, I often despair at the level of people on this forum

tepid echo
#

no problem kk

#

im trying to make this

#

im so bad at this 😦

dapper gate
#

it takes practice mate

sand sigil
#

take it slowly, first make a script which will allow you to pass a parameter value to a method on the OnClick event

dapper gate
#

dont beat urself up

#

isolate systems as u work on them

#

say, ight i need to do this before i do anything else

#

then do that thing first

#

before worrying about anything else..

#

then add onto it, etc etc

sand sigil
#

^^ good advice

dapper gate
#

the only way i make it thru day to day

#

😄

sand sigil
#

lol

tepid echo
dapper gate
#

my trello board is my kryptonite

tepid echo
#

so i make this

dapper gate
#

yea, that'll work to start off with... so now u hae a button that u can use depending on what state ur in

tepid echo
#

and now i need to take all the onclick events

dapper gate
#

so if u push the red button if(action ==0) we'll pretend we want zero to dispense red candy

#

else if action != zero.. well dont dispense red candy

#

check if its 1.. maybe 1 is green candy

#

lol

sand sigil
#

lets not complicate things
action ==0 -- means use current button
otherwise use advance to other wheel

tepid echo
#

but

dapper gate
#

but yea..

tepid echo
#

they are not together

#

this is better

dapper gate
#

ayye. whatever helps u out

#

its ur structure afterall

sand sigil
# tepid echo this is better

So the first thing you need to do is define variables in your script for each gameobject you want to affect with the onclick

tepid echo
#

how did this going to know

#

if the result of the first wheel was the sprite 50$????

#

im so confused

sand sigil
#

because you will tell it

tepid echo
#

ok

#

i need to put

#

on this if

#

and if else

#

to call

#

the wheel, spin button and this

#

right??

sand sigil
#

no, it doesn't need to be that difficult

#

lets take this step by step
firstly set up your button using this script as the onclick

tepid echo
sand sigil
#

i did wonder about that, just replace it with Monobehaviour

dapper gate
#

i was playing around with a Singleton maker

#

i forget theres a high chance that any stray piece of code will be copied along with any examples u paste ;D

sand sigil
tepid echo
sand sigil
#

@tepid echo Can you post your code, not as a screenshot, please

tepid echo
#

public class GameManager: MonoBehaviour<GameManager>
{
public GameObject Player;
public void Start()
{
Debug.Log(message: "Check", this);
}

public void ButtonPress(int action)
{
    if (action = 0)
    {
        // 
    }else if(action = 1)
    {
        //do
    }
}

}

sand sigil
#

Oh dear, this displays a great lack of understanding of C# syntax, lets see how far we can get

tepid echo
#

yes some

#

im not too good coding

sand sigil
#

wait one

tepid echo
#

ok

sand sigil
#

btw, the OnClick you already have, which GameObject is it attached to?

tepid echo
#

SpinNP, WheelParent and the properly Button

#

All GameObject that i got on my OnClicks turn Active the things i told u upper

sand sigil
# tepid echo All GameObject that i got on my OnClicks turn Active the things i told u upper

ok, so you need to start with something like this

using System.Collections;
using System.Collections.Generic;
using UnityEngine;

public class OnClickButton : MonoBehaviour
{
    public GameObject[] objectsToActivate; // Set in inspector
    public GameObject[] objectsToDeactivate; // Set in inspector

    public void Start()
    {
        Debug.Log(message: "Check", this);
    }

    public void ButtonPress(int action)
    {
        if (action == 0)
        {
            for (int i=0;i<objectsToActivate.Length;i++)
            {
                objectsToActivate[i].SetActive(true);
            }
            for (int i = 0; i < objectsToDeactivate.Length; i++)
            {
                objectsToDeactivate[i].SetActive(false);
            }
        }
        else
        {
            for (int i = 0; i < objectsToActivate.Length; i++)
            {
                objectsToActivate[i].SetActive(false);
            }
            for (int i = 0; i < objectsToDeactivate.Length; i++)
            {
                objectsToDeactivate[i].SetActive(true);
            }
        }
    }
}

and fill in the inspector values with the right gameobjects

tepid echo
#

in inspector

#

do not appear to me

#

this

#

optio n

#

wait a moment

#

and if we forget the button and when the result on the wheel 1 was 50$ he gets only an transition to the wheel 2

#

its more easy?

sand sigil
tepid echo
#

Yes i did it

#

now i got this

#

Maybe this can help on the code of onbuttons no? here i got the 2 item types which are associated with the Sprites of each item on the wheel

tepid echo