Changes

Jump to navigation Jump to search
485 bytes added ,  15:36, 5 March 2020
Line 33: Line 33:  
You can add Unity components to any tranforms and objects by using the '''TransformParent''' record in a table that has the same name as the UnityComponent you want to add. As an example, you can add a Unity '''Light''' component to a '''Transform''' and pass the transform's name to the '''Furniture''' component's '''ColorableLights''' list and you now have a light that changes color based on what the player picks. Just make sure they are defined in the correct order (You can't refer to a TransformParent that hasn't been created yet).
 
You can add Unity components to any tranforms and objects by using the '''TransformParent''' record in a table that has the same name as the UnityComponent you want to add. As an example, you can add a Unity '''Light''' component to a '''Transform''' and pass the transform's name to the '''Furniture''' component's '''ColorableLights''' list and you now have a light that changes color based on what the player picks. Just make sure they are defined in the correct order (You can't refer to a TransformParent that hasn't been created yet).
   −
  Transforms
+
  '''Transforms'''
 
  [
 
  [
 
  {
 
  {
  Name LightUp
+
  '''Name''' <span style="color:blue">LightUp</span>
  Position [ 0; 0.5; 0 ]
+
  '''Position''' [ <span style="color:blue">0</span>; <span style="color:blue">0.5</span>; <span style="color:blue">0</span> ]
  Rotation [ 0; 0; 0 ]
+
  '''Rotation''' [ <span style="color:blue">0</span>; <span style="color:blue">0</span>; <span style="color:blue">0</span> ]
 
  }
 
  }
 
  ]
 
  ]
  Light
+
  '''Light'''
 
  {
 
  {
  TransformParent LightUp
+
  '''TransformParent <span style="color:blue">LightUp</span>
  range 10
+
  '''range''' <span style="color:blue">10</span>
  intensity 10
+
  '''intensity''' <span style="color:blue">10</span>
 
  }
 
  }
  Furniture
+
  '''Furniture'''
 
  {
 
  {
  ColorPrimaryEnabled True
+
  '''ColorPrimaryEnabled''' <span style="color:blue">True</span>
  LightPrimary True
+
  '''LightPrimary''' <span style="color:blue">True</span>
  ColorableLights [ LightUp ]
+
  '''ColorableLights''' [ <span style="color:blue">LightUp</span> ]
 
  }
 
  }
  

Navigation menu