/// <summary> /// Sets the gameobject position. /// </summary> public void SetPositionXY(int x, int y) { if (this._position.X != x || this._position.Y != y) { int oldX = this.GetTileX(); int oldY = this.GetTileY(); this._position.Set(x, y); if (this._components[13] != null) { LogicLayoutComponent layoutComponent = (LogicLayoutComponent)this._components[13]; if (layoutComponent.IsEnabled()) { if (this._level != null) { layoutComponent.SetPositionLayout(this._level.GetActiveLayout(), x >> 9, y >> 9); } } } if (this._globalId != -1) { this._level.GetTileMap().GameObjectMoved(this, oldX, oldY); } } }
public virtual void SetInitialPosition(int x, int y) { this.m_position.Set(x, y); LogicLayoutComponent layoutComponent = this.GetLayoutComponent(); if (layoutComponent != null && this.m_level != null) { layoutComponent.SetPositionLayout(this.m_level.GetActiveLayout(), x >> 9, y >> 9); } }
/// <summary> /// Sets the initial position. /// </summary> public virtual void SetInitialPosition(int x, int y) { this._position.Set(x, y); if (this._components[13] != null) { LogicLayoutComponent layoutComponent = (LogicLayoutComponent)this._components[13]; if (layoutComponent.IsEnabled()) { if (this._level != null) { layoutComponent.SetPositionLayout(this._level.GetActiveLayout(), x >> 9, y >> 9); } } } }
/// <summary> /// Sets the gameobject position in layout. /// </summary> public void SetPositionLayoutXY(int tileX, int tileY, int activeLayout, bool editMode) { if (this._components[13] != null) { LogicLayoutComponent layoutComponent = (LogicLayoutComponent)this._components[13]; if (layoutComponent.IsEnabled()) { if (editMode) { layoutComponent.SetEditModePositionLayout(activeLayout, tileX, tileY); } else { layoutComponent.SetPositionLayout(activeLayout, tileX, tileY); } } } }
public void SetPositionXY(int x, int y) { if (this.m_position.m_x != x || this.m_position.m_y != y) { int prevX = this.GetTileX(); int prevY = this.GetTileY(); this.m_position.Set(x, y); LogicLayoutComponent layoutComponent = this.GetLayoutComponent(); if (layoutComponent != null) { layoutComponent.SetPositionLayout(this.m_level.GetActiveLayout(), x >> 9, y >> 9); } if (this.m_globalId != 0) { this.m_level.GetTileMap().GameObjectMoved(this, prevX, prevY); } } }