Hello guys.I have two scenes.In the second scene i have some gameobjects.When i go to the second scene for the first time everything is ok.But if i leave and go to the other scene and come back again the objects are not there.This happens ONLY in my mobile phone not in the editor.Any ideas?
First time i’ve entered the scene
Second time i’ve entered the scene
Here is the code that these missing objects have
using UnityEngine;
using System.Collections;
using GoMap;
using GoShared;
public class GOObject : MonoBehaviour {
public GOMap map;
public Coordinates coordinatesGPS;
public static GOObject _INStance;
private GameObject _Manager; // gia na allazei tis metavlites otan agorazei apo to shop o xristis!
public void Start()
{
if (_INStance == null)
{
_INStance = this;
DontDestroyOnLoad(this.gameObject);
_Manager = GameObject.Find("shop spiti alex"); // gia na allazei tis metavlites otan agorazei apo to shop o xristis kai na uparxei to object se oles tis skines!
Debug.Log("hi");
}
}
// Use this for initialization
void Awake () {
if (map == null) {
Debug.LogWarning ("GOObject - Map property not set");
return;
}
//register this class for location notifications
map.locationManager.onOriginSet += LoadData;
}
void LoadData (Coordinates currentLocation) {//This is called when the origin is set
map.dropPin (coordinatesGPS.latitude, coordinatesGPS.longitude, gameObject);
}
}