private void InitializeLinesForWall() { prototypeLines = new Line[1]; BeamRendererCollision.Types[] collisionTypes = new BeamRendererCollision.Types[1]; prototypeLines[0] = new Line(squarePoints[0], squarePoints[1]); MakeColliderLinesFromPrototypeLines(collisionTypes); }
private void InitializeLinesForDefaultSquare() { prototypeLines = new Line[4]; BeamRendererCollision.Types[] collisionTypes = new BeamRendererCollision.Types[4]; for (int side = 0; side < 4; side++) { prototypeLines[side] = new Line(squarePoints[side], squarePoints[side + 1]); } MakeColliderLinesFromPrototypeLines(collisionTypes); }
private void InitializeLinesForBucket() { // These lines are a square with an open top. So right, bottom, and left sides only. Vector2[] linePoints = new Vector2[4]; BeamRendererCollision.Types[] collisionTypes = new BeamRendererCollision.Types[3]; linePoints[0] = new Vector2(0.5f, 0.5f); linePoints[1] = new Vector2(0.5f, -0.5f); linePoints[2] = new Vector2(-0.5f, -0.5f); linePoints[3] = new Vector2(-0.5f, 0.5f); MakePrototypeLinesFromContinuousPoints(linePoints); MakeColliderLinesFromPrototypeLines(collisionTypes); }
//private void InitializeLinesForMirror () { // BeamRendererCollision.Types[] collisionTypes = new BeamRendererCollision.Types[3]; // collisionTypes[0] = BeamRendererCollision.Types.Reflect; // collisionTypes[1] = BeamRendererCollision.Types.End; // collisionTypes[2] = BeamRendererCollision.Types.End; // float slashRadius = 0.53f; // float capsRadius = 0.12f; // The little caps on the end of the slash. Looks like a tilted I! Mirrors actually block beams from their ends. Looks better during animations. // float slashAngle = Mathf.PI*0.25f; // Looks like \. // // Make // prototypeLines = new Line[3]; // prototypeLines[0] = new Line(0,slashRadius, 0,-slashRadius).Rotate(slashAngle); // prototypeLines[1] = new Line(-capsRadius, slashRadius, capsRadius, slashRadius).Rotate(slashAngle); // top cap // prototypeLines[2] = new Line(-capsRadius,-slashRadius, capsRadius,-slashRadius).Rotate(slashAngle); // bottom cap // MakeColliderLinesFromPrototypeLines (collisionTypes); //} private void InitializeLinesForBeamGoalOrSource(float indentAmount) { Vector2[] linePoints = new Vector2[9]; BeamRendererCollision.Types[] collisionTypes = new BeamRendererCollision.Types[8]; int i = 0; linePoints[i++] = new Vector2(-0.5f, 0.5f); linePoints[i++] = new Vector2(-0.1f, 0.5f); linePoints[i++] = new Vector2(-0.1f, 0.5f - indentAmount); linePoints[i++] = new Vector2(0.1f, 0.5f - indentAmount); linePoints[i++] = new Vector2(0.1f, 0.5f); linePoints[i++] = new Vector2(0.5f, 0.5f); linePoints[i++] = new Vector2(0.5f, -0.5f); linePoints[i++] = new Vector2(-0.5f, -0.5f); linePoints[i++] = new Vector2(-0.5f, 0.5f); MakePrototypeLinesFromContinuousPoints(linePoints); MakeColliderLinesFromPrototypeLines(collisionTypes); }
public BeamRendererColliderLine(Line line, Line lineOut, BeamRendererCollision.Types collisionType) { this._line = line; this.lineOut = lineOut; this._collisionType = collisionType; }
public BeamRendererColliderLine(BoardObjectView myObjectView, Line line, BeamRendererCollision.Types collisionType) { this._myObjectView = myObjectView; this._line = line; this._collisionType = collisionType; }
public BeamRendererColliderLine(BoardObjectView myObjectView, BeamRendererCollision.Types collisionType) { this._myObjectView = myObjectView; this._line = new Line(); // default to an empty line for now. this._collisionType = collisionType; }
public BeamRendererColliderLine(Line line) { this._myObjectView = null; this._line = line; this._collisionType = BeamRendererCollision.Types.End; }
private void AddBoundsLine(Line line, Line lineOut, BeamRendererCollision.Types collType) { boundsLines.Add(new BeamRendererColliderLine(line, lineOut, collType)); }