コード例 #1
0
    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);
        }
    }
コード例 #2
0
    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);
        }
    }