public void SetWeight(int vertex, string bone, int index, float weight) {
        Bone2DWeight bw = weights.Where(b => b.boneName == bone && b.vertex == vertex).FirstOrDefault();
        if (bw != null) {
            bw.weight = weight;
        }
        else {
            bw = new Bone2DWeight(bone, index, vertex, weight);

            List<Bone2DWeight> w = new List<Bone2DWeight>(weights);
            w.Add(bw);
            weights = w.ToArray();
        }
    }
Пример #2
0
    public void SetWeight(int vertex, string bone, int index, float weight)
    {
        Bone2DWeight bw = weights.Where(b => b.boneName == bone && b.vertex == vertex).FirstOrDefault();

        if (bw != null)
        {
            bw.weight = weight;
        }
        else
        {
            bw = new Bone2DWeight(bone, index, vertex, weight);

            List <Bone2DWeight> w = new List <Bone2DWeight>(weights);
            w.Add(bw);
            weights = w.ToArray();
        }
    }