Exemplo n.º 1
0
 public void Apply(HairDyeCollection collection, MaterialPropertyBlock block)
 {
     if (!(sourceMaterial != null))
     {
         return;
     }
     for (int i = 0; i < 8; i++)
     {
         if (((uint)copyProperties & (uint)(1 << i)) == 0)
         {
             continue;
         }
         MaterialPropertyDesc materialPropertyDesc = transferableProps[i];
         if (sourceMaterial.HasProperty(materialPropertyDesc.nameID))
         {
             if (materialPropertyDesc.type == typeof(Color))
             {
                 block.SetColor(materialPropertyDesc.nameID, sourceMaterial.GetColor(materialPropertyDesc.nameID));
             }
             else if (materialPropertyDesc.type == typeof(float))
             {
                 block.SetFloat(materialPropertyDesc.nameID, sourceMaterial.GetFloat(materialPropertyDesc.nameID));
             }
         }
     }
 }
Exemplo n.º 2
0
 public void Apply(HairDyeCollection collection, MaterialPropertyBlock block)
 {
     if (!Object.op_Inequality((Object)this.sourceMaterial, (Object)null))
     {
         return;
     }
     for (int index = 0; index < 8; ++index)
     {
         if ((this.copyProperties & (HairDye.CopyPropertyMask)(1 << index)) != (HairDye.CopyPropertyMask) 0)
         {
             MaterialPropertyDesc transferableProp = HairDye.transferableProps[index];
             if (this.sourceMaterial.HasProperty(transferableProp.nameID))
             {
                 if (transferableProp.type == typeof(Color))
                 {
                     block.SetColor(transferableProp.nameID, this.sourceMaterial.GetColor(transferableProp.nameID));
                 }
                 else if (transferableProp.type == typeof(float))
                 {
                     block.SetFloat(transferableProp.nameID, this.sourceMaterial.GetFloat(transferableProp.nameID));
                 }
             }
         }
     }
 }
Exemplo n.º 3
0
 public void Apply(HairDyeCollection collection, MaterialPropertyBlock block)
 {
     if (this.sourceMaterial != null)
     {
         for (int i = 0; i < 8; i++)
         {
             if (((int)this.copyProperties & 1 << (i & 31)) != 0)
             {
                 MaterialPropertyDesc materialPropertyDesc = HairDye.transferableProps[i];
                 if (this.sourceMaterial.HasProperty(materialPropertyDesc.nameID))
                 {
                     if (materialPropertyDesc.type == typeof(Color))
                     {
                         block.SetColor(materialPropertyDesc.nameID, this.sourceMaterial.GetColor(materialPropertyDesc.nameID));
                     }
                     else if (materialPropertyDesc.type == typeof(float))
                     {
                         block.SetFloat(materialPropertyDesc.nameID, this.sourceMaterial.GetFloat(materialPropertyDesc.nameID));
                     }
                 }
             }
         }
     }
 }