#normally you would do wheelItems Count
1 messages · Page 1 of 1 (latest)
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
yea, i was just asking about the count being as i was following along with steve
i too didn't notice ur >= conditional
not sure off hand.. what can u post ur code inside here too
soo all the info is together?
yes i can post it
👍
every game works by onclick steps
and if i start the game by the end
so in the last wheel
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
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
so you need a parameter passed to the button to show which wheel to show?
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
so what, exactly is the problem?
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"
I get that, but why do you not just change the text of the button depending on the result of the first wheel?
but that is why I said you need a parameter
or you do 2 buttons
if (win) button1.active = false else button2.active = false;
then you can use the inspector
i concur
interestingly, and I dont want to discourage you, I make casino games professionally and I dont do them like this
ok, but this if (win)
this is not for a casino bro ahah
its an work
to my last school project 😦
if i make other button to associate the onclick events to the second wheel where i will connect them by this parameter?
oh really? u probably owe me some money 😈
you change your OnClick() to OnClick(int value)
then you can pass a value through to your underlying methods to tell them what to do
talk to the casino, I'm sure they would understand
yes
or do u get a design doc telling what they should be
we get both, depending on where the game is going to be used
i change this to onclick(int value)
dont know anyone maknig casino games
sure?
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
best to make a method and set all the Actives within that method rather than in the inspector
will give you much more flexibility
Unity3D casino games are fun, in the past they were all Flash games which are end of life atm
@tepid echo
now 1 function can do multiple things depending on what value we pass in as the integer
now?
i will need to put
lol i havent browsed newgrounds in years LoL
how will i put everything this in code??
dont break everything u have.. we're just showing u how u could do it
use ur judgement and figure out what u could do to modify it as least as possible to get ur desired results
not sure what they all do..
there you have all the gameobjects/actions you want to do
so just move that to code and set the gameobjects in the code inspector rather than the OnClick inspector
yes, lots of life in casino stuff and they pay good money for good games
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
kiosk is mainly what we do
yea i know what ur saying
those little machines they put up in the corner of a bowling alley
exactly
where the old guy sits and spends 50 dollars a night in quaters
playing black jack
😄
gotta horse racing and a dog racing game which brings in lots of cash
np, good to know people are thinking, I often despair at the level of people on this forum
it takes practice mate
take it slowly, first make a script which will allow you to pass a parameter value to a method on the OnClick event
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
^^ good advice
lol
my trello board is my kryptonite
so i make this
yea, that'll work to start off with... so now u hae a button that u can use depending on what state ur in
and now i need to take all the onclick events
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
lets not complicate things
action ==0 -- means use current button
otherwise use advance to other wheel
but
lol.. i was actually trying to do the opposite.. speaking in pseudo
but yea..
So the first thing you need to do is define variables in your script for each gameobject you want to affect with the onclick
how did this going to know
if the result of the first wheel was the sprite 50$????
im so confused
because you will tell it
ok
i need to put
on this if
and if else
to call
the wheel, spin button and this
right??
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
i did wonder about that, just replace it with Monobehaviour
sorry, that just happened to be the code i was working out of
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
A word of advice, try to target your answers to the level of the person you are dealing with
thanks.. ill take it
@tepid echo Can you post your code, not as a screenshot, please
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
}
}
}
Oh dear, this displays a great lack of understanding of C# syntax, lets see how far we can get
wait one
ok
btw, the OnClick you already have, which GameObject is it attached to?
SpinNP, WheelParent and the properly Button
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
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?
did you add this OnButtonClick script to a gameobject? if so which one?
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
And the unique 50$ its associated with the "prem" i think