AoMEngineLibrary.Graphics.Model.Color3D.this C# (CSharp) 메소드

this() 공개 메소드

Gets or sets the component value at the specified zero-based index in the order of RGBA (index 0 access R, 1 access G, etc). If the index is not in range, a value of zero is returned.
public this ( int index ) : float
index int Zero-based index.
리턴 float
        public float this[int index]
        {
            get
            {
                switch(index)
                {
                    case 0:
                        return R;
                    case 1:
                        return G;
                    case 2:
                        return B;
                    default:
                        return 0;
                }
            }
            set
            {
                switch(index)
                {
                    case 0:
                        R = value;
                        break;
                    case 1:
                        G = value;
                        break;
                    case 2:
                        B = value;
                        break;
                }
            }
        }