예제 #1
0
 void Start()
 {
     _gridSystem = this;
     DontDestroyOnLoad(this);
     TerainSpawner();
     ForestSpawner();
     _surface.Bake();
 }
예제 #2
0
 void Update()
 {
     if (Input.GetButtonDown("Fire1"))
     {
         surface.Bake();
     }
 }
 public static void Bake()
 {
     if (surface != null)
     {
         surface.Bake();
     }
 }
예제 #4
0
 // Update is called once per frame
 void Update()
 {
     if (mapGen.generated)
     {
         mapGen.generated = false;
         nav.Bake();
     }
 }
예제 #5
0
        void BakeSurface(NavMeshSurface navSurface)
        {
            var destroy = navSurface.bakedNavMeshData;

            navSurface.Bake(s_DebugVisualization);

            DestroyImmediate(destroy, true);
            // Explicitly set the scene as dirty - otherwise the reference will be lost
            EditorSceneManager.MarkSceneDirty(navSurface.gameObject.scene);
        }
예제 #6
0
 void Update()
 {
     if (Input.GetButtonDown("Fire1"))
     {
         surface.Bake();
     }
     else if (Input.GetButtonDown("Fire2"))
     {
         surface.RemoveData();
     }
 }
        void BakeSurface(NavMeshSurface navSurface)
        {
            var destroy = navSurface.bakedNavMeshData;

            navSurface.Bake(s_DebugVisualization);

            AssetDatabase.DeleteAsset(AssetDatabase.GetAssetPath(destroy));
            SaveNavMeshAsset(navSurface);
            ApplyIfPrefab(navSurface);
            // Explicitly set the scene as dirty - otherwise the reference will be lost
            EditorSceneManager.MarkSceneDirty(navSurface.gameObject.scene);
        }
        void BakeSurface(NavMeshSurface navSurface)
        {
            var assetToDelete = GetNavMeshAssetToDelete(navSurface);

            navSurface.Bake();
            EditorUtility.SetDirty(navSurface);

            if (assetToDelete)
            {
                AssetDatabase.DeleteAsset(AssetDatabase.GetAssetPath(assetToDelete));
            }
            CreateNavMeshAsset(navSurface);
            EditorSceneManager.MarkSceneDirty(navSurface.gameObject.scene);
        }
예제 #9
0
    // Update is called once per frame
    void Update()
    {
        if (Input.GetButtonDown("Fire1"))
        {
            if (!baked)
            {
                plateau.Bake();
                baked = true;
            }
        }

        else if (Input.GetButtonDown("Fire2"))
        {
            if (baked)
            {
                plateau.RemoveData();
                baked = false;
            }
        }
    }
예제 #10
0
 // Use this for initialization
 void Start()
 {
     plateau = GetComponent <NavMeshSurface>();
     plateau.Bake();
     baked = true;
 }
예제 #11
0
    //// Use this for initialization
    //void Start()
    //{

    //}
    //public bool editorBake;
    //// Update is called once per frame
    //void Update()
    //{
    //    if (editorBake)
    //    {
    //        //do a thing
    //        mySurface.Bake();
    //        editorBake = false;
    //    }
    //}

    public void Bake()
    {
        mySurface.Bake();
    }
예제 #12
0
 void UpdateNavMesh()
 {
     surface.RemoveData();
     surface.transform.position = transform.position;
     surface.Bake();
 }
예제 #13
0
 void GenNevMesh()
 {
     navMesh.Bake();
 }
예제 #14
0
 void Start()
 {
     surface = GetComponent <NavMeshSurface> ();
     surface.Bake();
     baked = true;
 }