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; } }
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(); }
private void HostPos(PacketHeader packetHeader, Connection connection, UpdatePackage incomingObject) { if (connected) { if (!updatingHostInfo) { updatingHostInfo = true; hostPos.UpdateEnemyInfo(incomingObject); updatingHostInfo = false; } } }
public void UpdateEnemyInfo(UpdatePackage package) { this.trnsfrm.position = package.position; this.velocity = package.velocity; }
public Enemy/*Number 1*/ (GameObject gameObject) : base(gameObject) { updatePackage = new UpdatePackage(Vector2.Zero); animator = (Animator)gameObject.GetComponent("Animator"); CreateAnimations(); }