コード例 #1
0
    private void Awake()
    {
        ShapeToColorize          = GetComponent <ModifyColor>();
        ShapeSlider.maxValue     = 2.0f;
        ShapeSlider.wholeNumbers = true;

        ShapeSlider.value = 0.0f;
        PoolObj(ShapeSlider.value, isCreated);
    }
コード例 #2
0
        private object ModifyColor(object param)
        {
            if (m_Owner != null)
            {
                EntityView ev = m_Owner.GetView();
                if (ev != null)
                {
                    ModifyColor modify = (ModifyColor)param;
                    ev.ModifyColor(modify.nLinkID, modify.color);
                }
            }

            return(null);
        }
コード例 #3
0
    //	for this json it's RGB, not RGBA
    int WriteAttribute(ref BufferGeometry4_Attribute_Float Attribute, Color[] VectorArray, ModifyColor Modify = null)
    {
        //	gr: maybe pad here
        if (VectorArray == null)
        {
            return(0);
        }

        int VectorSize = 3;

        if (Attribute == null)
        {
            Attribute = new BufferGeometry4_Attribute_Float(VectorSize);
        }

        int FirstIndex = Attribute.array.Count / VectorSize;

        var Temp = new Color();

        for (int i = 0; i < VectorArray.Length; i++)
        {
            Temp = VectorArray[i];
            if (Modify != null)
            {
                Modify(ref Temp);
            }
            Attribute.array.Add(Temp.r);
            Attribute.array.Add(Temp.g);
            Attribute.array.Add(Temp.b);
        }

        return(FirstIndex);
    }
コード例 #4
0
    //	for this json it's RGB, not RGBA
    void WriteAttribute(ref BufferGeometry4_Attribute_Float Attribute, Color[] VectorArray, ModifyColor Modify = null)
    {
        if (VectorArray == null)
        {
            Attribute = null;
            return;
        }

        int VectorSize = 3;

        //	todo: expand array for merging multiple meshes
        Attribute = new BufferGeometry4_Attribute_Float(VectorSize);
        float[] FloatArray = new float[VectorArray.Length * VectorSize];
        for (int i = 0; i < VectorArray.Length; i++)
        {
            var Pos3 = VectorArray[i];
            if (Modify != null)
            {
                Modify(ref Pos3);
            }

            FloatArray[(i * VectorSize) + 0] = Pos3.r;
            FloatArray[(i * VectorSize) + 1] = Pos3.g;
            FloatArray[(i * VectorSize) + 2] = Pos3.b;
        }
        Attribute.array = FloatArray;
    }