public override void OnInspectorGUI()
    {
        TreeRender tree = (TreeRender)target;

        Color newColour   = EditorGUILayout.ColorField("Base Colour", tree.baseColour);
        float newDuration = EditorGUILayout.FloatField("Anim Duration", tree.animDuration);

        if (newColour != tree.baseColour || newDuration != tree.animDuration)
        {
            tree.baseColour   = newColour;
            tree.animDuration = newDuration;

            tree.UpdateBaseMaterial();
        }
    }
Example #2
0
 /**
  * Render 3D objects into the scene
  */
 IEnumerator RenderObjects(LatLngObject mapMiddlePoint, List <BuildingObject> buildings, List <RoadObject> roads, List <TreeObject> trees)
 {
     while (!CanRenderObjects)
     {
         yield return(new WaitForSeconds(0.1f));
     }
     //render terrain
     TerrainRender.Get().GenerateTerrain(mapMiddlePoint, transform);
     //render buildings
     BuildingRender.Get().Render(transform, buildings);
     //render roads
     RoadRender.Get().Render(mapMiddlePoint, transform, roads);
     //render trees
     TreeRender.Get().GenerateTrees(mapMiddlePoint, trees);
     //init address info game objects
     MenuController.Get().AddAddressGameObjects(AddressBackground, AddressText);
     CanRenderObjects = false;
 }