public override void OnInspectorGUI()
    {
        DrawDefaultInspector();
        GroundBuilder myScript = (GroundBuilder)target;

        if (GUILayout.Button("Preview/Generate Monolith Crown"))
        {
            myScript.BuildMonolithCrown();
        }
    }
Beispiel #2
0
    void Start()
    {
        // Init ground
        gameObject.AddComponent <GroundBuilder>();
        ground = gameObject.GetComponent <GroundBuilder>();
        ground.setPrefabs(groundPrefab, obstaclesPrefabs);
        ground.BuildGround(size);

        // Add player
        player = Instantiate(playerPrefab, new Vector3(0f, 0.5f, 0f), Quaternion.identity);
        player.AddComponent <Player>();

        // Add Camera
        playerCamera = GameObject.FindGameObjectWithTag(Tags.CAMERA);
        playerCamera.AddComponent <FollowPlayer>();
        playerCamera.GetComponent <FollowPlayer>().offsetX      = 0;
        playerCamera.GetComponent <FollowPlayer>().offsetY      = 10;
        playerCamera.GetComponent <FollowPlayer>().offsetZ      = -10;
        playerCamera.GetComponent <FollowPlayer>().lookAtPlayer = true;
    }
Beispiel #3
0
    public override void BuildGeometry()
    {
        foreach (Transform c in transform)
        {
            if (c.gameObject.name == "_Grass")
            {
                GameObject.Destroy(c.gameObject);
                break;
            }
        }

        GameObject grass = new GameObject("_Grass");

        grass.transform.SetParent(transform, false);
        GroundBuilder.BuildGrass(grass, this);

        if (!NoWalls)
        {
            GameObject walls = new GameObject("_Walls");
            walls.transform.SetParent(grass.transform, false);
            GroundBuilder.BuildWalls(walls, this);
        }
    }
Beispiel #4
0
 public override void BuildGeometry()
 {
     GroundBuilder.BuildGroundPlane(gameObject, 500, "Assets/BZWTools/StandardAssets/Textures/water.mat");
 }
Beispiel #5
0
 private void OnEnable()
 {
     builder = (GroundBuilder)target;
 }