UnityMol  0.9.6-875
UnityMol viewer / In developement
BallUpdateRC.cs
Go to the documentation of this file.
1 
66 using UnityEngine;
67 using System.Collections;
68 using UI;
69 
70 
71 public class BallUpdateRC : BallUpdate {
72  // Only check for d3d once
73  public static float maxV = 0;
74 // public long number=0;
75 
76 
77  void Start (){
78  atomcolor=GetComponent<Renderer>().material.GetColor("_Color");
79  }
80 
81  void Update ()
82  {
83  if(UIData.atomtype != UIData.AtomType.raycasting)
84  {
85  GetComponent<Renderer>().enabled = false;
86  return;
87  }
88 
89  if(!GetComponent<Rigidbody>())
90  {
92  {
93  GetComponent<Renderer>().material.SetFloat("_Rayon",rayon*radiusFactor);
95  }
97  {
98  GetComponent<Renderer>().material.SetColor("_Color", atomcolor);
100  }
101  }
102 
103 
105  {
106  if(!GetComponent<MouseOverMolecule>())
107  {
108  gameObject.AddComponent<MouseOverMolecule>();
109  }
110  }
111  else
112  {
113  if(GetComponent<MouseOverMolecule>())
114  {
115  Destroy(GetComponent<MouseOverMolecule>());
116  }
117  }
118 
119  }
120 
121 }
Color atomcolor
Definition: BallUpdate.cs:86
static float maxV
Definition: BallUpdateRC.cs:73
void Start()
Definition: BallUpdateRC.cs:77
float rayon
Definition: BallUpdate.cs:78
!WiP Includes FLAGS of GUI.
Definition: UIData.cs:78
Color oldatomcolor
Definition: BallUpdate.cs:87
static float radiusFactor
Definition: BallUpdate.cs:81
static float oldRadiusFactor
Definition: BallUpdate.cs:82
static AtomType atomtype
Definition: UIData.cs:139
void Update()
Definition: BallUpdateRC.cs:81
Definition: GUIDisplay.cs:66