示例#1
0
        public override bool DeSerialize(byte[] data, Pointer p)
        {
            base.DeSerialize(data, p);
            IsRefresh      = BitPacker.GetBool(data, p);
            IsServerPacket = BitPacker.GetBool(data, p);
            int num = BitPacker.GetInt(data, p);

            for (int i = 0; i < num; i++)
            {
                if (!IsRefresh)
                {
                    MatchNotificationType kind = (MatchNotificationType)BitPacker.GetInt(data, p);
                    Kinds.Add(kind);
                }

                Game theGame = BitPacker.GetComponent(data, p, IsServerPacket) as Game;

                TheGames.Add(theGame);
                bool hasTargetPlayer = BitPacker.GetBool(data, p);
                if (!IsRefresh && hasTargetPlayer)
                {
                    TargetPlayers.Add(BitPacker.GetComponent(data, p, false) as ICharacterInfo);
                }
            }
            return(true);
        }
示例#2
0
 void Awake()
 {
     GetPlayer(1);
     GetPlayer(2);
     timerScript   = GetComponent <TimerScript>();
     createScore   = GetComponent <CreateScore>();
     uIManager     = GameObject.Find("UIManager").GetComponent <UIManager>();
     targetPlayers = GameObject.Find("Main Camera").GetComponent <TargetPlayers>();
     targetPlayers.AddTargets(Player1);
     targetPlayers.AddTargets(Player2);
     Time.timeScale = 1f;
 }
 internal void Reset()
 {
     TargetPlayers.Clear();
 }