浏览代码

add color box

/add_hero_sample
siyao 3 年前
当前提交
ba0dff49
共有 5 个文件被更改,包括 22 次插入22 次删除
  1. 5
      AwesomeUIWidgets/Assets/Scripts/RaycastableScene/GameObjectManager.cs
  2. 3
      AwesomeUIWidgets/Assets/Scripts/RaycastableScene/ItemPickerMainUIPanel.cs
  3. 3
      AwesomeUIWidgets/Assets/Scripts/RaycastableScene/LightController.cs
  4. 4
      AwesomeUIWidgets/Assets/Scripts/RaycastableScene/RaycastableSceneConfig.cs
  5. 29
      AwesomeUIWidgets/Assets/Scripts/RaycastableScene/SceneBoard.cs

5
AwesomeUIWidgets/Assets/Scripts/RaycastableScene/GameObjectManager.cs


using System;
using System.Collections.Generic;
using Unity.UIWidgets.foundation;
using UnityEngine;

}
}
}
private void Start()
private void OnEnable()
{
centerInstance = center;
cameraInstance = camera;

}
}
void OnDestroy()
void OnDisable()
{
foreach (var obj in objects)
{

3
AwesomeUIWidgets/Assets/Scripts/RaycastableScene/ItemPickerMainUIPanel.cs


using Unity.UIWidgets.engine;
using Unity.UIWidgets.material;
using Unity.UIWidgets.widgets;
using UnityEngine;
namespace UIWidgetsSample.RaycastableScene
{

new PickListItem("cube4"),
new PickListItem("ball1"),
new PickListItem("ball2"),
new PickListItem("ball4"),
new PickListItem("ball3"),
new PickListItem("cylinder1"),
new PickListItem("cylinder2")
},

3
AwesomeUIWidgets/Assets/Scripts/RaycastableScene/LightController.cs


using uiwidgets;
using UnityEngine;
namespace UIWidgetsSample.RaycastableScene

static Light lightInstance;
void Start()
void OnEnable()
{
lightInstance = light;
}

4
AwesomeUIWidgets/Assets/Scripts/RaycastableScene/RaycastableSceneConfig.cs


public const string cubeName = "cube";
public const int cubeCount = 4;
public const string ballName = "ball";
public const int ballCount = 2;
public const int ballCount = 3;
public const string cylinderName = "cylinder";
public const int cylinderCount = 2;

public const float cameraSpeed = 2;
public const float cameraSpeed = 4;
public const float scaleSceneBoard = 0.4f;
public static readonly Vector3 far = new Vector3(1000, 0, 0);
}

29
AwesomeUIWidgets/Assets/Scripts/RaycastableScene/SceneBoard.cs


using Unity.UIWidgets.painting;
using Unity.UIWidgets.ui;
using Unity.UIWidgets.widgets;
using Canvas = Unity.UIWidgets.ui.Canvas;
using Transform = Unity.UIWidgets.widgets.Transform;
namespace UIWidgetsSample.RaycastableScene
{

height: RaycastableSceneConfig.height,
color: RaycastableSceneConfig.mainColor,
child:
new Row(
children: new List<Widget>()
{
Transform.scale(
alignment: Alignment.centerLeft,
scale: RaycastableSceneConfig.scaleSceneBoard,
child: new ActionBox(
Transform.scale(
alignment: Alignment.centerLeft,
scale: RaycastableSceneConfig.scaleSceneBoard,
child: new Row(
children: new List<Widget>()
{
new ActionBox(
})
),
new ColorPicker(100),
// new LightSlider()
}
}),
// new ColorPicker(100),
new LightSlider()
}
)
);
}
}

public override Widget build(BuildContext context)
{
var color = HSVColor.fromAHSV(1, _currentSliderValue * 360, 1, 1).toColor();
return new Row(
children: new List<Widget>()
{

});
}
),
new Container(width: 30, height: 30, color: color)
}
);
}

正在加载...
取消
保存