Ejemplo n.º 1
0
 //private string username;
 // Use this for initialization
 void Start()
 {
     rb2d     = GetComponent <Rigidbody2D>();
     joystick = FindObjectOfType <bl_Joystick>();
     moveSync = GetComponent <PlayerMoveSync>();
     //username = GetComponentInChildren<TextMesh>().text;
     player = GetComponent <Renderer>();
     if (player.material.color == Color.green)
     {
         isLocalPlayer = true;
     }
 }
Ejemplo n.º 2
0
 private void Start()
 {
     if (GetComponent <PlayerMoveSync>() != null)
     {
         GetComponent <PlayerMoveSync>().OnDiceRolled += MakeMove;
     }
     Debug.Log("start: ");
     GetComponent <PlayerEndMoveAction>().OnEndMoveDone += EndPlayerMove;
     rectTransform     = GetComponent <RectTransform>();
     currentTileNumber = GameObject.Find("InitialTile").GetComponent <TileInfoHolder>();
     moveSync          = GetComponent <PlayerMoveSync>();
     //   DiceMechanism.OnDiceRolled += MakeMove;
 }
Ejemplo n.º 3
0
 private void Awake()
 {
     CheckPlayerCollision.OnPlayersDidntCollide += CheckForTurn;
     CheckPlayerCollision.OnPlayersCollided     += CheckForOtherHit;
     playerDice     = GetComponent <PlayerDiceHolding>();
     playermove     = GetComponent <MoveOneTile>();
     moveSync       = GetComponent <PlayerMoveSync>();
     playerMoveBack = GetComponent <MoveBackwards>();
     MoveBackwards.OnGamestateChanged += CheckAfterMoveBack;
     if (GetComponent <PlayerMoveSync>() != null)
     {
         playerID = GetComponent <PlayerMoveSync>().playerID;
         PlayerMoveSync.OnTalismanDiceRolled += ActivateTalism;
         isMulti = true;
     }
     else
     {
         DiceMechanism.OnTalismanDiceRolled += ActivateTalism;
         CheckForTurn(0);
     }
 }