Esempio n. 1
0
    void Awake()
    {
        if (Instance != null && Instance != this)
        {
            Debug.Log("overseer got destroyeed\n");
            Destroy(gameObject);
        }

        Instance = this;
        Debug.Log(this.gameObject.name + " Overseer waking up\n");
        foreach (GameEvent ge in concurrent_events)
        {
            ge.is_waiting = true;
        }
    }
Esempio n. 2
0
    public bool Load(Level level)
    {
        Init();
        difficulty = Central.Instance.getCurrentDifficultyLevel();
        //     Debug.Log("Loaded level " + level + " with difficulty " + difficulty + "\n");

        monsters_transform = Monsters_Bucket.Instance.gameObject.transform;
        arrows_transform   = GameObject.Find("Arrows").gameObject.transform;
        Moon.Instance.monsters_transform = monsters_transform;



        //     Debug.Log("using FancyLoader to load " + level + "\n");
        if (level.fancy)
        {
            FancyLoader.Instance.LoadLevel(level.name);
        }
        else
        {
            file = new Queue <string>(((TextAsset)Resources.Load("Levels/" + level.name)).text.Split('\n'));
            Debug.Log("Loading file " + level.name + "\n");
            Loader.Instance.setFile(file);
            Loader.Instance.oldLoadLevel();
        }
        //SetDiagonal(Vector3.Distance(WaypointMultiPathfinder.Instance.paths[0].finish.transform.position, WaypointMultiPathfinder.Instance.paths[0].start.transform.position) * 2);
        //the above does nto work for paths that loop back
        SetDiagonal(60f);

        overseer = EventOverseer.Instance;

        level_state = LState.WaveButton;
        Moon.Instance.WaveInProgress = false;
        level_active = true;

        //Debug.Log ("Peripheral FINISHED LOADING at " + Duration.realtimeSinceStartup);
        if (GameStatCollector.Instance != null)
        {
            GameStatCollector.Instance.Init();
        }

        //    on_level_start_trigger.OnSignal();
        return(true);
    }