Unity 3D – Intro about attributes and events .

This will update your component into visual area of Unity.
Some public variables will be fasioned and change with your selected attributes.
The attributes can be used into programming using the [] .
The class can have on top this attribute and is follow by the code source.
this will add a url

this will block drag and drop your component to just once.

this will block remove the component depend it TEST.

You can remove step by step , but when you add this also add both this component and the TEST component.
Many attributes use sections used to separate and show infos , like:
show word Details

make a space into Unity Inspector

show the header like Stats

this tell is a multiline for text area

renders a flexible textbox with a scrollbar.

create a slider from 0.0 to 360.0 for variable circle_angle

will be hide the public variables

this will execute the code , for example: you can execute the camera follow even you don’t use play mode.

this allow to run code GiveObject by create a menu on
Tools – Give object – Do it

then when play and used it this will run GiveObject

this gets serialized even though it is private

This can be a good example when you use sprites and colliders.
Example:

Then you need to use them and need to tell Unity something about your code

… and will show on development like a warning message “This one is old”

This part of the tutorial is more complex and is about events:
This attribute tell Unity can serializable something ( like: using events system ) .

Example with one serializable event:

I named the script , class and variable for event just to understand how this works.
You can use anything else for event : read_event_player, read_heat, read
You can change the name of the script or the class for event.
You can add Listener into your script and use them
NOTE: You can add new listeners to event, but you cannot see them in Unity Inspector.
Example: use Start area of code to add this:

then create this to use it:

If you take a look on Unity Inspector you don’t see this , just the print of Debug.Log
This events part is old but is ofen used by users.
You can use C# events and not the Unity events .
The Unity events is super powerfull for Unity development and is easy to use them.
If not you need to have some custom code for this type of tasks.
You can use something else into events (but not more 4 args) :

and use it

This is a little tricky but you can pass anything you want with events system.

Unity 3D – using the gyroscope.

If your tablet, phone or laptop has a gyroscope device then you can used with Unity 3D game engine.
Create your project and use this C# script to test and show info about your gyroscope device.

The programming tool : TIO .

The development team come with this intro:
TIO is a family of online interpreters for an evergrowing list of practical and recreational programming languages.

To use TIO, simply click the arrow below, pick a programming language, and start typing. Once you click the run button, your code is sent to a TIO arena, executed in a sandboxed environment, and the results are sent back to your browser. You can share your code by generating a client-side permalink that encodes code and input directly in the URL.
You can test a total of 500 programming languages.
You can test it at official webpage.
This is a screenshot with all programming languages:

Android Studio – using photo camera.

This tutorial is a good example how to use photo camera with Android Studio.
Start the default project named BitCam and change this files:
The BitCam.java file:

The activity_bit_cam.xml file:

The result is a android application with a button.
When you press the button the photo camera start.

Android Studio – the calendar widget .

This is a simple example about using widget calendar under Andoid OS.
Can be easy to do it if you know the basic of the programming.
First you need to make one application ( I use Android Studio – version 0.5.1).
Let’s see my example:
My application use:
the class is :
public class MainActivity extends ActionBarActivity
the project is set with this :
com.example.calendar.app
the widget is : CalendarView
I make this changes into this source files :

  • MainActivity,java
  • AndroidManifest.xml
  • activity_main.xml
  • main.xml
  • strings.xml

The source code for this files come with default source code and change is CalendarView :
The result working well. Also you can see in this picture the calendar result :

android_calendar_001