示例#1
0
        public void ApplyTerrainTypeSettings(TerrainTypeSettings typeSettings)
        {
            TerrainTypeSettings.TypeSettings theSettings = typeSettings.GetSettings(type);

            Renderer nodeRenderer = GetComponent <Renderer> ();

            nodeRenderer.material = theSettings.material;

            moveCost = theSettings.moveCost;

            EditorUtility.SetDirty(this);
        }
        public void ModifyTerrain(TerrainTypeSettings typeSettings)
        {
            RaycastHit[] hits = Physics.CapsuleCastAll(pointOne.position, pointTwo.position, castRadius, castDir, castDist);
            for (int i = 0; i < hits.Length; i++)
            {
                TerrainNode node = hits[i].collider.GetComponent <TerrainNode> ();
                if (node == null)
                {
                    continue;
                }

                node.type = type;
                node.ApplyTerrainTypeSettings(typeSettings);
            }
        }