Elin Decompiled Documentation EA 23.102 Nightly
Loading...
Searching...
No Matches
TextureReplace Class Reference

Public Types

enum  Source { User , Mod , Local }
 

Public Member Functions

void TryRefresh (bool force)
 
void Load (bool dateMatched)
 
void DestoryTex ()
 

Public Attributes

DateTime date
 
Texture2D tex
 
FileInfo file
 
TextureData data
 
int index
 
int w
 
int h
 
Source source
 
TextureReplace original
 

Properties

bool user [get]
 

Detailed Description

Definition at line 5 of file TextureReplace.cs.

Member Enumeration Documentation

◆ Source

Enumerator
User 
Mod 
Local 

Definition at line 7 of file TextureReplace.cs.

Member Function Documentation

◆ DestoryTex()

void TextureReplace.DestoryTex ( )
inline

Definition at line 62 of file TextureReplace.cs.

63 {
64 UnityEngine.Object.Destroy(tex);
65 }

References tex.

Referenced by TextureData.AddReplace(), and TextureData.RemoveDeletedReplace().

◆ Load()

void TextureReplace.Load ( bool  dateMatched)
inline

Definition at line 48 of file TextureReplace.cs.

49 {
50 if ((bool)tex)
51 {
52 UnityEngine.Object.Destroy(tex);
53 }
54 tex = IO.LoadPNG(file.FullName);
55 w = tex.width;
56 h = tex.height;
57 int dstX = index % 100 * data.tileW;
58 int dstY = data.tex.height - index / 100 * data.tileH - tex.height;
59 Graphics.CopyTexture(tex, 0, 0, 0, 0, tex.width, tex.height, data.tex, 0, 0, dstX, dstY);
60 }
Definition: IO.cs:11
static Texture2D LoadPNG(string _path, FilterMode filter=FilterMode.Point)
Definition: IO.cs:421
Texture2D tex
Definition: TextureData.cs:39
TextureData data

References data, file, h, index, TextureData.tex, tex, TextureData.tileW, and w.

Referenced by TryRefresh().

◆ TryRefresh()

void TextureReplace.TryRefresh ( bool  force)
inline

Definition at line 34 of file TextureReplace.cs.

35 {
36 if (File.Exists(file.FullName))
37 {
38 DateTime lastWriteTime = File.GetLastWriteTime(file.FullName);
39 bool flag = date.Year != 1 && date.Equals(lastWriteTime);
40 if (!flag || force || !tex)
41 {
42 Load(flag);
43 }
44 date = lastWriteTime;
45 }
46 }
void Load(bool dateMatched)

References date, file, Load(), and tex.

Referenced by TextureData.TryRefresh().

Member Data Documentation

◆ data

TextureData TextureReplace.data

Definition at line 20 of file TextureReplace.cs.

Referenced by Load().

◆ date

DateTime TextureReplace.date

Definition at line 14 of file TextureReplace.cs.

Referenced by TryRefresh().

◆ file

◆ h

int TextureReplace.h

Definition at line 26 of file TextureReplace.cs.

Referenced by Load(), and LayerTextureViewer.RefreshPage().

◆ index

◆ original

TextureReplace TextureReplace.original

Definition at line 30 of file TextureReplace.cs.

Referenced by TextureData.RemoveDeletedReplace().

◆ source

Source TextureReplace.source

◆ tex

Texture2D TextureReplace.tex

Definition at line 16 of file TextureReplace.cs.

Referenced by DestoryTex(), Load(), and TryRefresh().

◆ w

int TextureReplace.w

Definition at line 24 of file TextureReplace.cs.

Referenced by Load(), and LayerTextureViewer.RefreshPage().

Property Documentation

◆ user

bool TextureReplace.user
get

Definition at line 32 of file TextureReplace.cs.


The documentation for this class was generated from the following file: