コード例 #1
0
    public static GameRoleDB RandomBattlerOrCrewDB()
    {
        GameRoleDB data = new GameRoleDB();

        data.eyeball        = CCRandom.Range(0, 12);
        data.skincolor      = CCRandom.Range(0, 8);
        data.hairColorIndex = CCRandom.Range(1, 22);
        return(data);
    }
コード例 #2
0
 private GameRoleDB SetRoleDb(GameRoleDB pOldRoleDb, GameRoleDB pNewRoleDb)
 {
     pOldRoleDb.roleID         = pNewRoleDb.roleID;
     pOldRoleDb.name           = pNewRoleDb.name;
     pOldRoleDb.eyeball        = pNewRoleDb.eyeball;
     pOldRoleDb.eyebrow        = pNewRoleDb.eyebrow;
     pOldRoleDb.skincolor      = pNewRoleDb.skincolor;
     pOldRoleDb.facesize       = pNewRoleDb.facesize;
     pOldRoleDb.eyesize        = pNewRoleDb.eyesize;
     pOldRoleDb.nosesie        = pNewRoleDb.nosesie;
     pOldRoleDb.mouthsize      = pNewRoleDb.mouthsize;
     pOldRoleDb.hairColorIndex = pNewRoleDb.hairColorIndex;
     return(pOldRoleDb);
 }
コード例 #3
0
    public static GameRoleDB RandomRoleDB()
    {
        GameRoleDB data = new GameRoleDB();

        data.eyeball        = CCRandom.Range(0, 12);
        data.eyebrow        = CCRandom.Range(0, 12);
        data.skincolor      = CCRandom.Range(0, 8);
        data.facesize       = CCRandom.Range(0, 6);
        data.eyesize        = CCRandom.Range(0, 6);
        data.nosesie        = CCRandom.Range(0, 6);
        data.mouthsize      = CCRandom.Range(0, 6);
        data.hairColorIndex = CCRandom.Range(1, 22);
        return(data);
    }
コード例 #4
0
        public GameRoleDB roleInfos(GameRoleID pGameRoleID)
        {
            GameRoleDB tGameRoleDb = m_RoleStateModel.roleDB.Find(pInfo => pInfo.roleID == pGameRoleID);

//
            if (tGameRoleDb == null)
            {
                tGameRoleDb = new GameRoleDB();
                GameRoleDB tGameRoleBsicDb = m_RoleStateModel.roleBaiscDB.Find(pInfo => pInfo.roleID == pGameRoleID);

                m_RoleStateModel.roleDB.Add(SetRoleDb(tGameRoleDb, tGameRoleBsicDb));

                SaveRoleInfos();
            }
//			Debug.LogError ("name:"+tGameRoleDB.roleID);
//			Debug.LogError (tGameRoleDB.name);
            return(tGameRoleDb);
        }
コード例 #5
0
        public GameRoleDB roleBasicInfos(GameRoleID pGameRoleID, bool pIsCreate = false)
        {
            GameRoleDB tGameRoleDb = m_RoleStateModel.roleBaiscDB.Find(pInfo => pInfo.roleID == pGameRoleID);

            if (pIsCreate)
            {
                GameRoleDB tempRoleDb = m_RoleStateModel.roleDB.Find(pInfo => pInfo.roleID == pGameRoleID);
                if (tempRoleDb != null)
                {
                    m_RoleStateModel.roleDB.Remove(tempRoleDb);
                }
                else
                {
                    tempRoleDb = new GameRoleDB();
                }
                m_RoleStateModel.roleDB.Add(SetRoleDb(tempRoleDb, tGameRoleDb));
            }
            return(tGameRoleDb);
        }