コード例 #1
0
    public void SetCheckpoint()
    {
        LevelCheckpoint levelState = new LevelCheckpoint();

        levelState.state           = sequencer.curState;
        levelState.curWave         = mCurWave;
        levelState.playerScore     = UIManager.instance.hud.score.score;
        levelState.playerPlanetPos = mPlayer.planetAttach.planetPos;

        Main.instance.sceneManager.SetCheckPoint(levelState);
    }
コード例 #2
0
    protected override void Awake()
    {
        mPlayer = GetComponentInChildren <Player>();
        mPlanet = GetComponentInChildren <Planet>();

        if (mCheckpoint != null)
        {
            mCurWave = mCheckpoint.curWave;
            mScore   = mCheckpoint.playerScore;

            mPlayer.SetCheckpoint(mCheckpoint);

            mCheckpoint = null;
        }

        base.Awake();
    }
コード例 #3
0
    void OnTriggerEnter2D(Collider2D hitObject)
    {
        Enemy obj = hitObject.GetComponent <Enemy>();

        if (obj != null)
        {
            this.takeDamage(obj.damageWhenHit);
        }
        LevelCheckpoint checkpoint = hitObject.GetComponent <LevelCheckpoint>();

        if (checkpoint != null)
        {
            string nextSceneName = "scene1"; // Change this to the according level/name
            checkpoint.nextLevel(nextSceneName);
        }
        OutOfBounds bound = hitObject.GetComponent <OutOfBounds>();

        if (bound != null)
        {
            this.Die();
        }
    }
コード例 #4
0
    public override void OnCheckPoint(SceneCheckpoint point)
    {
        base.OnCheckPoint(point);

        mCheckpoint = (LevelCheckpoint)point;
    }
コード例 #5
0
ファイル: SceneLevel.cs プロジェクト: ddionisio/GitGirl
    public void SetCheckpoint()
    {
        LevelCheckpoint levelState = new LevelCheckpoint();
        levelState.state = sequencer.curState;
        levelState.curWave = mCurWave;
        levelState.playerScore = UIManager.instance.hud.score.score;
        levelState.playerPlanetPos = mPlayer.planetAttach.planetPos;

        Main.instance.sceneManager.SetCheckPoint(levelState);
    }
コード例 #6
0
ファイル: SceneLevel.cs プロジェクト: ddionisio/GitGirl
    public override void OnCheckPoint(SceneCheckpoint point)
    {
        base.OnCheckPoint(point);

        mCheckpoint = (LevelCheckpoint)point;
    }
コード例 #7
0
ファイル: SceneLevel.cs プロジェクト: ddionisio/GitGirl
    protected override void Awake()
    {
        mPlayer = GetComponentInChildren<Player>();
        mPlanet = GetComponentInChildren<Planet>();

        if(mCheckpoint != null) {
            mCurWave = mCheckpoint.curWave;
            mScore = mCheckpoint.playerScore;

            mPlayer.SetCheckpoint(mCheckpoint);

            mCheckpoint = null;
        }

        base.Awake();
    }