public SingletonBaseSample() { SS = SingletonSample.getInstance(); //singletonで作るから明示的に潰す scene = SS.scene; touchData = SS.touchData; touchStatus = SS.touchStatus; }
//シーン終了時に呼び出す public override void Terminate() { SS.scene.RemoveAllChildren(true);//必要 terminateの最初に SS.Terminate(); SS = null; GC.Collect();//強制的にすべてのジェネレーションのガベージ コレクションを行う GC.WaitForPendingFinalizers(); GC.Collect(); }
public void Terminate() { SingletonSample.SS = null; }
/// <summary> /// Gets the instance. /// </summary> /// <returns> /// The instance. /// </returns> public static SingletonSample getInstance() { if (SingletonSample.SS == null){ SingletonSample.SS = new SingletonSample(); } return SingletonSample.SS; }