Ejemplo n.º 1
0
Archivo: Room.cs Proyecto: BBJV/camachi
 //    public ChatRoomService chatRoomService;
 //    
 //    void Awake() {
 //        chatRoomService = GameObject.FindObjectOfType(typeof(ChatRoomService)) as ChatRoomService;
 //    }
 //    
 public bool IsCreator(GameUserPlayer p)
 {
     if(this.creator == p) {
         return true;
     }else {
         return false;
     }
 }
Ejemplo n.º 2
0
Archivo: Room.cs Proyecto: BBJV/camachi
 public bool IsPlayerInRoom(GameUserPlayer p)
 {
     foreach (GameUserPlayer player in playersInRoom) {
         if(p == player) {
             return true;
         }
     }
     return false;
 }
Ejemplo n.º 3
0
    void Awake()
    {
        PlayGameController.OnShowRecord += OnShowRecord;
        PlayGameController.OnShowGainGold += OnShowGainGold;

        GameObject pgo = GameObject.Find("PlayerInfo");
        player = pgo.GetComponent<GameUserPlayer>();

        animationStar.enabled = false;
    }
Ejemplo n.º 4
0
    public bool PlayerLeave(GameUserPlayer u)
    {
        if(room.PlayerLeave(u)){
            if(u.isAI) {
                onlyAICount--;
            }else{
                onlyPlayerCount--;
            }

            return true;
        } else {
            return false;
        }
    }
Ejemplo n.º 5
0
    public bool PlayerJoin(GameUserPlayer u)
    {
        if((onlyAICount + onlyPlayerCount) < room.maxPlayerNumber) {
            if(room.PlayerJoin(u)) {
                if(u.isAI) {
                    onlyAICount++;
                }else{
                    onlyPlayerCount++;
                }

                return true;
            }else{
                return false;
            }
        }else {
            return false;
        }
    }
Ejemplo n.º 6
0
Archivo: Room.cs Proyecto: BBJV/camachi
 public bool PlayerLeave(GameUserPlayer u)
 {
     if(playersInRoom.Contains(u)){
         playersInRoom.Remove(u);
         return true;
     } else {
         return false;
     }
 }
Ejemplo n.º 7
0
Archivo: Room.cs Proyecto: BBJV/camachi
    public bool PlayerJoin(GameUserPlayer u)
    {
        if(playersInRoom.Count < maxPlayerNumber) {
            if(!playersInRoom.Contains(u)){
                playersInRoom.Add(u);
                return true;
            } else {
                return false;
            }

        }else {
            return false;
        }
    }
Ejemplo n.º 8
0
    public MatchRoom CreateMatchRoom(int roomIndex, string roomName, int maxPlayerNumber, int matchMap, string matchType, GameUserPlayer creator)
    {
        matchRoom = GameObject.Instantiate(matchRoomPrefab, Vector3.zero, Quaternion.identity) as MatchRoom;
        matchRoom.matchMap = matchMap;
        matchRoom.matchType = matchType;
        matchRoom.GetComponent<Room>().roomIndex = roomIndex;
        matchRoom.GetComponent<Room>().roomName = roomName;
        matchRoom.GetComponent<Room>().maxPlayerNumber = maxPlayerNumber;
        matchRoom.GetComponent<Room>().creator = creator;

        matchRoom.name = matchRoom.GetComponent<Room>().roomIndex.ToString();
        matchRoom.transform.parent = gameObject.transform;

        return matchRoom;
    }
Ejemplo n.º 9
0
 void OnPlayerLoaded(GameUserPlayer player)
 {
     //		Debug.Log ("OnPlayerLoaded:"+player.money.ToString());
     goldsLabel.text = player.money.ToString();
 }