You are on page 1of 39

C Sharp para Unity

Francisco Javier Pariona Vega


C Sharp (Definiciones)
C Sharp

C# is an elegant and type-safe object-oriented language that enables


developers to build a variety of secure and robust applications that run on
the .NET Framework.

- Microsoft (2015)
Variables

Space in system’s memory with a symbolic name associated to the space.


This space contains information that is know or unknown, thus a value.
Selection Statements

A selection statement causes the program control to be transferred to a


specific flow based upon whether a certain condition is true or not.
If-Else

An if statement identifies which statement to run based on the value of a


Boolean expression.
Switch

Switch is a selection statement that chooses a single switch section to


execute from a list of candidates based on a pattern match with the match
expression.
Switch
Iteration Statements

You can create loops by using the iteration statements. Iteration


statements cause embedded statements to be executed a number of
times, subject to the loop-termination criteria.
For

The for statement executes a statement or a block of statements while a


specified Boolean expression evaluates to true.
Foreach, in

The foreach statement executes a statement or a block of statements for


each element in an instance of the type that implements the
System.Collections.IEnumerable or
System.Collections.Generic.IEnumerable<T> interface.
Foreach, in
Arrays and Collections

For many applications, you want to create and manage groups of related
objects. There are two ways to group objects: by creating arrays of
objects, and by creating collections of objects.
Arrays

An array is a data structure that contains a number of variables that are


accessed through computed indices.

Arrays are most useful for creating and working with a fixed number of
strongly-typed objects.
Collections

Collections provide a more flexible way to work with groups of objects.


Unlike arrays, the group of objects you work with can grow and shrink
dynamically as the needs of the application change. For some collections,
you can assign a key to any object that you put into the collection so that
you can quickly retrieve the object by using the key.
Lists

Represents a strongly typed list of objects that can be accessed by index.


Provides methods to search, sort, and manipulate lists.
Dictionaries

Represents a collection of keys and values.


Methods

A method is a code block that contains a series of statements. A program


causes the statements to be executed by calling the method and
specifying any required method arguments.
Classes

Classes and structs are two of the basic constructs of the common type
system in the .NET Framework. Each is essentially a data structure that
encapsulates a set of data and behaviors that belong together as a logical
unit. The data and behaviors are the members of the class or struct, and
they include its methods, properties, and events, and so on…
Classes
Objects

A class or struct definition is like a blueprint that specifies what the type
can do. An object is basically a block of memory that has been allocated
and configured according to the blueprint. A program may create many
objects of the same class. Objects are also called instances, and they can
be stored in either a named variable or in an array or collection.
Objects
Objects
Namespaces

Namespaces are heavily used in C# programming in two ways. First, the


.NET Framework (and Unity) uses namespaces to organize its many
classes.
Namespaces

Second, declaring your own namespaces can help you control the scope of
class and method names in larger programming projects.
Namespaces
enum

The enum keyword is used to declare an enumeration, a distinct type that


consists of a set of named constants called the enumerator list.
Referencias

https://docs.microsoft.com/en-us/dotnet/csharp/getting-
started/introduction-to-the-csharp-language-and-the-net-framework

https://docs.microsoft.com/en-us/dotnet/csharp/basic-types

https://docs.microsoft.com/en-us/dotnet/csharp/tour-of-csharp/types-
and-variables

https://docs.microsoft.com/en-us/dotnet/csharp/language-
reference/keywords/switch
Referencias

https://docs.microsoft.com/en-us/dotnet/csharp/language-
reference/keywords/for

https://docs.microsoft.com/en-us/dotnet/csharp/language-
reference/keywords/foreach-in

https://docs.microsoft.com/en-us/dotnet/csharp/tour-of-csharp/arrays

https://docs.microsoft.com/en-
us/dotnet/api/system.collections.generic.list-1?view=netframework-4.7.2
Referencias

https://docs.microsoft.com/en-
us/dotnet/api/system.collections.generic.dictionary-
2?view=netframework-4.7.2

https://docs.microsoft.com/en-us/dotnet/csharp/programming-
guide/concepts/collections

https://docs.microsoft.com/en-us/dotnet/csharp/programming-
guide/classes-and-structs/local-functions
Referencias

https://docs.microsoft.com/en-us/dotnet/csharp/programming-
guide/classes-and-structs/methods

https://docs.microsoft.com/en-us/dotnet/csharp/programming-
guide/classes-and-structs/objects

https://docs.microsoft.com/en-us/dotnet/csharp/programming-
guide/classes-and-structs/

https://docs.microsoft.com/en-us/dotnet/csharp/programming-
guide/namespaces/
Contacto

● fcoparionavega@gmail.com
● https://www.facebook.com/pg/Null-GameDevs-
612116239210175/about/?ref=page_internal
● https://www.youtube.com/channel/UCpmu186jY1s3T9ADieN-
uug?fbclid=IwAR0N_DzToT5DrwwnzhVD38uusk3RvtZc8m6qHagK
bDPI0H0R4DX-TEERbP0
● https://connect.unity.com/u/francisco-javier-pariona-vega
● https://www.linkedin.com/in/francisco-javier-pariona-vega-
b86958161/

You might also like