Ejemplo n.º 1
0
    public override void OnInspectorGUI()
    {
        DrawDefaultInspector();
        GroundBuilder myScript = (GroundBuilder)target;

        if (GUILayout.Button("Preview/Generate Monolith Crown"))
        {
            myScript.BuildMonolithCrown();
        }
    }
Ejemplo n.º 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;
    }
Ejemplo n.º 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);
        }
    }
Ejemplo n.º 4
0
 public override void BuildGeometry()
 {
     GroundBuilder.BuildGroundPlane(gameObject, 500, "Assets/BZWTools/StandardAssets/Textures/water.mat");
 }
Ejemplo n.º 5
0
 private void OnEnable()
 {
     builder = (GroundBuilder)target;
 }