Inheritance: MonoBehaviour
Exemplo n.º 1
0
 // Use this for initialization
 void Start()
 {
     if (instance == null)
     {
         instance = this;
     }
 }
Exemplo n.º 2
0
    public void Import()
    {
        var mapReader = new MapReader();

        mapReader.Read(_mapFile);

        var buildingMaker = new BuildingMaker(mapReader, _buildingMaterial);
        var roadMaker     = new RoadMaker(mapReader, _roadMaterial);

        Process(buildingMaker, "Importing buildings");
        Process(roadMaker, "Importing roads");
    }
Exemplo n.º 3
0
    void Start()
    {
        designer  = this.GetComponent <Designer>();
        roadMaker = this.GetComponent <RoadMaker>();
        objs      = new GameObject[maxRail];

        //this.UpdateAsObservable()
        //.Where(_ => flag == false)
        //.Subscribe(_ =>
        //{
        //    InsRail();
        //    flag = true;
        //});
    }
Exemplo n.º 4
0
    public override void OnInspectorGUI()
    {
        serializedObject.Update();
        RoadMaker script = (RoadMaker)target;

        if (GUILayout.Button("RefreshConnections"))
        {
            script.RecalulateConnections();
        }
        base.OnInspectorGUI();
        if (GUILayout.Button("Build Road"))
        {
            script.makeRoad();
        }
        serializedObject.ApplyModifiedProperties();
    }
Exemplo n.º 5
0
    private void Start()
    {
        var playerController = GameObject.Find("PlayerController");

        playerControll = playerController.GetComponent <PlayerController>();
        designer       = this.GetComponent <Designer>();
        stageMake      = this.GetComponent <StageMake>();
        roadMaker      = this.GetComponent <RoadMaker>();
        startComplete  = this.GetComponent <StartComplete>();
        cellPoint      = stageMake.cellPoint;
        mapData        = designer.mapData;
        maxRail        = stageMake.maxRail;

        Observable.FromCoroutine(FirstCoroutine)
        .SelectMany(SecondCoroutine)
        .SelectMany(ThirdCoroutine)
        .Subscribe(_ => StartCoroutine(ThirdCoroutine()));
    }
Exemplo n.º 6
0
    private static int showRoadNowNum = 0;//当前显示到的路径的长度


    void Awake()
    {
        instance  = this;
        roadMaker = new GeneralRoadMaker();
    }
Exemplo n.º 7
0
 void Awake()
 {
     instance  = this;
     roadMaker = new GeneralRoadMaker();
     detector  = new DefaultDetecter();
 }