示例#1
0
    private void doRefreshAvatar()
    {
        int[] lastDispatches = _lastDispatches;
        int[] nowParts       = _nowParts;
        int   value;

        IntIntMap map = null;

        for (int i = nowParts.Length - 1; i >= 0; --i)
        {
            if ((value = nowParts[i]) != lastDispatches[i])
            {
                lastDispatches[i] = value;

                if (map == null)
                {
                    map = new IntIntMap();
                }

                map.put(i, value);
            }
        }

        int modelID;

        //改变了ModelID
        if (_lastDispatchModelID != (modelID = _data.modelID))
        {
            _lastDispatchModelID = modelID;

            _parent.onAvatarChange(modelID);
        }
        else
        {
            if (map == null)
            {
                return;
            }

            _parent.onAvatarPartChange(map);
        }
    }