Advertisement
Guest User

Untitled

a guest
Oct 12th, 2017
63
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.51 KB | None | 0 0
  1. using System.Collections;
  2. using System.Collections.Generic;
  3. using UnityEngine;
  4.  
  5. class SpawnPosition : MonoBehaviour
  6. {
  7.  
  8. public GameObject gamePiece;
  9.  
  10. public bool king;
  11. public bool queen;
  12. public bool bishop;
  13. public bool knight;
  14. public bool rook;
  15. public bool pawn;
  16.  
  17. void Start ()
  18. {
  19. SpawnPieces();
  20. }
  21.  
  22. void OnDrawGizmos()
  23. {
  24. Gizmos.DrawWireSphere(transform.position, 1);
  25. }
  26.  
  27. void SpawnPieces()
  28. {
  29. if (king)
  30. {
  31. GameObject KingPiece = GameObject.Instantiate (gamePiece, this.transform.position, gamePiece.transform.rotation) as GameObject;
  32. }
  33. if (queen)
  34. {
  35. GameObject QueenPiece = GameObject.Instantiate(gamePiece, this.transform.position, gamePiece.transform.rotation) as GameObject;
  36. }
  37. if (bishop)
  38. {
  39. GameObject BishopPiece = GameObject.Instantiate(gamePiece, this.transform.position, gamePiece.transform.rotation) as GameObject;
  40. }
  41. if (knight)
  42. {
  43. GameObject KnightPiece = GameObject.Instantiate(gamePiece, this.transform.position, gamePiece.transform.rotation) as GameObject;
  44. }
  45. if (rook)
  46. {
  47. GameObject RookPiece = GameObject.Instantiate(gamePiece, this.transform.position, gamePiece.transform.rotation) as GameObject;
  48. }
  49. if (pawn)
  50. {
  51. GameObject PawnPiece = GameObject.Instantiate(gamePiece, this.transform.position, gamePiece.transform.rotation) as GameObject;
  52. }
  53. }
  54. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement