Beispiel #1
0
 private void FindLevelNumber()
 {
     // Load the LevelCounter Object to find the levelnumber that is constant
     LevelCounterConstant = GameObject.FindWithTag("constant");
     LCS         = LevelCounterConstant.GetComponent <LevelCountScript>();
     levelnumber = LCS.levelnumber;
 }
    // Use this for initialization
    void Start()
    {
        // Find canvas, "gameobject" with "picasso"
        canvas = GameObject.FindWithTag("picasso");
        // Restart at the beginning so 0
        position = start;
        newpos   = start;
        // Get the length of the array from the GM
        GM = GameManagerObject.GetComponent <GameManager>();
        // Get the checkvalid function from the CompleteLevel Script
        CompleteLevelController = GameObject.FindWithTag("mutate");
        CLC = CompleteLevelController.GetComponent <CompleteLevel> ();
        // Finding the level number to find the length of the level
        LevelCounterConstant = GameObject.FindWithTag("constant");
        LCS         = LevelCounterConstant.GetComponent <LevelCountScript> ();
        levelnumber = LCS.levelnumber;
        levellength = GM.LController.ldata [levelnumber].leveldesign.Length;
        Debug.Log(levellength + " is the MC levellength");

        // Instantiate the character
        startcharacter(GM.LController.ldata[levelnumber].mainstartindex);


        // To get the checkvalid function
        // valid = CLC.checkvalid (newpos);
    }
Beispiel #3
0
 // Use this for initialization
 void Start()
 {
     LevelCounterConstant = GameObject.FindWithTag("constant");
     // Find canvas, "gameobject" with "picasso"
     canvas      = GameObject.FindWithTag("picasso");
     LCS         = LevelCounterConstant.GetComponent <LevelCountScript> ();
     levelnumber = LCS.levelnumber;
     LoadLevel(levelnumber);
 }
    void loadleveltext()
    {
        GM = GameManager.GetComponent <GameManager>();
        LevelCounterConstant = GameObject.FindWithTag("constant");
        LCS = LevelCounterConstant.GetComponent <LevelCountScript>();
        int    levelnumber = LCS.levelnumber;
        string levelname   = GM.LController.ldata [levelnumber].LevelName;

        Debug.Log(levelnumber + " is the textlevel");
        Debug.Log(levelname + " is the textlevelname");
        leveltext.text = "Level: " + levelnumber + " " + levelname;
    }