コード例 #1
0
        public AssemblyViewer(Assembly assembly)
        {
            this.assembly = assembly;
            Inst.assemblyViewers.Add(this);

            // Create assembly container.
            gameObject = new GameObject("Assembly-" + assembly.Id);
            gameObject.transform.position = Vec3(assembly.Position);
            gameObject.transform.rotation = Quat(assembly.Rotation);

            // Create nodes.
            nodeViewers = new NodeViewer[assembly.NodesList.Count];
            for (int i = 0; i < assembly.NodesList.Count; ++i)
            {
                nodeViewers[i] = new NodeViewer(assembly.NodesList[i], assembly, gameObject.transform);
            }

            // DEBUG - randomized initiial velocities
            Vector3 randomVelocity        = UnityEngine.Random.insideUnitSphere * 1f;
            Vector3 randomAngularVelocity = UnityEngine.Random.insideUnitSphere * 1f;

            assembly.ApplyForce(randomVelocity.x, randomVelocity.y, randomVelocity.z);
            assembly.ApplyTorque(randomAngularVelocity.x, randomAngularVelocity.y, randomAngularVelocity.z);
        }         // End of Ctor.
コード例 #2
0
ファイル: Program.cs プロジェクト: AdriRed/nodes-sharp-sfml
        public static void Main(string[] args)
        {
            NodeViewer g = new NodeViewer(600, 600, "nodes", new Color(237, 242, 244));

            g.Run();
        }
コード例 #3
0
ファイル: LogViewControl.cs プロジェクト: Besyaka/swtor-emu
 private void log_OnLogAdded(NodeViewer.Log.LogRecord record)
 {
     if (this.listViewLog.InvokeRequired)
     {
         this.listViewLog.Invoke(new NodeViewer.Log.LogAddedHandler(this.log_OnLogAdded), new object[] { record });
     }
     else
     {
         this.listViewLog.Items.Add(record.Time.ToLongTimeString()).SubItems.Add(record.Message);
     }
 }