I am participating in the Mid-Autumn Festival Creative Submission contest, please see: Mid-Autumn Festival Creative Submission Contest for details
👉 About the author
As we all know, life is a long process of constantly overcoming difficulties and reflecting on progress. In this process, there will be a lot of questions and thoughts about life, so I decided to share my thoughts, experiences and stories to find resonance!! Focus on Android/Unity and a variety of game development skills, as well as a variety of resources to share (website, tools, materials, source code, games, etc.) what you need to welcome private me, exchange group to learn no longer lonely.
Welcome to pay attention to the public account [Mr. Empty name] for more resources and communication!
👉 background
🙎 xiaozhi: xiaokong, xiaokong, soon the Mid-Autumn Festival ah, I want to eat moon cakes, really want to run to the moon.
🙈 Small empty [took a mobile phone to check] : Chang ‘e was forced by Pang Meng, but under, eat the queen mother of the West to give her husband Hou Yi an immortal medicine, before flying to the moon palace.
🙎 Xiaozhi: Really? I miss moon cakes.
🙈 Xiao Kong: Your skin is a little greasy, but I can’t resist your body odor, my fragrant lips walk on your body, with my original desire to completely “swallow” you.
🙎 small zhi [she suddenly two cheeks red, looked down at their toes, appear so shy] : what do you say? That’s not the right thing to say.
🙈 small empty doubt: ah? Isn’t that how you feel when you eat mooncakes?
🙎 Xiaozhi: Ah!! You mean moon cake. Well, yeah! Is!!! Is!!! [thought: mental derangement, not clear, harm me to think]. Any other stories?
🙈 small empty: and so on evening again and you discuss it, now we first say the simulation of chang ‘e fly to the moon.
👉 Practice
In order to quickly understand, Chinese is used in the development process, it is recommended to use English in the actual development.
😜 Materials
First we need the planet material [Saturn/Earth/Jupiter/Mercury/Mars/Venus/Moon]. I have made a prefab for direct use in the source code project.
😜 sun
Sun this content is more, the other is two scripts.
1. Particle systems add realism
2. Add a point light source to mimic sunlight
There are two main types of particles: the dynamic firelight and the dazzling white ball in the center, using the following properties:
The running effect is as follows:
😜 Other planets
We roughly put the objects in the correct position according to the information we found in the encyclopedia [Mercury < Venus < Earth < Mars < Jupiter < Saturn].
Both RotationAroundTarget and SelfRotation scripts are mounted on each.
The SelfRotation script is very simple, just one line of code.
this.transform.Rotate
(Vector3.up*FloRotationSpeed,Space.World);
Copy the code
RotationAroundTarget The idea is to walk around a point, just like a compass.
public class RotationAroundTarget : MonoBehaviour { public Transform origin; public float speed = 20; float ry, rz; // Use this for initialization void Start () { ry = Random.Range(1, 360); rz = Random.Range(1, 360); } // Update is called once per frame void Update () { Vector3 axis = new Vector3(0, ry, rz); // The first is the point of rotation around, in this case the position of the sun, the second is the normal vector of rotation, in this case the normal vector is in the (0, Y, Z) plane, and the third is the speed of rotation. this.transform.RotateAround(origin.position, axis, speed*Time.deltaTime); }}Copy the code
We use the sun as the coordinate center. To separate it from the sun preform, Karon creates a Cube directly, places its position in the center of the sun, and then drags and assigns values to script variables.
Run as follows:
👉 chang e?
Sorry, really sorry, small empty encountered an emergency, it is really their own “load” can not go down (colleagues leave the handover work + weekend need to go home), behind the effect into a cliff slide, please control the steering wheel.
Really, xiao Kong’s idea is good, the model is ready, do not believe you see:
Although removed a hundred million little details, but does not hinder our Mid-Autumn festival ah
So, in the end, please enjoy each version of Chang ‘e. Which one impressed you more?
The versions of Chang ‘e are compared _ bilibilibili
👉 other
Project Address: Akitaka/ Chang ‘e Moon Flight – Mid-Autumn Festival (gitee.com)
📢 author: little empty and cheese in the small empty 📢 reprint instructions – be sure to indicate the source: sesame son’s personal homepage – column – the nuggets (juejin. Cn) 📢 welcome thumb up 👍 collection 🌟 📝 messages