private void CreateOrUpdateSuperVector(SuperVector superVector) { bool unnamed = string.IsNullOrEmpty(superVector.vectorName); Color nextVectorColor = GetVectorColor(superVector.vectorName); if (unnamed) { DestroyLiveVectorIfItExists(); } else { RemoveNamedVector(superVector.vectorName); } GameObject vectorGameObject = superVector.CreateGameObject(); if (unnamed) { liveVector = vectorGameObject; } else { superVector.SetVectorColor(nextVectorColor); AddNamedVector(superVector); } }
void ChangeVectorColor(string vectorName, string hexCode) { SuperVector matchingVector = GetVectorByName(vectorName); if (matchingVector == null) { return; } Color color; if (ColorUtility.TryParseHtmlString(hexCode, out color)) { matchingVector.SetVectorColor(color); } }