UnityMol  0.9.6-875
UnityMol viewer / In developement
TubeUpdate.cs
Go to the documentation of this file.
1 
66 using UnityEngine;
67 using System.Collections;
68 using UI;
69 
70 public class TubeUpdate : MonoBehaviour {
71 
72 public GameObject atompointer1=null;
73 public GameObject atompointer2=null;
74 
75  // Use this for initialization
76  void Start () {
77  TubeRenderer tubeRenderer = GetComponent<TubeRenderer>();//
78  tubeRenderer.material = new Material (Shader.Find("Particles/Additive"));
79  }
80 
81  public void SetAtoms(GameObject atom1, GameObject atom2)
82  {
83  atompointer1 = atom1;
84  atompointer2 = atom2;
85  Vector3[] points = new Vector3[2];
86  points[0]=atompointer1.transform.position;
87  points[1]=atompointer2.transform.position;
88  TubeRenderer tubeRenderer = GetComponent<TubeRenderer>();
89  tubeRenderer.SetPoints ( points , 0.1f , Color.yellow );
90  }
91 
92  // Update is called once per frame
93 /*
94  void Update () {
95  if(UIData.EnableUpdate)
96  {
97  // Vector3[] points = new Vector3[2];
98  // points[0]=atompointer1.transform.position;
99  // points[1]=atompointer2.transform.position;
100  // TubeRenderer tubeRenderer = GetComponent<TubeRenderer>();
101  // tubeRenderer.SetPoints ( points , 0.1f , Color.yellow );
102  }
103  }
104 */
105 }
GameObject atompointer1
Definition: TubeUpdate.cs:72
void SetPoints(Vector3[] points, float radius, Color col)
void SetAtoms(GameObject atom1, GameObject atom2)
Definition: TubeUpdate.cs:81
Material material
Definition: TubeRenderer.cs:79
GameObject atompointer2
Definition: TubeUpdate.cs:73
void Start()
Definition: TubeUpdate.cs:76
Definition: GUIDisplay.cs:66