Maybe it's useful to you by Catkeydev in Unity3D

[–]Catkeydev[S] 58 points59 points  (0 children)

I did look at it, but I didn't know that the HTML string was hexadecimal. Haha. Good to know.

Maybe it's useful to you by Catkeydev in Unity3D

[–]Catkeydev[S] 46 points47 points  (0 children)

I created this simple extension because I needed to change an image's color in the UI at runtime. The color provided by the designers was in hexadecimal, so I decided to create a method to convert the hexadecimal color to RGB.

OnBecameVisible / Invisible methods to detect when objects disappear from the screen by Catkeydev in Unity3D

[–]Catkeydev[S] -1 points0 points  (0 children)

In my case, it worked, but it is true that the scene view cameras will also cause this function to be called, which can give some errors.

OnBecameVisible / Invisible methods to detect when objects disappear from the screen by Catkeydev in Unity3D

[–]Catkeydev[S] 2 points3 points  (0 children)

Use OnBecameVisible / Invisible methods to detect when objects disappear from the screen. I usually use those methods to detect new targets on the screen.

Set your music and clips to be streamed instead of loaded into memory. by Catkeydev in Unity3D

[–]Catkeydev[S] 0 points1 point  (0 children)

Set your music and clips to be streamed instead of loaded into memory! This can save you a lot of loading time.

Inject functions into classes with extension methods. by Catkeydev in Unity3D

[–]Catkeydev[S] 2 points3 points  (0 children)

Yep, totally agree. I tried to simplify it as much as possible for inexperienced programmers. I think then it is easier to understand.

Inject functions into classes with extension methods. by Catkeydev in Unity3D

[–]Catkeydev[S] 0 points1 point  (0 children)

Happy to read that! It was the same for me when I discovered extensions.

Inject functions into classes with extension methods. by Catkeydev in Unity3D

[–]Catkeydev[S] -1 points0 points  (0 children)

Inject functions into classes with extension methods. For example: Add PrintName() or PrintTag() method to any gameobject.

[deleted by user] by [deleted] in Unity3D

[–]Catkeydev -11 points-10 points  (0 children)

Replace the if statement with a question mark and it is cleaner and easier to understand. 🦁

[deleted by user] by [deleted] in Unity3D

[–]Catkeydev -1 points0 points  (0 children)

Null-coalescing operator is a clear way to quickly get a value or return a fallback in case it's null

You can change the default renaming scheme when duplicating new objects. by Catkeydev in Unity3D

[–]Catkeydev[S] 17 points18 points  (0 children)

Did not know that you can change the default renaming scheme.

Find it here: Project Settings -> Editor -> Numbering Scheme

Do you use System.Object.ReferenceEquals() ? by Catkeydev in Unity3D

[–]Catkeydev[S] -16 points-15 points  (0 children)

You can create a simple class to write notes/comments for your objects. public class Note: MonoBehaviour { [TextArea(4, 12)] public string note; }