In this chapter, we will cover:

  • Creating a basic material with Standard Shader(Specular setup)

  • Adapting a basic material from Specular setup to Metallic

  • Applying Normal maps to a Material

  • Adding Transparency and Emission maps to a material

老胡泥 發表在 痞客邦 留言(0) 人氣()

In this chapter, we will develop AI algorithms for movement by covering the following recipes:

  • Creating the behaviors template

  • Pursuing and evading

  • Adjusting the agent for physics

  • Arriving and leaving

老胡泥 發表在 痞客邦 留言(0) 人氣()

A delegate is an object that knows how to call a method.

A delegate type defines the method’s return type and its parameter types.

The following defines a delegate type called Transformer:

delegate int Transformer (int x );

Transformer is compatible with any method with an int return type and a single int parameter, such as this:

老胡泥 發表在 痞客邦 留言(0) 人氣()

In this chapter, we cover advanced C# topics that build on concepts explored in Chapters 2 and 3.

You should read the first four sections sequentially; you can read the remaining sections in any order.

Delegates

老胡泥 發表在 痞客邦 留言(0) 人氣()

Generics

C# has two separate mechanisms for writing code that is reusable across different types: inheritance and generics.

Whereas inheritance expresses reusability with a base type.

Generics, when compared to inheritance, can increase type safety and reduce casting and boxing.

C# generics and C++ templates are similar concepts, but they work differently.

老胡泥 發表在 痞客邦 留言(0) 人氣()

Nested Types

A nested type is declared within the scope of another type.

For example:

public class TopLevel

{

老胡泥 發表在 痞客邦 留言(0) 人氣()

Enums

An enum is a special value type that lets you specify a group of named numeric constants.

For example:

public enum BorderSide{ Left, Right, Top, Bottom }

We can use this enum types as follows:

老胡泥 發表在 痞客邦 留言(0) 人氣()

Interfaces

An interface is similar to a class, but it provides a specification rather than an implementation for its members.

An interface is special in the following ways:

    Interface members are all implicitly abstract.

    In contrast, a class can provide both abstract members and concrete members with implementations.

老胡泥 發表在 痞客邦 留言(0) 人氣()

A struct is similar to a class, with the following key differences:

A struct is a value type, whereas a class is a reference type.

A struct does not support inheritance (other than implicitly deriving from object, or more precisely, System.ValueType).

A struct can have all the members a class can, except the following:

A parameterless constructor

老胡泥 發表在 痞客邦 留言(0) 人氣()

The object Type

object(System.Object) is the ultimate base class for all types.

Any type can be upcast to object.

To illustrate how is useful, consider a general-purpose stack.

A stack is a data structure based on the principle of LIFO - "Last In First Out."

老胡泥 發表在 痞客邦 留言(0) 人氣()

Inheritance

A class can inherit from another class or extend or customize the original class.

Inheriting from a class lets you reuse the functionality in that class instead of building it from scratch.

A class can inherit from only a single class, but can itself be inherited by many classes, thus forming a class hierarchy.

In this example, we start by defining a class called Asset:

老胡泥 發表在 痞客邦 留言(0) 人氣()

A First C# Program

Here is a program that multiplies 12 by 30 and prints the result, 360, to the screen.

The double forward slash indicates that the remainder of a line is a comment.

using System; // importing namespace

class Test                     // class declaration

老胡泥 發表在 痞客邦 留言(0) 人氣()

1 2 3 4
Blog Stats
⚠️

成人內容提醒

本部落格內容僅限年滿十八歲者瀏覽。
若您未滿十八歲,請立即離開。

已滿十八歲者,亦請勿將內容提供給未成年人士。