예제 #1
0
 public override bool Equals(BehaviorData data)
 {
     if (GetType().Equals(data))
     {
         SimpleColor c = data as SimpleColor;
         return(r == c.r && g == c.g && b == c.b && a == c.a);
     }
     return(false);
 }
예제 #2
0
        public TextMeshPro(BinaryReader reader, int length)
        {
            long start = reader.BaseStream.Position;

            material      = new AssetPtr(reader);
            color         = new SimpleColor(reader, 16);
            raycastTarget = reader.ReadByte();
            reader.AlignStream();
            cullState   = new PersistentCalls(reader);
            text        = reader.ReadAlignedString();
            rightToLeft = reader.ReadByte();
            reader.AlignStream();
            fontAsset     = new AssetPtr(reader);
            remainingData = reader.ReadBytes(length - (int)(reader.BaseStream.Position - start));
        }
예제 #3
0
        public void UpdateColor(SerializedAssets assets, SimpleColor c, ColorSide side)
        {
            // Reset if null
            if (c == null)
            {
                if (side == ColorSide.A)
                {
                    c = SimpleColor.DefaultColorA();
                }
                else
                {
                    c = SimpleColor.DefaultColorB();
                }
            }

            if (side == ColorSide.A)
            {
                colorA.Follow <MonoBehaviorAssetData>(assets).data = c;
            }
            else
            {
                colorB.Follow <MonoBehaviorAssetData>(assets).data = c;
            }
        }