add 2D physics (use box2d), fixed some little bugs
This commit is contained in:
26
ExampleApp/Src/RandomColor.cs
Normal file
26
ExampleApp/Src/RandomColor.cs
Normal file
@ -0,0 +1,26 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
using Prism;
|
||||
|
||||
namespace Example
|
||||
{
|
||||
class RandomColor : Entity
|
||||
{
|
||||
void OnCreate()
|
||||
{
|
||||
Random random = new Random();
|
||||
|
||||
MeshComponent meshComponent = GetComponent<MeshComponent>();
|
||||
MaterialInstance material = meshComponent.Mesh.GetMaterial(0);
|
||||
float r = (float)random.NextDouble();
|
||||
float g = (float)random.NextDouble();
|
||||
float b = (float)random.NextDouble();
|
||||
material.Set("u_AlbedoColor", new Vec3(r, g, b));
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user