void OnEnable() { controller = (SphereTerrainBrushController)target; }
void Start() { topTerrain = this.sphereTerrains[0]; bottomTerrain = this.sphereTerrains[1]; backTerrain = this.sphereTerrains[2]; rightTerrain = this.sphereTerrains[3]; forwardTerrain = this.sphereTerrains[4]; leftTerrain = this.sphereTerrains[5]; instance = this; drawHeightCameras = transform.parent.GetComponentsInChildren <DrawHeightCamera>(); topCamera = drawHeightCameras[0]; bottomCamera = drawHeightCameras[1]; backCamera = drawHeightCameras[2]; rightCamera = drawHeightCameras[3]; forwardCamera = drawHeightCameras[4]; leftCamera = drawHeightCameras[5]; var U = Vector2.right; var V = Vector2.up; // top topCamera.stitchingUp.neibhborU = U; topCamera.stitchingUp.neibhborV = V; topCamera.stitchingUp.neibhborOriginal = V; topCamera.stitchingDown.neibhborU = U; topCamera.stitchingDown.neibhborV = V; topCamera.stitchingDown.neibhborOriginal = -V; topCamera.stitchingRight.neibhborU = V; topCamera.stitchingRight.neibhborV = -U; topCamera.stitchingRight.neibhborOriginal = 2 * U; topCamera.stitchingLeft.neibhborU = -V; topCamera.stitchingLeft.neibhborV = U; topCamera.stitchingLeft.neibhborOriginal = -U + V; // back backCamera.stitchingUp.neibhborU = U; backCamera.stitchingUp.neibhborV = V; backCamera.stitchingUp.neibhborOriginal = V; backCamera.stitchingDown.neibhborU = U; backCamera.stitchingDown.neibhborV = V; backCamera.stitchingDown.neibhborOriginal = -V; backCamera.stitchingRight.neibhborU = U; backCamera.stitchingRight.neibhborV = V; backCamera.stitchingRight.neibhborOriginal = U; backCamera.stitchingLeft.neibhborU = U; backCamera.stitchingLeft.neibhborV = V; backCamera.stitchingLeft.neibhborOriginal = -U; // right rightCamera.stitchingUp.neibhborU = -V; rightCamera.stitchingUp.neibhborV = U; rightCamera.stitchingUp.neibhborOriginal = 2 * V; rightCamera.stitchingDown.neibhborU = V; rightCamera.stitchingDown.neibhborV = -U; rightCamera.stitchingDown.neibhborOriginal = U - V; rightCamera.stitchingRight.neibhborU = -U;//修正 rightCamera.stitchingRight.neibhborV = -V; rightCamera.stitchingRight.neibhborOriginal = 2 * U + V; rightCamera.stitchingLeft.neibhborU = U; rightCamera.stitchingLeft.neibhborV = V; rightCamera.stitchingLeft.neibhborOriginal = -U; // left leftCamera.stitchingUp.neibhborU = V; leftCamera.stitchingUp.neibhborV = -U; leftCamera.stitchingUp.neibhborOriginal = U + V; leftCamera.stitchingDown.neibhborU = -V; leftCamera.stitchingDown.neibhborV = U; leftCamera.stitchingDown.neibhborOriginal = Vector2.zero; leftCamera.stitchingRight.neibhborU = U; leftCamera.stitchingRight.neibhborV = V; leftCamera.stitchingRight.neibhborOriginal = U; leftCamera.stitchingLeft.neibhborU = -U;// 修正 leftCamera.stitchingLeft.neibhborV = -V; leftCamera.stitchingLeft.neibhborOriginal = V; // bottom bottomCamera.stitchingUp.neibhborU = U; bottomCamera.stitchingUp.neibhborV = V; bottomCamera.stitchingUp.neibhborOriginal = V; bottomCamera.stitchingDown.neibhborU = U; bottomCamera.stitchingDown.neibhborV = V; bottomCamera.stitchingDown.neibhborOriginal = -V; bottomCamera.stitchingRight.neibhborU = -V; bottomCamera.stitchingRight.neibhborV = U; bottomCamera.stitchingRight.neibhborOriginal = U + V; bottomCamera.stitchingLeft.neibhborU = V; bottomCamera.stitchingLeft.neibhborV = -U; bottomCamera.stitchingLeft.neibhborOriginal = Vector2.zero; // forward forwardCamera.stitchingUp.neibhborU = U; forwardCamera.stitchingUp.neibhborV = V; forwardCamera.stitchingUp.neibhborOriginal = V; forwardCamera.stitchingDown.neibhborU = U; forwardCamera.stitchingDown.neibhborV = V; forwardCamera.stitchingDown.neibhborOriginal = -V; forwardCamera.stitchingRight.neibhborU = -U; forwardCamera.stitchingRight.neibhborV = -V; forwardCamera.stitchingRight.neibhborOriginal = 2 * U + V; forwardCamera.stitchingLeft.neibhborU = -U; forwardCamera.stitchingLeft.neibhborV = -V; forwardCamera.stitchingLeft.neibhborOriginal = V; StartCoroutine(doClear()); }