예제 #1
0
 private void UpdatePosition(PacketHeader header, Connection connection, UpdatePackage position)
 {
     if (!updatingClientInfo)
     {
         updatingClientInfo = true;
         ((players[connection] as GameObject).GetComponent("Enemy") as Enemy).UpdateEnemyInfo(position);
         updatingClientInfo = false;
     }
 }
예제 #2
0
        public void LoadContent(ContentManager content)
        {
            animator = (Animator)gameObject.GetComponent("Animator");
            fontText = content.Load <SpriteFont>("fontText");
            phys     = gameObject.GetComponent("Physics") as Physics;

            updatePackage = new UpdatePackage(transform.position);
            CreateAnimations();
        }
예제 #3
0
 private void HostPos(PacketHeader packetHeader, Connection connection, UpdatePackage incomingObject)
 {
     if (connected)
     {
         if (!updatingHostInfo)
         {
             updatingHostInfo = true;
             hostPos.UpdateEnemyInfo(incomingObject);
             updatingHostInfo = false;
         }
     }
 }
예제 #4
0
 public void UpdateEnemyInfo(UpdatePackage package)
 {
     this.trnsfrm.position = package.position;
     this.velocity         = package.velocity;
 }
예제 #5
0
 public Enemy/*Number 1*/ (GameObject gameObject) : base(gameObject)
 {
     updatePackage = new UpdatePackage(Vector2.Zero);
     animator      = (Animator)gameObject.GetComponent("Animator");
     CreateAnimations();
 }