Différences

Ci-dessous, les différences entre deux révisions de la page.

Lien vers cette vue comparative

Les deux révisions précédentesRévision précédente
Prochaine révision
Révision précédente
brasil:courses:blender_unity:unity:4_moving_objects [2026/08/25 19:09] – [Attaching a C# Script to a GameObject] yannbrasil:courses:blender_unity:unity:4_moving_objects [2026/08/25 19:29] (Version actuelle) – [Exercise] yann
Ligne 135: Ligne 135:
 Debug.Log statements write a log to the editor console. These logs are a starting point for debugging; they let you know which lines of code have been executed and even display the values of variables. Debug.Log statements write a log to the editor console. These logs are a starting point for debugging; they let you know which lines of code have been executed and even display the values of variables.
  
-{{:brasil:courses:blender_unity:unity:unityconsole.png|}}+{{ :brasil:courses:blender_unity:unity:unityconsoledebug.png |}}
  
 ===== The Earth rotates... ===== ===== The Earth rotates... =====
Ligne 146: Ligne 146:
 using UnityEngine; using UnityEngine;
  
-public class EarthRotation : MonoBehaviour+public class earthRotate : MonoBehaviour
 { {
     public Vector3 localRotationSpeed;     public Vector3 localRotationSpeed;
  
-    // Start is called before the first frame update +    // Start is called once before the first execution of Update after the MonoBehaviour is created 
-    private void Start()+    void Start()
     {     {
 +        
     }     }
  
     // Update is called once per frame     // Update is called once per frame
-    private void Update()+    void Update()
     {     {
         this.transform.Rotate(localRotationSpeed * Time.deltaTime, Space.Self);         this.transform.Rotate(localRotationSpeed * Time.deltaTime, Space.Self);
Ligne 168: Ligne 168:
 Set the Y-axis to 50. Set the Y-axis to 50.
  
-{{:brasil:courses:blender_unity:unity:unityearthrotationscript.png|}}+{{ :brasil:courses:blender_unity:unity:unityearthrotatescriptannoted.png?1024 |}}
  
 This variable is of type Vector3, meaning it’s a 3-dimensional vector that can store a value for the X axis, a value for the Y axis, and a value for the Z axis. This variable is of type Vector3, meaning it’s a 3-dimensional vector that can store a value for the X axis, a value for the Y axis, and a value for the Z axis.
Ligne 177: Ligne 177:
 In the editor, you can see in real time that your script is changing the GameObject’s rotation along the Y-axis. In the editor, you can see in real time that your script is changing the GameObject’s rotation along the Y-axis.
  
-{{:brasil:courses:blender_unity:unity:unitytransformrotationupdated.png|}}+{{ :brasil:courses:blender_unity:unity:unityearthrotationvalue.png |}}
  
 ===== Conclusion ===== ===== Conclusion =====
Ligne 185: Ligne 185:
 ===== Exercise ===== ===== Exercise =====
  
-  - Add a Milky Way skybox; to do this, use the Asset Store (Milky Way Skybox)+  - Add a Milky Way skybox; to do this, use the Asset Store (Milky Way Skybox) or the file {{ :brasil:courses:blender_unity:unity:milkywayskybox.unitypackage |}}
   - Make the moon rotate on its axis   - Make the moon rotate on its axis
   - Make the moon orbit the Earth   - Make the moon orbit the Earth
brasil/courses/blender_unity/unity/4_moving_objects.1787677785.txt.gz · Dernière modification : de yann
CC Attribution-Share Alike 4.0 International
Driven by DokuWiki Recent changes RSS feed Valid CSS Valid XHTML 1.0