应用程序不会加载到下一个场景

时间:2014-08-23 09:38:36

标签: unity3d monodevelop unityscript

对于我的应用程序的第一级,一切似乎都没问题。在能够解决我的游戏逻辑后,它将加载下一级游戏。

但是,由于某种原因,在连续的水平上它不会加载。我的病情可能有问题。但我确信这不是矢量的一部分。

事情是我无法识别它。

我的代码如下:

#pragma strict

// This Script is called when the User Clicks on the Frog.



var FrogName : GameObject;
var frogone : GameObject;
var frogtwo : GameObject;
var frogthree : GameObject;
var frogfour : GameObject;

function Start(){

    FrogName = GameObject.Find(this.name); 

}

function OnMouseDown(){
    var Target = GameObject.Find("Script").GetComponent(FourFrogChangePosition);
    var Target2 = GameObject.Find("Script").GetComponent(FourFrogProperty);
    frogone = GameObject.Find("frog1");
    frogtwo = GameObject.Find("frog2");
    frogthree = GameObject.Find("frog3");
    frogfour = GameObject.Find("frog4");

    if (Target.Firstclick ==null){
        Target.Firstclick =FrogName;
        return;
    }

    if (Target.Firstclick !=null && Target.Secondclick ==null){
        Target.Secondclick =FrogName;
        Target2.Start();
        Target.changePosition();
        if(frogone.transform.position == Vector2(-1.343934f, 1.600096f) && frogtwo.transform.position == Vector2(2.960639f, -0.5253699f) && frogthree.transform.position == Vector2(1.920852f, 1.716066f) && frogfour.transform.position == Vector2(-1.871236f, -0.6542034f) ){
                yield WaitForSeconds (2.5);
                Application.LoadLevel("Pond Level Medium");
        }

        if(frogone.transform.position == Vector2(-1.871236f, -0.6542034f) &&     frogtwo.transform.position == Vector2(2.960639f, -0.5253699f) && frogthree.transform.position == Vector2(1.920852f, 1.716066f) && frogfour.transform.position == Vector2(-1.871236f, -0.6542034f) ){
            yield WaitForSeconds (2.5);
            Application.LoadLevel("Pond Level Medium");
        }
        return;
    }
}

这是没有加载到下一级别的脚本。你能帮我辨别出我在这个剧本中缺少的逻辑吗?

0 个答案:

没有答案