protected override void SetDataOnPhoton(int _playerId, BuildingType _type) { this.playerId = _playerId; if (_playerId != DefaultManager.GameController.Instance.PlayerId) { this.buildingManager = DefaultManager.GameController.Instance.GetPlayer(this.playerId).BuildingManager; this.pieceManager = DefaultManager.GameController.Instance.GetPlayer(this.playerId).PieceManager; this.buildingManager.AddUnit(this); this.transform.parent = this.buildingManager.transform; } this.status = this.buildingManager.UnitInfoDictionary[_type]; this.spriteRenderer.sprite = Pattern.Factory.SpriteFactory.Instance.GetSprite("PiecesAtlas", string.Format(buildingManager.UnitSpriteNames[this.playerId], this.status.name)); MiniUnitManager.Instance.CreateMiniUnit(this); }
internal void SetBuildingManager(BuildingManager _buildingManager) { this.buildingManager = _buildingManager; }