예제 #1
0
 private ToolGUI GetToolGUI()
 {
     if (toolGUI == null)
     {
         toolGUI = gameObject.AddComponent <ToolGUI> ();
     }
     return(toolGUI);
 }
예제 #2
0
    // ------------------------------------------------------------------------ //

    // Use this for initialization
    void Start()
    {
        this.tool_gui = this.GetComponent <ToolGUI>();

        // カメラのインスタンスを探しておく.
        this.main_camera = GameObject.FindGameObjectWithTag("MainCamera");

        this.tool_camera = this.main_camera.GetComponent <ToolCameraControl>();
        this.game_camera = this.main_camera.GetComponent <GameCameraControl>();
        this.car_camera  = this.main_camera.GetComponent <CarCamera>();

        this.tool_camera.enabled = true;
        this.game_camera.enabled = false;
        this.car_camera.enabled  = false;

        this.game_control = GameObject.FindGameObjectWithTag("GameController").GetComponent <GameControl>();
        this.game_control.tool_control = this;

        //

        this.line_drawer      = (Instantiate(this.LineDrawerPrefab) as GameObject).GetComponent <LineDrawerControl>();
        this.line_drawer.root = this;

        this.waku_object = GameObject.Find("waku");

        //

        this.road_creator       = new RoadCreator();
        this.tunnel_creator     = new TunnelCreator();
        this.forest_creator     = new ForestCreator();
        this.buil_arranger      = new BuildingArranger();
        this.jump_slope_creator = new JumpSlopeCreator();

        this.junction_finder = new JunctionFinder();

        this.tunnel_creator.TunnelPrefab = this.TunnelPrefab;
        this.tunnel_creator.road_creator = this.road_creator;
        this.tunnel_creator.main_camera  = this.main_camera;
        this.tunnel_creator.tool_gui     = this.tool_gui;
        this.tunnel_creator.create();

        this.forest_creator.TreePrefab   = this.TreePrefab;
        this.forest_creator.road_creator = this.road_creator;
        this.forest_creator.main_camera  = this.main_camera;
        this.forest_creator.tool_gui     = this.tool_gui;
        this.forest_creator.create();

        this.buil_arranger.BuildingPrefabs = this.BuildingPrefabs;
        this.buil_arranger.road_creator    = this.road_creator;
        this.buil_arranger.main_camera     = this.main_camera;
        this.buil_arranger.tool_gui        = this.tool_gui;
        this.buil_arranger.create();

        this.jump_slope_creator.JumpSlopePrefab = this.JumpSlopePrefab;
        this.jump_slope_creator.road_creator    = this.road_creator;
        this.jump_slope_creator.main_camera     = this.main_camera;
        this.jump_slope_creator.tool_gui        = this.tool_gui;
        this.jump_slope_creator.create();

        this.junction_finder.create();

        //

        this.game_camera.road_creator = this.road_creator;

        this.step = STEP.EDIT;
    }