Exemple #1
0
    public ReboundAttr GetReboundAttr(PositionType position)
    {
        ReboundAttr attr = null;

        reboundAttrs.TryGetValue(position, out attr);
        return(attr);
    }
Exemple #2
0
    public void ReadConfig()
    {
        if (isLoadFinish == false)
        {
            return;
        }
        isLoadFinish = false;
        lock (LockObject){ GameSystem.Instance.readConfigCnt += 1; }

        Debug.Log("Config reading " + name);
        string text = ResourceLoadManager.Instance.GetConfigText(name);

        if (text == null)
        {
            Debug.LogError("LoadConfig failed: " + name);
            return;
        }
        reboundAttrs.Clear();

        XmlDocument xmlDoc   = CommonFunction.LoadXmlConfig(GlobalConst.DIR_XML_REBOUNDRANGE, text);
        XmlNodeList nodelist = xmlDoc.SelectSingleNode("Data").ChildNodes;

        foreach (XmlElement xe in nodelist)
        {
            if (CommonFunction.IsCommented(xe))
            {
                continue;
            }

            PositionType position = (PositionType)(int.Parse(xe.SelectSingleNode("position").InnerText));
            ReboundAttr  data     = new ReboundAttr();
            data.minHeight          = IM.Number.Parse(xe.SelectSingleNode("height_min").InnerText);
            data.maxHeight          = IM.Number.Parse(xe.SelectSingleNode("height_max").InnerText);
            data.reboundHeightScale = IM.Number.Parse(xe.SelectSingleNode("rebound_height_scale").InnerText);
            data.ballHeightScale    = IM.Number.Parse(xe.SelectSingleNode("ball_height_scale").InnerText);
            reboundAttrs.Add(position, data);
        }
    }