Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- int indice;
- public Button Ant;
- public ScriptName Script;
- void Start() {
- call();
- }
- void call() {
- if (indice <= 0) { indice = 0; }
- if (indice >= 1) {
- indice = 1;
- }
- if (indice == 0)
- {
- Ant.GetComponent<ScriptName>().anteriorobj();//assim não funciona
- Ant.GetComponent<Script>().anteriorobj();//assim tambem não funcioa
- }
- else if (indice == 1)
- {
- //blablabla
- }
- }
- public class ScriptName : MonoBehaviour {
- public void anteriorobj()
- {
- Debug.Log("Active");
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement