Загрузка видео...

Не удалось загрузить видео

На главную

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

15,931 просмотров • 1 год назад •via X (Twitter)

Комментарии: 10

Фото профиля Hura
Hura1 год назад

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
Sunny Valley Studio1 год назад

Thanks for sharing 👍

Фото профиля Distracted Coder
Distracted Coder1 год назад

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

Фото профиля Sunny Valley Studio
Sunny Valley Studio1 год назад

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
Mobius Dev-Tech1 год назад

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

Фото профиля Sunny Valley Studio
Sunny Valley Studio1 год назад

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
Alex Ameye1 год назад

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

Фото профиля Sunny Valley Studio
Sunny Valley Studio1 год назад

I explain it here 🙂

Фото профиля ozn1911
ozn19111 год назад

pls tell me how did you quickly add the function there

Фото профиля Mahima Singh
Mahima Singh1 год назад

Thanks for sharing! I’ll give this a try

Похожие видео