Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System.Collections;
- using System.Collections.Generic;
- using UnityEngine;
- /*
- playerIndex to 10, 20 lub 30 w zaleznosci ktorego chcesz ruszyc plejera. Caly slownik co jaki ma numerek jest w GameManager.cs
- Funkcje publiczne (do użytku):
- Wszystkie te funkcje sa dostepne z pozycju gameManager czyli np: gameManager.RotateClockwise(20);
- RotateClockwise(int playerIndex) //obrot w prawo
- RotateCounterClockwise(int playerIndex) //obrot w lewo
- MoveForward(int playerIndex) //idzie prosto
- PlaceBomb(int playerIndex) //kladzie bombe
- CheckHp(int playerIndex) //Zwraca hp danego gracza
- GetMap() //Zwraca cala mape w array intow
- GameFinished() //Zwraca numer gracza ktory wygral jezeli gra sie zakonczyla. Jezeli gra nadal trwa zwraca -1
- GetTurnTime() //Zwraca ile trwa runda
- */
- public class TwojaNazwa : MonoBehaviour {
- GameManager gameManager;
- public int playerIndex = 10;
- //Timers
- float timer = 0.0f;
- float turnTime;
- //Tutaj deklarujesz swoje zmienne
- void Start () {
- gameManager = GameObject.Find("GameManager").GetComponent<GameManager>();
- turnTime = gameManager.GetTurnTime();
- //Tutaj swoim zmiennym mozesz dac wartosc startowa
- }
- void Update () {
- if(timer > turnTime){
- //Tutaj pojedyncza runda sie rozgrywa
- /*
- Mozesz dac tutaj np, czyli dopoki gra sie nie skonczy
- while(gameManager.GameFinished() == -1){
- }
- */
- timer = 0.0f;
- }
- timer += Time.deltaTime;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement