Using Interfaces with C# in Unity

oferecido por
Coursera Project Network
Neste Projeto Guiado, você irá:

Write and implement an interface in C#.

Write a C# script that validates user-input in the Editor.

Use Attributes to guide game-designers when using components.

Clock1.5 hours
IntermediateIntermediário
CloudSem necessidade de download
VideoVídeo em tela dividida
Comment DotsInglês
LaptopApenas em desktop

Interfaces are a staple of good programming. They are "blueprints" for functionality and allow your code to be much more versatile, portable and understandable. In this one-hour, project-based course, you'll learn how to implement interfaces in C# and, importantly, in the Unity Editor. You'll also create a Unity ScriptableObject that implements an interface and, on that basis, become interchangeable with GameObjects in exposed variables. We will also cover different attributes that can provide convenience in coding and guidelines for designers wiring together the scene. The guided project will work with the following Unity concepts: - Interfaces - Inheritance - ScriptableObjects - Attributes This is an intermediate-level course. As such a certain familiarity with Unity and C# is assumed. If you have never used interfaces or ScriptableObjects, please complete some beginner-level guided projects before attempting this project. This project makes use of the tropical island-themed Unity project created in Create Animation Transitions in Unity (Intro to Animation 2) and in Make an Action Bar in Unity Part 1 - Modular Action System. These compliment this guided project and are recommended for a more well-rounded understanding of the concepts presented herein.

Habilidades que você desenvolverá

Video-game DevelopmentC sharp (C#) Programming LanguageUnity 3DUnityApplication development

Aprender passo a passo

Em um vídeo reproduzido em uma tela dividida com a área de trabalho, seu instrutor o orientará sobre esses passos:

  1. Introduction and License Activation

  2. Create an IAction Interface

  3. Modify ActionButton to Accept Interfaces

  4. Create an Action ScriptableObject

  5. Adapt OnValidate to accept ScriptableObjects

  6. Add Attributes to Guide Designers

Como funcionam os projetos guiados

Sua área de trabalho é um espaço em nuvem, acessado diretamente do navegador, sem necessidade de nenhum download

Em um vídeo de tela dividida, seu instrutor te orientará passo a passo

Perguntas Frequentes – FAQ

Perguntas Frequentes – FAQ

Mais dúvidas? Visite o Central de Ajuda ao Aprendiz.