public void Init(Vector2Int gridPosition, GridNavigator gridNavigator, Sprite sprite, EntityType type, EntityFaction faction, LevelService levelService) { this.levelService = levelService; this.gridNavigator = gridNavigator; GridPosition = gridPosition; Type = type; Faction = faction; EntityView = GetComponent <EntityView>() ?? gameObject.AddComponent <EntityView>(); EntityView.Init(this, sprite, type, gridPosition, levelService); }
void IFactoryRobot.CreateViewRobot(EntityModel modelToBind, out EntityView view) { view = Object.Instantiate(PrefabPawn).GetComponent <EntityView>(); view.Init(modelToBind); }