public override void Update() { base.Update(); if (!this.isVisible || (int)this.VehicleID == 0) { return; } string vehicleName = Singleton <VehicleManager> .instance.GetVehicleName(this.VehicleID); if (!(this._cachedName != vehicleName)) { return; } this._cachedName = vehicleName; Utils.Truncate(this._label, vehicleName, "…"); }
public override void Start() { base.Start(); this.width = this.parent.width; this.height = 27f; this.autoLayoutDirection = LayoutDirection.Horizontal; this.autoLayoutStart = LayoutStart.TopLeft; this.autoLayoutPadding = new RectOffset(4, 0, 0, 0); this.autoLayout = true; this._label = this.AddUIComponent <UILabel>(); this._label.textScale = 0.8f; this._label.font = this.Font; this._label.autoSize = false; this._label.height = this.height; this._label.width = this.width - (float)this.autoLayoutPadding.left; this._label.verticalAlignment = UIVerticalAlignment.Middle; Utils.Truncate(this._label, this._prefab.Title, "…"); }