public static CrystalFactory getInstance() { if (instance == null) { instance = new CrystalFactory(); } return(instance); }
// Use this for initialization void Start() { SSDirector director = SSDirector.getInstance(); director.currentSceneController = this; patrolFactory = Singleton <PatrolFactory> .Instance; crystalFactory = Singleton <CrystalFactory> .Instance; actionManager = gameObject.AddComponent <PatrolActionManager>() as PatrolActionManager; LoadResources(); mainCamera.GetComponent <CameraMan>().target = player; scoreController = Singleton <ScoreController> .Instance; }