Hi there,
I have 3 scenes. One “Menu”, “Play” and “CharacterChange” scene. In my CharacterChange scene you can slect a character with a button. I want to make the button enable that charcter in my “play” scene, but i’m stuck on how to do so.
“Play” scene:
“CharacterChange” (or slection) scene:
Here is code on the “select button”:
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.UI;
using UnityEngine.SceneManagement;
public class CharacterInfoDisplay : MonoBehaviour
{
public GameObject Cuber_go;
public GameObject Cylin_go;
public GameObject Spherrow_go;
public GameObject Select;
public CharacterInfo Cuber;
public CharacterInfo Cylin;
public CharacterInfo Spherrow;
public Text nameText;
public Text specialAbilityText;
public Text descriptionText;
public int pageCounter = 0;
public bool CuberSelect;
public bool CylinSelect;
public bool SpherrowSelect;
public static Movement MovementScript;
// Use this for initialization
void Start()
{
}
// Update is called once per frame
void Update()
{
OnlyOneSelected();
PageCounterInfo();
}
public void Left_2()
{
if (pageCounter == 0)
{
pageCounter = 2;
}
else
{
pageCounter--;
}
}
public void Right_2()
{
if (pageCounter == 2)
{
pageCounter = 0;
}
else
{
pageCounter++;
}
}
public void Selected() *** // This is where the character is selected ***
{
if (pageCounter == 0)
{
CuberSelect = true;
CylinSelect = false;
SpherrowSelect = false;
}
if (pageCounter == 1)
{
CuberSelect = false;
CylinSelect = true;
SpherrowSelect = false;
}
if (pageCounter == 2)
{
CuberSelect = false;
CylinSelect = false;
SpherrowSelect = true;
}
}
}