Пример #1
0
 public static single getinstance()
 {
     if (me == null)
     {
         me = new single();
     }
     return(me);
 }
Пример #2
0
        static void Main(string[] args)
        {
            single one = single.getinstance();

            one.PrintA();
            one.a = 55;
            single two = single.getinstance();

            two.PrintA();
        }
Пример #3
0
 private void Awake()
 {
     if (single.singleton == null)
     {
         single.singleton = this;
         DontDestroyOnLoad(this);
     }
     else
     {
         Destroy(gameObject);
     }
 }
Пример #4
0
        public void Deserialize(MemoryEndianBinaryReader reader)
        {
            FieldMark fm = new FieldMark(1);

            reader.Read(fm.getData());
            if (fm.ReadMark())
            {
                x = reader.ReadSingle();
            }
            if (fm.ReadMark())
            {
                y = reader.ReadSingle();
            }
            if (fm.ReadMark())
            {
                z = reader.ReadSingle();
            }
        }