Button swap

Hello I am trying to figure out how to switch other buttons when I click on 1 button kind of like this script:

(It is perfect exactly what I was looking for but I don’t want to switch just image/sprite I want to switch to a whole other button and I need to make the new buttons do something else)

using UnityEngine;
using System.Collections;
using UnityEngine.UI;
using System;

public class ButtonSwaping : MonoBehaviour {
public Button button;
public Sprite NewSprite;

void Start ()
{
  button.GetComponent<Image>().sprite = NewSprite;
}

Please always use CODE tags when you submit code on the forums it is barely readable this way:
https://discussions.unity.com/t/481379
It is literally the second thread in this forum right after the Code of Conduct which you had to read before you posted on the forums…

If you want to learn about how to make dynamic buttons in Unity UI:

https://www.youtube.com/watch?v=WX-5NQHmhVc

1 Like