Beispiel #1
0
 private void Awake()
 {
     if (singleton == null)
     {
         DontDestroyOnLoad(gameObject);
         singleton = this;
     }
     else if (singleton != this)
     {
         Destroy(gameObject);
     }
 }
Beispiel #2
0
        static void Main(string[] args)
        {
            //CustomConsoleExample();

            var encoded = GetCodePoint('S');

            BinaryFormatterTest.Test();

            Console.ReadKey();

            ActivityHandler activityHandler = new ActivityHandler();

            activityHandler.WriteActivityStateInternal();

            activityHandler.ReadActivityState();

            Console.ReadKey();

            int intVal1 = 1;
            int intVal2 = 2;

            Console.WriteLine("Integers before regular swap method: {0} & {1}", intVal1, intVal2);
            SwapIntegers(intVal1, intVal2);
            Console.WriteLine("Integers after regular swap method: {0} & {1}", intVal1, intVal2);
            SwapIntegersByRef(ref intVal1, ref intVal2);
            Console.WriteLine("Integers after ref swap method: {0} & {1}", intVal1, intVal2);
            Console.ReadKey();

            PrintRedLine();

            SimplePoint sp1 = new SimplePoint();
            SimplePoint sp2 = new SimplePoint();

            Console.WriteLine("Points before swap method: {0} & {1}", sp1, sp2);
            SwapPoints(sp1, sp2);
            Console.WriteLine("Points after swap method: {0} & {1}", sp1, sp2);
            SwapPoints(ref sp1, ref sp2);
            Console.WriteLine("Points after ref swap method: {0} & {1}", sp1, sp2);

            PrintRedLine();

            Type intListType    = typeof(List <int>);
            Type stringListType = typeof(List <string>);

            Console.WriteLine("intList type = " + intListType.ToString());
            Console.WriteLine("stringList type = " + stringListType.FullName);

            Console.WriteLine();
            Console.WriteLine("Press any key to quit...");
            Console.ReadKey();
        }
 public void FixtureSetUp()
 {
     // executes at full trust
     unit   = new BinaryFormatterTest();
     stream = unit.GetSerializedStream();
 }