简单的天气变幻系统,简单易用的unity天气插件UniStorm教程

    最近需要给场景加载一个简单的天气变幻功能,学了两天终究入门了,分享给大家 :
    1. 首先第一步下载一个UniStorm Mobile  v2.4.1.2
    //下载链接:download.csdn.net/download/qq_42310470/12257423
    2.导入成功后把,把报错不兼容的代码全部删除反正也用不到
    3.初始化UniStorm
打开 APS 窗口(Unity菜单栏:Window -> UniStorm -> Auto Player Setup -> C#)
在APS窗口中设置 Camera Type 、 Player Object 、 Main Camera 、 Character Type
   4.创建一个空物体,
   5.给空物体加上如下c#脚本(我只试了这几个天气 应该还有不少)

using System.Collections;
using System.Collections.Generic;
using UnityEngine;

public class changeweather : MonoBehaviour
{
UniStormWeatherSystem_C UniStormSystem;
// Start is called before the first frame update
private void OnGUI()
{
Rect rect1 = new Rect(10, 20, 50, 30);
Rect rect2 = new Rect(10, 60, 50, 30);
Rect rect3 = new Rect(10, 100, 50, 30);
Rect rect4 = new Rect(10, 140, 50, 30);
if ( GUI.Button(rect1, “雨”))
{
UniStormSystem.GetComponent().weatherForecaster = 12; //雨
}
if (GUI.Button(rect2, “雷雨”))
{
UniStormSystem.GetComponent().weatherForecaster = 3; //雷雨
}
if (GUI.Button(rect3, “晴天”))
{
UniStormSystem.GetComponent().weatherForecaster = 8; //晴天
}
if (GUI.Button(rect4, “雾霾”))
{
UniStormSystem.GetComponent().weatherForecaster = 1; //雾霾
}
}
void Start()
{
UniStormSystem = GameObject.Find(“UniStormSystemEditor”).GetComponent();
}
}

最终效果

简单的天气变幻系统,简单易用的unity天气插件UniStorm教程_第1张图片

参考文献:
1.https://unistorm-weather-system.fandom.com/wiki/Documentation

2.https://blog.csdn.net/shenmifangke/article/details/53431293?ops_request_misc=%257B%2522request%255Fid%2522%253A%2522158453578319725256717762%2522%252C%2522scm%2522%253A%252220140713.130056874…%2522%257D&request_id=158453578319725256717762&biz_id=0&utm_source=distribute.pc_search_result.none-task

3.https://blog.csdn.net/qq_21397217/article/details/78135923?ops_request_misc=%257B%2522request%255Fid%2522%253A%2522158453578319725256717762%2522%252C%2522scm%2522%253A%252220140713.130056874…%2522%257D&request_id=158453578319725256717762&biz_id=0&utm_source=distribute.pc_search_result.none-task

4.https://blog.csdn.net/MOLLMY/article/details/51779594?depth_1-utm_source=distribute.pc_relevant.none-task&utm_source=distribute.pc_relevant.none-task

你可能感兴趣的:(孰能生巧,unity3d,游戏开发,unity)