Unity3d - Android;我有虫子,我看不出原因

时间:2016-11-30 12:03:25

标签: c# android unity3d

好的,所以我有这个错误,我真的不理解逻辑。 这或者是超级愚蠢的东西,或者是我还不了解的堆叠相关的东西......

这是我的代码:

$scope.removeAddress = function(address) {

    var index = $scope.Profile.addresses.indexOf(address);

    if (index != -1)
      $scope.Profile.addresses.splice(index, 1);
    console.log($scope.Profile.addresses);
};

见:

public void LevelLoad(Level lev)
{
    #if UNITY_ANDROID && !UNITY_EDITOR
    AudioManager.Instance.ReleasePool();
    #endif

    currentlyDisappearedFigures = 0;

    if (!lev.Equals(currentLevel))
    {
        currentLevel = lev;
        currentLevel.transparentQTY = 0; currentLevel.normalQTY = 0; currentLevel.totalQTY = 0;
        currentLevel.hasDeath = false; currentLevel.hasND = false; currentLevel.hasNormal = false; currentLevel.hasTransparent = false;
        foreach (Figure fig in currentLevel.Figures)
        {
            if (fig._figureType != null)
            {
                if (fig._gameObject.CompareTag("Hard"))
                    fig._figureType.ResetHard();
                fig._figureType.RefreshFigure(currentLevel);
                currentLevel.totalQTY++;
            }

        }
    #if UNITY_ANDROID && !UNITY_EDITOR
        if (lev.totalQTY > 22)
            lev.totalQTY = 22;
        AudioManager.Instance.CreatePool(currentLevel.totalQTY);
        Debug.Log("currentLevel.totalQTY-"+currentLevel.totalQTY);

        AudioManager.Instance.LoadAudio(currentLevel.hasNormal, currentLevel.normalQTY,
            currentLevel.hasTransparent, currentLevel.transparentQTY,
            currentLevel.hasND, currentLevel.hasDeath);
        Debug.Log("HasNormal-" + currentLevel.hasNormal + ",normalQTY-" + currentLevel.normalQTY + ",hasTransparent-" +
            currentLevel.hasTransparent + ",transparentlQTY-" + currentLevel.transparentQTY + ",hasND-" +
            currentLevel.hasND + ",hasDeath-" + currentLevel.hasDeath);
    #endif

所有这些都打印为FALSE或ZERO,我不知道为什么。

问题是,我在实例化它们:

Debug.Log("HasNormal-" + currentLevel.hasNormal + ",normalQTY-" + currentLevel.normalQTY + ",hasTransparent-" +
            currentLevel.hasTransparent + ",transparentlQTY-" + currentLevel.transparentQTY + ",hasND-" +
            currentLevel.hasND + ",hasDeath-" + currentLevel.hasDeath);

这是FigureType.RefreshFigure()的内部。 这是无关紧要的,但它里面的Debug.Log显示与我上面提到的不同:

fig._figureType.RefreshFigure(currentLevel);

这两个Debug.logs,在RefreshFigure()内显示True,和。

我不知道Bool变成假的地方和原因,整数变为零?

0 个答案:

没有答案