Hi,
I Created an Normal .CS Script for getting the instance
whenever i called the particular function in following script.
public class Indexer
{
private static Indexer instance = null;
public static Indexer GetInstance()
{
if(instance == null)
{
instance = new Indexer();
}
return instance;
}
}
Trying to call GetInstance() in to the Class which derives Monobehaviour like below:
private Indexer index;
public class Model : Monobehaviour
{
void Start ()
{
index = Indexer.GetInstance ();
}
}
I am doing this process when user swithces from one scene to antoher scene.(say, Menu to Game scene).
But, because of this line [index = Indexer.GetInstance ();]
it hangs and crahses unity many times.
Can anyone help to solve this issue. . ?