Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System.Collections;
- using System.Collections.Generic;
- using UnityEngine;
- class SpawnPosition : MonoBehaviour
- {
- public GameObject gamePiece;
- public bool king;
- public bool queen;
- public bool bishop;
- public bool knight;
- public bool rook;
- public bool pawn;
- void Start ()
- {
- SpawnPieces();
- }
- void OnDrawGizmos()
- {
- Gizmos.DrawWireSphere(transform.position, 1);
- }
- void SpawnPieces()
- {
- if (king)
- {
- GameObject KingPiece = GameObject.Instantiate (gamePiece, this.transform.position, gamePiece.transform.rotation) as GameObject;
- }
- if (queen)
- {
- GameObject QueenPiece = GameObject.Instantiate(gamePiece, this.transform.position, gamePiece.transform.rotation) as GameObject;
- }
- if (bishop)
- {
- GameObject BishopPiece = GameObject.Instantiate(gamePiece, this.transform.position, gamePiece.transform.rotation) as GameObject;
- }
- if (knight)
- {
- GameObject KnightPiece = GameObject.Instantiate(gamePiece, this.transform.position, gamePiece.transform.rotation) as GameObject;
- }
- if (rook)
- {
- GameObject RookPiece = GameObject.Instantiate(gamePiece, this.transform.position, gamePiece.transform.rotation) as GameObject;
- }
- if (pawn)
- {
- GameObject PawnPiece = GameObject.Instantiate(gamePiece, this.transform.position, gamePiece.transform.rotation) as GameObject;
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement