public void ReplaceLineView(UnityEngine.UI.Extensions.UILineRenderer newLine1, UnityEngine.UI.Extensions.UILineRenderer newLine2) { var index = GameComponentsLookup.LineView; var component = (LineViewComponent)CreateComponent(index, typeof(LineViewComponent)); component.Line1 = newLine1; component.Line2 = newLine2; ReplaceComponent(index, component); }
public GameEntity SetLineView(UnityEngine.UI.Extensions.UILineRenderer newLine1, UnityEngine.UI.Extensions.UILineRenderer newLine2) { if (hasLineView) { throw new Entitas.EntitasException("Could not set LineView!\n" + this + " already has an entity with LineViewComponent!", "You should check if the context already has a lineViewEntity before setting it or use context.ReplaceLineView()."); } var entity = CreateEntity(); entity.AddLineView(newLine1, newLine2); return(entity); }
public void ReplaceLineView(UnityEngine.UI.Extensions.UILineRenderer newLine1, UnityEngine.UI.Extensions.UILineRenderer newLine2) { var entity = lineViewEntity; if (entity == null) { entity = SetLineView(newLine1, newLine2); } else { entity.ReplaceLineView(newLine1, newLine2); } }