From d6f894d453ed500109ede31137cfedbcc50bcc0b Mon Sep 17 00:00:00 2001 From: Patrice Vignola Date: Wed, 12 Aug 2015 12:00:00 -0400 Subject: [PATCH] - Added a slight rotation to the sphere --- Assets/Scenes/BeamTest.unity | 1 + Assets/Tests/Beam/Materials/laserPic.mat | 2 +- Assets/Tests/Sphere.cs | 6 ++++++ Assets/Tests/Sphere.prefab | 2 +- 4 files changed, 9 insertions(+), 2 deletions(-) diff --git a/Assets/Scenes/BeamTest.unity b/Assets/Scenes/BeamTest.unity index 495da21..65fbfcf 100644 --- a/Assets/Scenes/BeamTest.unity +++ b/Assets/Scenes/BeamTest.unity @@ -260,6 +260,7 @@ MonoBehaviour: SpherePrototype: {fileID: 140654, guid: 646dd6566f9e1374caa3af8ad37c43d3, type: 2} PointsAmount: 400 SphereRadius: 7 + rotationSpeed: .699999988 --- !u!1 &1126063559 GameObject: m_ObjectHideFlags: 0 diff --git a/Assets/Tests/Beam/Materials/laserPic.mat b/Assets/Tests/Beam/Materials/laserPic.mat index 3f0025c..ca460d8 100644 --- a/Assets/Tests/Beam/Materials/laserPic.mat +++ b/Assets/Tests/Beam/Materials/laserPic.mat @@ -150,4 +150,4 @@ Material: data: first: name: _TintColor - second: {r: .257352948, g: .10029196, b: .233522967, a: .501960814} + second: {r: .0901960805, g: .0823529437, b: .0862745121, a: .501960814} diff --git a/Assets/Tests/Sphere.cs b/Assets/Tests/Sphere.cs index a085ad5..667ecd9 100644 --- a/Assets/Tests/Sphere.cs +++ b/Assets/Tests/Sphere.cs @@ -7,6 +7,7 @@ public class Sphere : MonoBehaviour public GameObject SpherePrototype; public int PointsAmount = 50; public float SphereRadius = 1f; + public float rotationSpeed = 0.7f; private GameObject[] nodes; @@ -16,6 +17,11 @@ public class Sphere : MonoBehaviour AssignLinks(); } + void Update() + { + transform.Rotate(Vector3.one * Time.deltaTime * rotationSpeed); + } + private void InstantiateNodes() { /* Sphere uniform distribution using the spiral method with the golden angle diff --git a/Assets/Tests/Sphere.prefab b/Assets/Tests/Sphere.prefab index c4c242a..8734b65 100644 --- a/Assets/Tests/Sphere.prefab +++ b/Assets/Tests/Sphere.prefab @@ -26,7 +26,7 @@ Transform: m_GameObject: {fileID: 140654} m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} m_LocalPosition: {x: -1.38999999, y: -.0725698322, z: -1.32421875} - m_LocalScale: {x: .100000001, y: .100000001, z: .100000001} + m_LocalScale: {x: .5, y: .5, z: .5} m_Children: [] m_Father: {fileID: 0} m_RootOrder: 0