Elin Decompiled Documentation EA 23.102 Nightly
Loading...
Searching...
No Matches
RenderCamUpscaler Class Reference
Inheritance diagram for RenderCamUpscaler:
IChangeResolution

Public Member Functions

void SetEnable (bool enable)
 
void OnChangeResolution ()
 
void CreateTex (int w, int h)
 
void OnChangeResolution ()
 

Public Attributes

RenderTexture renderTex
 
RawImage image
 
bool active
 

Static Public Attributes

static RenderCamUpscaler Instance
 

Private Member Functions

void Awake ()
 

Detailed Description

Definition at line 4 of file RenderCamUpscaler.cs.

Member Function Documentation

◆ Awake()

void RenderCamUpscaler.Awake ( )
inlineprivate

Definition at line 14 of file RenderCamUpscaler.cs.

15 {
16 Instance = this;
17 }
static RenderCamUpscaler Instance

References Instance.

◆ CreateTex()

void RenderCamUpscaler.CreateTex ( int  w,
int  h 
)
inline

Definition at line 49 of file RenderCamUpscaler.cs.

50 {
51 if ((bool)renderTex)
52 {
53 renderTex.Release();
54 }
55 renderTex = new RenderTexture(w, h, 32);
56 image.texture = renderTex;
57 renderTex.filterMode = FilterMode.Point;
58 Camera.main.targetTexture = renderTex;
59 }
RenderTexture renderTex

References renderTex.

Referenced by OnChangeResolution().

◆ OnChangeResolution()

void RenderCamUpscaler.OnChangeResolution ( )
inline

Implements IChangeResolution.

Definition at line 35 of file RenderCamUpscaler.cs.

36 {
37 if (active)
38 {
39 int num = Screen.width / 2;
40 int num2 = Screen.height / 2;
41 if (!renderTex || num != renderTex.width || num2 != renderTex.height)
42 {
43 CreateTex(num, num2);
44 }
45 image.Rect().sizeDelta = new Vector2(num * 2, num2 * 2);
46 }
47 }
void CreateTex(int w, int h)

References active, CreateTex(), image, and renderTex.

Referenced by SetEnable().

◆ SetEnable()

void RenderCamUpscaler.SetEnable ( bool  enable)
inline

Definition at line 19 of file RenderCamUpscaler.cs.

20 {
21 bool flag2 = (image.enabled = enable);
22 active = flag2;
23 if (active)
24 {
26 return;
27 }
28 if ((bool)renderTex)
29 {
30 renderTex.Release();
31 }
32 Camera.main.targetTexture = null;
33 }

References active, OnChangeResolution(), and renderTex.

Member Data Documentation

◆ active

bool RenderCamUpscaler.active

Definition at line 12 of file RenderCamUpscaler.cs.

Referenced by OnChangeResolution(), and SetEnable().

◆ image

RawImage RenderCamUpscaler.image

Definition at line 10 of file RenderCamUpscaler.cs.

Referenced by OnChangeResolution().

◆ Instance

RenderCamUpscaler RenderCamUpscaler.Instance
static

Definition at line 6 of file RenderCamUpscaler.cs.

Referenced by Awake().

◆ renderTex

RenderTexture RenderCamUpscaler.renderTex

Definition at line 8 of file RenderCamUpscaler.cs.

Referenced by CreateTex(), OnChangeResolution(), and SetEnable().


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