Inspector内容开始填充完善
This commit is contained in:
30
Assets/Scripts/Manager/BackgroundController.cs
Normal file
30
Assets/Scripts/Manager/BackgroundController.cs
Normal file
@@ -0,0 +1,30 @@
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using UnityEngine;
|
||||
using UnityEngine.UI;
|
||||
|
||||
namespace Ichni.Editor
|
||||
{
|
||||
public class BackgroundController : MonoBehaviour
|
||||
{
|
||||
public Canvas backgroundCanvas;
|
||||
public Image backgroundImage;
|
||||
public Material skyboxMaterial;
|
||||
|
||||
public void EnableBackground(bool enable)
|
||||
{
|
||||
backgroundCanvas.gameObject.SetActive(enable);
|
||||
}
|
||||
|
||||
public void SetBackground(Sprite sprite)
|
||||
{
|
||||
backgroundImage.sprite = sprite;
|
||||
}
|
||||
|
||||
public void SetSkybox(Material material)
|
||||
{
|
||||
skyboxMaterial = material;
|
||||
RenderSettings.skybox = material;
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user