Video yükleniyor...

Video Yüklenemedi

Ana Sayfaya Dön

Reusable Interaction System in Unity in Under 60 🫳🗡️😎 #unitytips #unity3d

15,931 görüntüleme • 1 yıl önce •via X (Twitter)

10 Yorum

Hura profil fotoğrafı
Hura1 yıl önce

Don't forget to cast your interface to UnityEngine.Object when checking for null. If not, you'll have some crazy moments 👀. The video doesn't do null checks so it doesn't apply but it's nice to know 🙏

Sunny Valley Studio profil fotoğrafı
Sunny Valley Studio1 yıl önce

Thanks for sharing 👍

Distracted Coder profil fotoğrafı
Distracted Coder1 yıl önce

Hah I usually use SendMessage for stuff like this. Good to know there’s a better way

Sunny Valley Studio profil fotoğrafı
Sunny Valley Studio1 yıl önce

Yeah c# is staticly typed so I would recommend using interfaces. On the other hand if you work in Godot in GDScript (dynamic language) sending messages is a default way. It is super cool but the tradeoff is there is no error checking done by the compiler.

Mobius Dev-Tech profil fotoğrafı
Mobius Dev-Tech1 yıl önce

This is an example of abstraction right? It's quite powerful thanks for sharing.

Sunny Valley Studio profil fotoğrafı
Sunny Valley Studio1 yıl önce

Technically i believe it is an example of implementing polymorphism through interface implementation. You do abstract out the concept of "interactable" object by defining a common method (interface) to be called.

Alex Ameye profil fotoğrafı
Alex Ameye1 yıl önce

Nice! How are the selection outlines rendered? Extruding the vertices?

Sunny Valley Studio profil fotoğrafı
Sunny Valley Studio1 yıl önce

I explain it here 🙂

ozn1911 profil fotoğrafı
ozn19111 yıl önce

pls tell me how did you quickly add the function there

Mahima Singh profil fotoğrafı
Mahima Singh1 yıl önce

Thanks for sharing! I’ll give this a try

Benzer Videolar