Inheritance: MonoBehaviour
Exemple #1
0
    public static LevelLoader Get()
    {
        if (m_Instance == null)
            m_Instance = (LevelLoader)FindObjectOfType(typeof(LevelLoader));

        return m_Instance;
    }
Exemple #2
0
	// Use this for initialization
	void Start () {
		if(instance != null)
			Destroy(instance);

		instance = this;
		DontDestroyOnLoad (this);
	}
	void Awake()
	{
		levelLoader = GameObject.FindObjectOfType<LevelLoader>();
		soundManager = GameObject.FindObjectOfType<SoundManager>();
		soundManager.ChangeMusic( menuMusic );

		MessageCenter.Instance.Broadcast( new PauseChangedMessage( false ) );
		Time.timeScale = 1;

		axisBusy = false;

		if( mainButtons.Length <= 0 )
			throw new UnassignedReferenceException( "No button was given to the menu" );

		GoToMainMenu();

		totalZoomTime = 25.0f;

		Screen.showCursor = false;
		Screen.lockCursor = true;

		camera = GameObject.Find( "Main Camera" );

		descriptionBox = GameObject.Find( "DescriptionBox" );
	}
    void Awake()
    {
        //Don't want to destroy this
        DontDestroyOnLoad (this);

        //Set singleton
        main = this;

        //Generate Black background Texture
        m_LoadingScreen = TextureGenerator.MakeTexture (Color.black);

        //Assign Screen Rect
        m_ScreenRect = new Rect(0, 0, Screen.width, Screen.height);

        //Set up GUIStyle
        m_LoadingStyle = new GUIStyle();
        m_LoadingStyle.normal.textColor = Color.white;
        m_LoadingStyle.alignment = TextAnchor.MiddleCenter;
        m_LoadingStyle.fontSize = 20;

        //Calculate the label Rect
        Vector2 labelSize = m_LoadingStyle.CalcSize (new GUIContent(m_LoadingMessage));
        float labelWidth = labelSize.x;
        float labelHeight = labelSize.y;

        float xPos = (Screen.width/2) - (labelWidth/2);
        float yPos = (Screen.height/2) - (labelHeight/2);

        m_LabelRect = new Rect(xPos, yPos, labelWidth, labelHeight);
    }
	private void loaded2(LevelLoader obj){
		//obj.DontDelete = true;
		TreeRoot = obj.rootObject.GetComponent<BehaviourNode> ();
		TreeRoot.Tree = this;
		TreeRoot.ReCaptureChildsAndParents ();
		TreeVis.getTreeVis ().TreeRoot = TreeRoot;
		TreeVis.getTreeVis ().LoadTree ();
	}
 public void LoadedObjectTreeCallback(LevelLoader ll)
 {
     GameObject newRoot = ll.rootObject;
     this.DestroyMetadata(newRoot);
     if (this.refreshRoot != null) {
     this.refreshRoot(newRoot);
     }
 }
	void Awake()
	{
		Current = this;
		if(pixel==null)
		{
			pixel = new Texture2D(1,1);
		}
	}
Exemple #8
0
	void Start() {
		DontDestroyOnLoad (gameObject);
		if (Instance == null) {
			Instance = this;
			LevelLoaderStart ();
		} else {
			Destroy (gameObject);
		}
	}
	void Awake()
	{
		_timeScale = Time.timeScale;
		Current = this;
		if(pixel==null)
		{
			pixel = new Texture2D(1,1);
		}
	}
Exemple #10
0
 private void Awake()
 {
     timeScaleAfterLoading = Time.timeScale;
     Current = this;
     if (_pixel == null)
     {
         _pixel = new Texture2D(1, 1);
     }
 }
	void Start()
	{
		soundManager = GameObject.FindObjectOfType<SoundManager>();
		soundManager.GetComponents<AudioSource>()[ 0 ].Stop();
		soundManager.GetComponents<AudioSource>()[ 0 ].clip = null;

		levelLoader = GameObject.FindObjectOfType<LevelLoader>();
		Application.LoadLevel( levelLoader.levelName );
	}
Exemple #12
0
	void Awake()
	{
      
        if (instance==null)
			instance=this;
		else if (instance!=this)
			Destroy(gameObject);
		//Eternity!!!!
		DontDestroyOnLoad(gameObject);		
	}
Exemple #13
0
 public static LevelLoader GetInstance()
 {
     if (_instance == null)
     {
         GameObject gO = GameObject.Find("LevelLoader");
         if (gO == null) gO = new GameObject("LevelLoader");
         _instance = gO.AddComponent<LevelLoader>();
     }
     return _instance;
 }
 // Use this for initialization
 void Start()
 {
     loader = GameObject.Find ("Utilities").GetComponent<LevelLoader> ();
     //get our score from playerprefs
     level = PlayerPrefs.GetString ("Level");
     score = PlayerPrefs.GetInt("Score");
     win = PlayerPrefs.GetInt("Win");
     Screen.showCursor = true;
     Screen.lockCursor = false;
 }
	private void loaded(LevelLoader obj){
		//obj.DontDelete = true;
		/*foreach(EmptyObjectIdentifier eoi in obj.rootObject.GetAllComponentsInChildren<EmptyObjectIdentifier>()){
			GameObject.Destroy(eoi);
		}*/
		GameObject go = (GameObject)GameObject.Instantiate (obj.rootObject);
		//obj.rootObject.SetActive (false);
		TreeRoot = go.GetComponent<BehaviourNode> ();
		TreeRoot.Tree = this;
		TreeRoot.ReCaptureChildsAndParents ();
	}
Exemple #16
0
	private void Awake()
	{
		if(Instance == null)
		{
			if(Application.isEditor && string.IsNullOrEmpty (PendingScene))
				PendingScene = MENU;
			Instance = this;
			DontDestroyOnLoad(this.gameObject);
		}
		else
			Destroy(this.gameObject);
	}
Exemple #17
0
	void Awake()
	{
		if( _instance == null )
		{
			_instance = this;
			DontDestroyOnLoad( this );
		}
		else
		{
			if( this != _instance )
				Destroy( this.gameObject );
		}
	}
Exemple #18
0
    void Awake()
    {
        leftSoundObstacle = Instantiate(soundObstacleprefab, new Vector3(playerGameObject.transform.position.x - soundObstacleDispX, playerGameObject.transform.position.y, playerGameObject.transform.position.z + 100.0f), Quaternion.identity) as GameObject;
        rightSoundObstacle = Instantiate(soundObstacleprefab) as GameObject;
        rumbleObstacle = Instantiate(rumbleObstaclePrefab) as GameObject;
        visualObstacle = Instantiate(obstaclePrefab) as GameObject;

        rightSoundObstacle.SetActive(false);
        rumbleObstacle.SetActive(false);
        visualObstacle.SetActive(false);

        levelLoader = gameObject.AddComponent<LevelLoader>();
    }
    public override void StateStart()
    {
        //Debug.Log (this.ToString () + " Start!");

        ///イベント登録
        // スタミナゲージが0になった時のイベント
        StaminaGauge.Instance.GaugeZeroEvent += EndGame;

        SoundManager.Instance.PlayBGM ("Play");

        this.levelLoader = GameObject.FindGameObjectWithTag ("LevelLoader").GetComponent<LevelLoader>();

        NextTime = CoolTime + Time.time;
    }
Exemple #20
0
    /// <summary>
    /// Awake this instance. For main initialation.
    /// </summary>
    private void Awake()
    {
        // Check if instance is set
        if(instance)
        {
            // destroy duplicate
            DestroyImmediate (gameObject);
            return;
        }

        // Mark instance and flag not to be destroyed.
        instance = this;
        DontDestroyOnLoad (gameObject);
    }
	void Start ()
    {
        levelLoader = FindObjectOfType<LevelLoader>();
        clockText = GameObject.Find("Clock").GetComponent<Text>();
        player = GameObject.FindGameObjectWithTag("Player");
        failedPanel = GameObject.Find("FailedPanel");
        winPanel = GameObject.Find("WinPanel");

        CollectRitualsAndRitualNames();
        DeactivatePanels();

        counter = lengthOfLevel;
        GameState.instance.LevelState.ResetExecutedRituals();
        SeedRitualOrder();
    }
Exemple #22
0
	void Start()
	{
		isPaused = false;
		axisBusy = false;

		// Get the canvas and buttons ready
		pauseCanvas = GameObject.Find( "OutroCanvas" ).GetComponent<Canvas>();
		pauseCanvas.enabled = false;

        //outroMessage = new Text();

		RegisterListeners();

		levelLoader = GameObject.FindObjectOfType<LevelLoader>();
	}
	void Start()
	{
		levelLoader = GameObject.FindObjectOfType<LevelLoader>();
		scoreScript = GameObject.FindObjectOfType<ScoreScript>();

		if( levelLoader.modeName == "Survival" )
			gameMode = GameMode.Survival;
		if( levelLoader.modeName == "Marked" )
			gameMode = GameMode.Marked;
		else if( levelLoader.modeName == "Feast" )
			gameMode = GameMode.Feast;
		else if( levelLoader.modeName == "Timed" )
			gameMode = GameMode.Timed;

		RegisterListeners();
	}
    public override void StateStart()
    {
        this.gameLevelInfo = new GameLevelInfo ();
        this.levelLoader = GameObject.FindGameObjectWithTag ("LevelLoader").GetComponent<LevelLoader> ();

        GameModel.isFreeze = true;

        this.StartEffect = this.ResourceManagerInstance.InstantiateResourceWithName ("StartEffect");
        Transform Scale = this.StartEffect.transform;

        GameObject canvas = GameObject.Find ("GUICanvas");
        this.StartEffect.transform.SetParent (canvas.transform, false);

        gameLevelInfo = this.levelLoader.ReadLine ();
        LevelWeather ();
        LevelItem ();
    }
    void Awake()
    {
        if (current != null) {
            Destroy(gameObject);
            return;
        }

        current = this;
        player = GameObject.FindWithTag("Player");

        // Create a shared area
        shared = new GameObject().transform;
        shared.name = "_Shared";
        player.transform.SetParent(shared);

        // Setup ignored elements
        ignore[transform] = true;
        ignore[player.transform] = true;
        ignore[shared] = true;

        UpdateCatalogue(Application.loadedLevelName);
    }
Exemple #26
0
    public void Awake()
    {
        body = GetComponent<Rigidbody2D>();
        if (body == null) throw new MissingComponentException("Expected attached Rigidbody2D");

        collider = GetComponent<Collider2D>();
        if (collider == null) throw new MissingComponentException("Expected attached Collider2D");

        audio = GetComponent<AudioSource>();
        if (audio == null) throw new MissingComponentException("Expected attached AudioSource");

        renderer = GetComponent<SpriteRenderer>();
        if (renderer == null) throw new MissingComponentException("Expected attached SpriteRenderer");

        paddle = GameObject.FindGameObjectWithTag("Player").GetComponent<Paddle>();
        if (paddle == null) throw new MissingReferenceException("Expected Paddle tagged with 'Player' in scene.");

        levelLoader = GameObject.FindObjectOfType<LevelLoader>();
        if (levelLoader == null) throw new MissingReferenceException("Expected object of type LevelLoader in scene.");

        Invoke("Reset", 0.5f);  //give the paddle a sec to get a position
    }
    public void LoadedObjectTreeCallback(LevelLoader ll)
    {
        //remove all the uniqueidentifiers and Storematerials that are in the saved objects.
        GameObject newRoot = ll.rootObject;
        UniqueIdentifier[] uis = newRoot.GetAllComponentsInChildren<UniqueIdentifier>();
        foreach (UniqueIdentifier ui in uis) {
            GameObject.DestroyImmediate(ui);
        }

        StoreMaterials[] sms = newRoot.GetAllComponentsInChildren<StoreMaterials>();
        foreach (StoreMaterials sm in sms) {
            GameObject.DestroyImmediate (sm);
        }
        GameObject.DestroyImmediate(ll.gameObject);

        //also destroy the save game manager
        GameObject sgm = GameObject.Find("Save Game Manager");
        if (sgm != null) {
            if (sgm.GetComponent<SaveGameManager>() != null) {
                GameObject.DestroyImmediate(sgm);
            }
        }
    }
Exemple #28
0
 public void StartGame()
 {
     LevelLoader.LoadNextScene();
 }
Exemple #29
0
    public void LoadLevel(String levelObjPath)
    {
        rawVertexes        = new List <LvlVert>();
        compressedVertexes = new List <LvlVert>();
        edges     = new List <LvlEdge>();
        startVert = null;
        endVerts  = new List <LvlVert>();

        String[] objText = System.IO.File.ReadAllLines(levelObjPath);

        String startFace = "";
        String endFace1  = "";
        String endFace2  = "";
        String endFace3  = "";
        String endFace4  = "";

        for (int i = 0; i < objText.Length; i++)
        {
            //Print everything except comments

            /*
             * if (!line.BeginsWith("#")) {
             *  GD.Print(line);
             * }
             */

            if (objText[i].BeginsWith("v"))
            {
                rawVertexes.Add(readVertex(objText[i]));
            }

            if (objText[i].BeginsWith("l"))
            {
                edges.Add(readEdge(objText[i]));
            }

            //Find the start point
            if (objText[i].BeginsWith("g Start"))
            {
                startFace = objText[i + 1];
            }

            //Find the start point
            if (objText[i].BeginsWith("g End1"))
            {
                endFace1 = objText[i + 1];
            }

            //Find the start point
            if (objText[i].BeginsWith("g End2"))
            {
                endFace2 = objText[i + 1];
            }

            //Find the start point
            if (objText[i].BeginsWith("g End3"))
            {
                endFace3 = objText[i + 1];
            }

            //Find the start point
            if (objText[i].BeginsWith("g End4"))
            {
                endFace4 = objText[i + 1];
            }
        }

        //Calculate the start vert
        startVert = getVertByFaceNum(startFace);

        endVerts = new List <LvlVert>();

        if (!string.IsNullOrEmpty(endFace1))
        {
            endVerts.Add(getVertByFaceNum(endFace1));
        }

        if (!string.IsNullOrEmpty(endFace2))
        {
            endVerts.Add(getVertByFaceNum(endFace2));
        }

        if (!string.IsNullOrEmpty(endFace3))
        {
            endVerts.Add(getVertByFaceNum(endFace3));
        }

        if (!string.IsNullOrEmpty(endFace4))
        {
            endVerts.Add(getVertByFaceNum(endFace4));
        }

        if (debugPrint)
        {
            GD.Print("Start vert = " + startVert.Id.ToString());

            GD.Print("End verts = ");
            foreach (var vert in endVerts)
            {
                GD.Print(vert.Id.ToString());
            }

            GD.Print("End verts = ");
            foreach (var vert in endVerts)
            {
                GD.Print(vert.Id.ToString());
            }
        }

        compressVerts();

        if (debugPrint)
        {
            GD.Print("Compressed verts count = " + compressedVertexes.Count);
            GD.Print("Verts:");
            foreach (var vert in compressedVertexes)
            {
                GD.Print(vert.Id.ToString() + " - " + vert.Vertex.ToString());
            }

            //compressEdges();
            GD.Print("Edge count = " + edges.Count);
            GD.Print("Edges:");
            foreach (var edge in edges)
            {
                GD.Print(edge.Vert1.Id.ToString() + " - " + edge.Vert2.Id.ToString());
            }
        }
        //level = new Level(compressedVertexes, edges, startVert, endVerts);

        String mesh = levelObjPath.Replace("Edges", "");

        LevelLoader levelLoader = (LevelLoader)GetNode("LevelLoader");

        levelLoader.ResetLevel();
        if (!levelLoader.IsSetup)
        {
            levelLoader.Setup(compressedVertexes, edges, startVert, endVerts, mesh);
        }
    }
    // Use this for initialization
    void Start()
    {
        speed = 4;

        initialPos = transform.position;

        playerObj = GameObject.Find("player").transform;

        bossGeneral = GetComponent<EnemyGeneralBehaviour> ();
        attackControl = GetComponent<patternList> ();
        getPlayer = playerObj.GetComponent<PlayerController> ();
        GetComponent<bossHealthbar> ().setBossHp ();
        secretbossController = this.GetComponent<Animator> ();

        getLevel = GameObject.Find("LevelLoader").GetComponent<LevelLoader> ();

        bossState = state.state_idle;

        foreach (Transform child in transform) {
            switch (child.name) {
            case "minionParent" :
                minionParent = child.gameObject;
                break;
            case "iceChunkParent" :
                iceChunkParent = child.gameObject;
                break;
            case "lsdTurretParent" :
                lsdTurretParent = child.gameObject;
                break;
            case "ecsCloneParent" :
                ecsCloneParent = child.gameObject;
                break;
            case "iceAnim" :
                iceAnim = child.gameObject;
                break;
            case "aoeAnim" :
                homingAnim = child.gameObject;
                break;
            case "defaultAnim" :
                defaultAnim = child.gameObject;
                break;
            }
        }
    }
 private void Start()
 {
     levelLoader = FindObjectOfType <LevelLoader>();
 }
        private void LevelLoader_LoadingThread(On.Celeste.LevelLoader.orig_LoadingThread orig, LevelLoader self)
        {
            orig.Invoke(self);
            Session session = self.Level.Session;
            Vector2?spawn   = Manager.controller.resetSpawn;

            if (spawn != null)
            {
                session.RespawnPoint          = spawn;
                session.Level                 = session.MapData.GetAt((Vector2)spawn)?.Name;
                session.FirstLevel            = false;
                Manager.controller.resetSpawn = null;
            }
        }
 private void ResetGameSession()
 {
     Destroy(gameObject);
     LevelLoader.LoadMainMenu();
 }
Exemple #34
0
 private void Awake()
 {
     levelLoader = FindObjectOfType <LevelLoader>();
     startBTN.onClick.AddListener(StartGame);
     quitBTN.onClick.AddListener(QuitGame);
 }
        // this one is for breaking in a level directly (typically due to a console load command)
        // this is a fallback, and since we don't go through the level enter routine, we can't show the postcard.
        private void checkForceEnableVariantsOnLevelLoad(On.Celeste.LevelLoader.orig_ctor orig, LevelLoader self, Session session, Vector2?startPosition)
        {
            if (triggerIsHooked && Engine.Scene is Level)
            {
                Logger.Log(LogLevel.Warn, "ExtendedVariantMode/ExtendedVariantsModule", "Loading level from level (console load?), running level exit hooks!");
                TriggerManager.ResetVariantsOnLevelExit();
                unhookTrigger();
            }

            if (!triggerIsHooked)
            {
                checkForceEnableVariants(session);
                showForcedVariantsPostcard = false;
            }

            orig(self, session, startPosition);
        }
 // Start is called before the first frame update
 void Start()
 {
     loader = LevelLoader.Instance;
     mainMenu.Select();
 }
    private IEnumerator LoadNextLevel()
    {
        yield return(new WaitForSecondsRealtime(levelLoadDelay));

        LevelLoader.LoadNextScene();
    }
Exemple #38
0
 public void LoadLevel(string fileName, ObjectProcessor op)
 {
     LevelLoader.FromFile(fileName, this.Content, op);
 }
Exemple #39
0
    public void NextLevel()
    {
        if (!endLevelSoundPlayed)
        {
            if (SoundManager.Instance != null)
            {
                SoundManager.Instance.ObjectSounds[0].PlayAudioClip(5);
            }
            endLevelSoundPlayed = true;
        }

        if (LevelLoader.HasMoreLevels)
        {
            NPCController.SolutionTypes solution = MontyController.GetSolution();
            switch (solution)
            {
            case NPCController.SolutionTypes.Confrontation:
                LevelLoader.CurrentPlayThrough.IncreaseGoodQuestionsAfterLevelEnded(1);
                gameStats.IncreaseConfrontation(gameStats.levelDifficulty.ToString());
                break;

            case NPCController.SolutionTypes.Ignore:
            case NPCController.SolutionTypes.Flight:
                LevelLoader.CurrentPlayThrough.IncreaseBadQuestionsAfterLevelEnded(1);
                gameStats.IncreaseIgnoreFlight(gameStats.levelDifficulty.ToString());
                break;

            case NPCController.SolutionTypes.Fight:
                LevelLoader.CurrentPlayThrough.IncreaseBadQuestionsAfterLevelEnded(1);
                gameStats.IncreaseFight(gameStats.levelDifficulty.ToString());
                break;
            }

            gameStats.Save();
            LevelLoader.LoadNextLevel();
        }
        else if (SceneManager.GetActiveScene().name == "Tutorial")
        {
            SceneManager.LoadScene("MainMenuScene");
            endLevelSoundPlayed = false;
        }
        else if (!playthroughEnded)
        {
            NPCController.SolutionTypes solution = MontyController.GetSolution();
            switch (solution)
            {
            case NPCController.SolutionTypes.Confrontation:
                LevelLoader.CurrentPlayThrough.IncreaseGoodQuestionsAfterLevelEnded(1);
                gameStats.IncreaseConfrontation(gameStats.levelDifficulty.ToString());
                break;

            case NPCController.SolutionTypes.Ignore:
            case NPCController.SolutionTypes.Flight:
                LevelLoader.CurrentPlayThrough.IncreaseBadQuestionsAfterLevelEnded(1);
                gameStats.IncreaseIgnoreFlight(gameStats.levelDifficulty.ToString());
                break;

            case NPCController.SolutionTypes.Fight:
                LevelLoader.CurrentPlayThrough.IncreaseBadQuestionsAfterLevelEnded(1);
                gameStats.IncreaseFight(gameStats.levelDifficulty.ToString());
                break;
            }

            RewardsText rewardsText = endGamePrefab.GetComponentInChildren <RewardsText>();
            if (rewardsText != null)
            {
                rewardsText.SetText();
            }

            if (LevelLoader.CurrentPlayThrough.GoodQuestionsPlaythrough == LevelLoader.DEFAULT_LEVEL_AMOUNT)
            {
                GameStats.Instance.IncreaseDifficulty();
            }
            if (LevelLoader.CurrentPlayThrough.BadQuestionsPlaythrough >= minQuestionsToDecreaseDifficulty)
            {
                GameStats.Instance.DecreaseDifficulty();
            }

            LevelLoader.EndPlaythrough();
            playthroughEnded = true;
            endGamePrefab.SetActive(true);
            endLevelSoundPlayed = false;
            gameStats.EndPlaythrough(DateTime.Now);
            gameStats.Save();
        }
    }
 void CompletedLoad(LevelLoader loader)
 {
     targetGameObject = loader.Last;
 }
Exemple #41
0
 // Use this for initialization
 void Start()
 {
     levelLoader  = new LevelLoader();
     theWorldTime = Time.timeScale;
 }
 protected override void PrepareExecution()
 {
     loader = GameObject.FindGameObjectWithTag(Tags.BallMazeController).GetComponent <LevelLoader>();
 }
Exemple #43
0
 private void Awake()
 {
     Insatnce = this;
 }
 public PreviousLevelCommand(LevelLoader loader, SaveManager saveManager = null) : base(saveManager)
 {
     this.loader = loader;
 }
Exemple #45
0
    //执行指令
    public void ExecuteCommand(string command, List <GameObject> paraGameObjects)
    {
        if (string.IsNullOrEmpty(command))
        {
            return;
        }

        m_ParaGameObjects = paraGameObjects;

        string cmd   = command.Split('#')[0].ToLower();
        string value = command.Substring(cmd.Length + 1); //command.Split('#')[1];

        if (cmd == "dialog")
        {
            //dialogPanel.Show("", value, null);
            Jyx2_UIManager.Instance.ShowUI("ChatUIPanel", ChatType.RoleKey, "", value);
        }
        else if (cmd == "selfsay")
        {
            GameRuntimeData.Instance.Player.View.Say(value);
        }
        else if (cmd == "loadlevel")
        {
            SceneManager.LoadScene(value);
        }
        else if (cmd == "loadmap")
        {
            var loadPara = new LevelMaster.LevelLoadPara()
            {
                loadType = LevelMaster.LevelLoadPara.LevelLoadType.Load
            };
            LevelLoader.LoadGameMap(value, loadPara);
        }
        else if (cmd == "mapevt")
        {
            MapEvt mapEvt = ConfigTable.Get <MapEvt>(value);

            if (mapEvt != null)
            {
                //如果已经执行过,返回
                if (mapEvt.IsFinished(runtime))
                {
                    return;
                }

                //标记为正在执行
                mapEvt.MarkAsExecuting(runtime);

                m_CurrentMapEvt = mapEvt;
                PlayStory(mapEvt.ExecuteCode.Split('\n'), mapEvt.Result);
            }
            else
            {
                Debug.LogError("载入了错误的mapevt:" + value);
            }
        }
        else if (cmd == "timeline")
        {
            PlayTimeline(value, null);
        }
        else if (cmd == "runtimestory")
        {
            PlayStory(new string[] { value }, "");
        }
        else if (cmd == "transport")
        {
            var levelMaster = FindObjectOfType <LevelMaster>();
            levelMaster.Transport(value);
        }
        else if (cmd == "win")
        {
            BattleHelper battleHelper = FindObjectOfType <BattleHelper>();
            var          model        = battleHelper.GetModel();
            foreach (var role in model.Roles)
            {
                if (role.team != 0)
                {
                    role.Hp = 0;
                }
                role.CheckDeath();
            }

            HSUtilsEx.CallWithDelay(this, () => {
                battleHelper.SwitchStatesTo(BattleHelper.BattleViewStates.WaitingForNextActiveBattleRole);
            }, 1f);
        }
        else if (cmd == "lose")
        {
            BattleHelper battleHelper = FindObjectOfType <BattleHelper>();
            var          model        = battleHelper.GetModel();
            foreach (var role in model.Roles)
            {
                if (role.team == 0)
                {
                    role.Hp = 0;
                }
                role.CheckDeath();
            }
            HSUtilsEx.CallWithDelay(this, () =>
            {
                battleHelper.SwitchStatesTo(BattleHelper.BattleViewStates.WaitingForNextActiveBattleRole);
            }, 1f);
        }
        else if (cmd == "testlua")
        {
            LuaExecutor.Execute(value);
        }
        else if (cmd == "jyx2event")
        {
            LuaExecutor.Execute("jygame/ka" + value);
        }
        else if (cmd == "battle")
        {
            LevelLoader.LoadBattle(int.Parse(value), null);
        }
    }
Exemple #46
0
 private void Awake()
 {
     currentLevel = LevelLoader.GetInstance().GetCurrentLevel();
 }
 public void LoadContent(LevelLoader levelLoader)
 {
     Players         = new IPlayer[4];
     _gamePadStrings = new string[4];
 }
Exemple #48
0
 void Awake()
 {
     _instance      = this;
     blobAssetStore = new BlobAssetStore();
 }
 private void TakePlayerLife()
 {
     playerLives--;
     livesText.text = playerLives.ToString();
     LevelLoader.ReloadCurrentScene();
 }
Exemple #50
0
 public void MainMenu()
 {
     LevelLoader.LoadMainMenu();
 }
 // Start is called before the first frame update
 void Start()
 {
     loader = LevelLoader.Instance;
 }
Exemple #52
0
 // Use this for initialization
 void Start()
 {
     gameObject.AddComponent <LevelLoader>();
     level = gameObject.GetComponent <LevelLoader>();
     level.LoadLevel(2);
 }
Exemple #53
0
 private void Start()
 {
     sm        = SoundManager.Instance;
     loader    = LevelLoader.Instance;
     gameEnded = false;
 }
Exemple #54
0
        private void PatchLoadingThread(On.Celeste.LevelLoader.orig_LoadingThread orig, LevelLoader self)
        {
            var settings = this.InRandomizerSettings;

            if (settings != null)
            {
                Logger.Log("randomizer", "Mashing up tilesets...");
                MakeFrankenTilesets(settings);
            }
            orig(self);
        }
Exemple #55
0
 public virtual void configure(TileSettings settings, LevelLoader loader)
 {
 }
Exemple #56
0
 void Awake()
 {
     LL = FindObjectOfType <LevelLoader>();
     Invoke("LoadScene", VideoLength);
 }
Exemple #57
0
 void Awake()
 {
     levelLoader = GetComponent <LevelLoader> ();
     timer       = GetComponent <Timer>();
 }
Exemple #58
0
 void Start()
 {
     LevelLoader = FindObjectOfType <LevelLoader>();
 }
Exemple #59
0
 void Awake()
 {
     GameObject.DontDestroyOnLoad (gameObject);
     LevelLoader.Instance = gameObject.GetComponent<LevelLoader>();
 }
 public void LoadContent(LevelLoader levelLoader)
 {
 }