Hello!
I have a gameobject with this script attached to it, and it is marked DontDestroyOnLoad:
using UnityEngine;
using System.Collections;
public class PlanetoMapSelect : MonoBehaviour
{
public int PlaneOneSelected;
public int PlaneTwoSelected;
public Transform ScriptObject;
public GameObject LoadPlane;
// Use this for initialization
void Start()
{
Object.DontDestroyOnLoad(ScriptObject);
}
// if (LoadPlane is in scene)
//{
//load this....
//}
public void SelectPlaneOne()
{
PlaneOneSelected = 1;
Debug.Log("Plane One Selected");
Application.LoadLevel(2);
}
public void SelectPlaneTwo()
{
PlaneTwoSelected = 1;
Debug.Log("Plane Two Selected");
Application.LoadLevel(2);
}
}
So it works great, however I need an IF statement to load an object ONLY if the LoadPlane object is in the scene (as seen in the script comments) How do I get the script to recognize that the LoadPlane is in the scene, and get an IF statement to work?
Thank you!