public GameObject ChoicePrefab(Enum_Role role, int skinNum)
    {
        switch (role)
        {
        case Enum_Role.ChangE:
            return(Resources.Load <GameObject> ("Prefeb_Role/Heros/ChangE" + "_0" + skinNum));

        case Enum_Role.YangJian:
            return(Resources.Load <GameObject>("Prefeb_Role/Heros/YangJian" + "_0" + skinNum));

        case Enum_Role.JianMo:
            return(Resources.Load <GameObject> ("Prefeb_Role/Heros/JianMo" + "_0" + skinNum));

        case Enum_Role.WuNiang:
            return(Resources.Load <GameObject> ("Prefeb_Role/Heros/WuNiang" + "_0" + skinNum));

        case Enum_Role.XiaoYaoZi:
            return(Resources.Load <GameObject> ("Prefeb_Role/Heros/XiaoYaoZi" + "_0" + skinNum));

        case Enum_Role.Ahri:
            return(Resources.Load <GameObject> ("Prefeb_Role/Heros/Ahri" + "_0" + skinNum));

        default:
            return(Resources.Load <GameObject> ("Prefeb_Role/Heros/Ahri" + "_0" + skinNum));
        }
    }
    public Data_Rloe ChoiceDataRole(Enum_Role role)
    {
        string path = Application.dataPath + "/InitializeInfo/HeroData/";

        switch (role)
        {
        case Enum_Role.ChangE:
            path += "ChangE.text";
            Data_Rloe roleData = JsonUti.JsonstreamToObject <Data_Rloe> (path);
            return(roleData);

        case Enum_Role.YangJian:
            path += "YangJian.text";
            return(JsonUti.JsonstreamToObject <Data_Rloe> (path));

        case Enum_Role.JianMo:
            path += "JianMo.text";
            return(JsonUti.JsonstreamToObject <Data_Rloe> (path));

        case Enum_Role.WuNiang:
            path += "WuNiang.text";
            return(JsonUti.JsonstreamToObject <Data_Rloe> (path));

        case Enum_Role.XiaoYaoZi:
            path += "XiaoYaoZi.text";
            return(JsonUti.JsonstreamToObject <Data_Rloe> (path));

        case Enum_Role.Ahri:
            path += "Ahri.text";
            return(JsonUti.JsonstreamToObject <Data_Rloe> (path));

        default:
            return(JsonUti.JsonstreamToObject <Data_Rloe> (path));
        }
    }
Exemplo n.º 3
0
        /// <summary>
        /// 根据省市县查询客户总数
        /// </summary>
        /// <param name="role"></param>
        /// <param name="provinceId"></param>
        /// <param name="cityId"></param>
        /// <param name="countyId"></param>
        /// <returns></returns>
        public static int GetCustomerListByCountyCount(Enum_Role role, int provinceId, int cityId, int countyId)
        {
            string sql = "select  count(*)  from customer  where  role=?role";

            //管理
            if (role == Enum_Role.Administrator)
            {
                sql += "  limit 1 ";
            }
            //发货单位
            if (role == Enum_Role.Sender)
            {
                if (provinceId != 0 && cityId != 0 && countyId != 0)
                {
                    sql += "  and provinceId=?provinceId and cityId=?cityId and countyId=?countyId ";
                }
            }
            //收货单位
            if (role == Enum_Role.Receiver)
            {
                if (provinceId != 0 && cityId != 0 && countyId != 0)
                {
                    sql += "  and provinceId=?provinceId and cityId=?cityId and countyId=?countyId ";
                }
            }

            sql += " ;";
            MySqlParameter[] para = new MySqlParameter[4];
            para[0] = new MySqlParameter("role", role);
            para[1] = new MySqlParameter("provinceId", provinceId);
            para[2] = new MySqlParameter("cityId", cityId);
            para[3] = new MySqlParameter("countyId", countyId);
            return(Convert.ToInt32(_SqlHelp.ExecuteScalar(sql, para)));
        }
    public void IntializeRoleType(string pathTemp)
    {
//		Debug.Log ("IntializeRoleType_Path:" + pathTemp);
        HeroChooseInfoS chioce = JsonUti.JsonstreamToObject <HeroChooseInfoS> (pathTemp);

//		Debug.Log ("IntializeRoleType_Chioce:" + chioce);
        kindOfPlayer = chioce.hero [0].hero;
        kindOfAI     = chioce.hero [3].hero;
    }
Exemplo n.º 5
0
        /// <summary>
        /// 查询客户信息总数
        /// </summary>
        /// <param name="role">客户角色</param>
        /// <param name="provinceId">可选参数[所在省份 region Id,为0时默认查询所有省份]</param>
        /// <param name="cityId">可选参数[所在省份 region Id,为0时默认查询所有城市]</param>
        /// <returns></returns>
        public ResultModel <int> GetCustomerListByRoleCount(Enum_Role role, int provinceId = 0, int cityId = 0)
        {
            ResultModel <int> result = new ResultModel <int>();

            try
            {
                result.Data = CustomerServer.GetCustomerListByRoleCount(role, provinceId, cityId);
            }
            catch (Exception ex)
            {
                result.Code    = 1;
                result.Message = ex.Message;
            }
            return(result);
        }
Exemplo n.º 6
0
        /// <summary>
        /// 根据客户角色获取客户列表
        /// </summary>
        /// <param name="role">客户角色</param>
        /// <param name="provinceId">可选参数[所在省份 region Id,为0时默认查询所有省份]</param>
        /// <param name="cityId">可选参数[所在省份 region Id,为0时默认查询所有城市]</param>
        /// <param name="pageIndexAndCount">可选参数[分页参数,无需分页则不填,格式为"页索引.每页数量".例如:1.50,表示每页显示50条,当前查询第1页]</param>
        /// <returns></returns>
        public ResultModel <List <Model_Customer> > GetCustomerListByRole(Enum_Role role, int provinceId = 0, int cityId = 0, string pageIndexAndCount = null)
        {
            ResultModel <List <Model_Customer> > result = new ResultModel <List <Model_Customer> >();

            try
            {
                result.Data = CustomerServer.GetCustomerListByRoles(role, provinceId, cityId, pageIndexAndCount);
            }
            catch (Exception ex)
            {
                result.Code    = 1;
                result.Message = ex.Message;
            }
            return(result);
        }
Exemplo n.º 7
0
        /// <summary>
        /// 根据省市县查询客户信息
        /// </summary>
        /// <param name="role"></param>
        /// <param name="provinceId"></param>
        /// <param name="cityId"></param>
        /// <param name="county"></param>
        /// <param name="pageIndexAndCount"></param>
        /// <returns></returns>
        public static List <Model_Customer> GetCustomerListByCounty(Enum_Role role, int provinceId, int cityId, int countyId, string pageIndexAndCount)
        {
            string sql = "select  id,fullName,contactperson,contactTel,contactAddress," +
                         "provinceId,provinceName,cityId,cityName,countyId,countyName,account," +
                         "role,actived,createAt,concat_ws('|',if(isnull(remark),'',remark),if(isnull(BindReceiverOrg),'',BindReceiverOrg)) remark from customer  where  role=?role";

            //管理
            if (role == Enum_Role.Administrator)
            {
                sql += "  limit 1 ";
            }
            //发货单位
            if (role == Enum_Role.Sender)
            {
                if (provinceId != 0 && cityId != 0 && countyId != 0)
                {
                    sql += "  and provinceId=?provinceId and cityId=?cityId and countyId=?countyId ";
                }
            }
            //收货单位
            if (role == Enum_Role.Receiver)
            {
                if (provinceId != 0 && cityId != 0 && countyId != 0)
                {
                    sql += "  and provinceId=?provinceId and cityId=?cityId and countyId=?countyId ";
                }
            }
            if (pageIndexAndCount != null)
            {
                //截取当前页数
                string page = pageIndexAndCount.Substring(0, pageIndexAndCount.LastIndexOf("."));
                //截取每页显示记录数
                string size = pageIndexAndCount.Substring(pageIndexAndCount.LastIndexOf(".") + 1, pageIndexAndCount.Length - (pageIndexAndCount.LastIndexOf(".") + 1));
                sql += "  order by  createAt desc limit " + ((Convert.ToInt32(page) - 1) * Convert.ToInt32(size)) + "," + size + ";";
            }
            else
            {
                sql += " ;";
            }
            MySqlParameter[] para = new MySqlParameter[4];
            para[0] = new MySqlParameter("role", role);
            para[1] = new MySqlParameter("provinceId", provinceId);
            para[2] = new MySqlParameter("cityId", cityId);
            para[3] = new MySqlParameter("countyId", countyId);
            List <Model_Customer> list = _SqlHelp.ExecuteObjects <Model_Customer>(sql, para);

            return(list);
        }
    public void IntializeDataRole(GameObject role, Enum_Role enumRole)
    {
        Data_Rloe data       = ChoiceDataRole(enumRole);
        Role_Main playerData = role.GetComponent <Role_Main> ();

        playerData.skinNum         = data.skinNum;
        playerData.type_Allrole    = data.RorS;
        playerData.HpMax           = data.HpMax;
        playerData.MpMax           = data.MpMax;
        playerData.DefensePhysical = data.DefensePhysical;
        playerData.DefenseMagic    = data.DefenseMagic;
        playerData.attack_Physical = data.attack_Physical;
        playerData.attack_Magic    = data.attack_Magic;
        playerData.moveSpeed       = data.moveSpeed;
        playerData.attack_Radius   = data.attack_Radius;
        playerData.attack_Speed    = data.attack_Speed;
        playerData.Level           = data.Level;
        playerData.Level_exp       = data.Levl_exp;
        if (role.GetComponent <RoleInfo>().type_Range == Type_Range.Long)                                //初始化子弹层
        {
            role.transform.FindChild("weapon/WEAPON_1").gameObject.layer = LayerMask.NameToLayer("Bullet");
        }
    }
Exemplo n.º 9
0
        /// <summary>
        /// 查询全部客户
        /// </summary>
        /// <param name="customerId">当customerId=0时查询全部客户</param>
        /// <returns></returns>
        public static List <Model_Customer> CustomerQuery(Enum_Role role, int customerId)
        {
            string sql = "select * from customer ";

            if (customerId == 0)
            {
                if (role == Enum_Role.Sender)
                {
                    sql += " where role=2;";
                }
                if (role == Enum_Role.Receiver)
                {
                    sql += " where role=3;";
                }
            }
            //if (customerId > 0)
            //    sql = "select * from customer where  id=?id ";

            //MySqlParameter[] para = new MySqlParameter[1];
            //para[0] = new MySqlParameter("id", customerId);
            List <Model_Customer> customer = _SqlHelp.ExecuteObjects <Model_Customer>(sql);

            return(customer);
        }