| | 1 | | using System.Collections; |
| | 2 | | using System.Collections.Generic; |
| | 3 | | using DCL.Helpers; |
| | 4 | | using UnityEngine; |
| | 5 | |
|
| | 6 | | [System.Serializable] |
| | 7 | | public class TextureModel |
| | 8 | | { |
| | 9 | | public enum BabylonWrapMode |
| | 10 | | { |
| | 11 | | CLAMP, |
| | 12 | | WRAP, |
| | 13 | | MIRROR |
| | 14 | | } |
| | 15 | |
|
| | 16 | | public string src; |
| | 17 | | public BabylonWrapMode wrap = BabylonWrapMode.CLAMP; |
| 0 | 18 | | public FilterMode samplingMode = FilterMode.Bilinear; |
| | 19 | |
|
| | 20 | | protected bool Equals(TextureModel other) |
| | 21 | | { |
| 97 | 22 | | return src == other.src && wrap == other.wrap && samplingMode == other.samplingMode; |
| | 23 | | } |
| | 24 | | public override bool Equals(object obj) |
| | 25 | | { |
| 246 | 26 | | if (ReferenceEquals(null, obj)) |
| 0 | 27 | | return false; |
| 246 | 28 | | if (ReferenceEquals(this, obj)) |
| 149 | 29 | | return true; |
| 97 | 30 | | if (obj.GetType() != this.GetType()) |
| 0 | 31 | | return false; |
| 97 | 32 | | return Equals((TextureModel) obj); |
| | 33 | | } |
| | 34 | | public override int GetHashCode() |
| | 35 | | { |
| | 36 | | unchecked |
| | 37 | | { |
| 624 | 38 | | int hashCode = (src != null ? src.GetHashCode() : 0); |
| 624 | 39 | | hashCode = (hashCode * 397) ^ (int) wrap; |
| 624 | 40 | | hashCode = (hashCode * 397) ^ (int) samplingMode; |
| 624 | 41 | | return hashCode; |
| | 42 | | } |
| | 43 | | } |
| | 44 | | } |