Anrdroid + unity game development C # Some Common "methods"

Source: Internet
Author: User

Before using this frequently-used "method", I would like to apologize to you. As I mentioned earlier, repeatbutton can implement the down and up functions. In fact, it is not the case. In this lesson, I will first correct it.

Button: the press time is short, that is, click it. repeatbutton: you can press it for a long time. How to Implement the down and up functions? The experts taught me how to create a guitext (text) or guitexture (image) and then bind a script to it. onmousedown and onmouseup can be used in the script. Haha ~~

 

 

 

Now let's take a look at the script call in C.

1. Call the same object script

Move move = (MOVE) getcomponent <move> (); // move indicates the name of the script to be called.

2. Call different object scripts

public GameObject game;Move move=game.AddComponent("move");

I used to move = new move (). The result is not correct. Hahaha ~~~

Let's share my personal experience. I bound a script corl in guitexture. CS wants to be used to control the movement of the car (move. CS), my previous thought was in corl. CS to change the move. value {transform. translate (x, y, z)} X, Y, Z; I think it's okay, but the experts are all in corl. directly use CS

Public gameobject game;

Game. Transform. Translate (New vector3 (x, y, z); to change the value, it feels very straightforward.

 

Also, I would like to share with you the features of START () and update (). Before the start () operation, it is called only once, and update () is called once every frame.

 

I am a cainiao dlnuchunge and qq316319689 (a little stupid ~~~ Please give us some advice and learn from them ~~~

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.