Esempio n. 1
0
    public void BtnRestartLevel()
    {
        LvlManager lvlManager = GameObject.Find("LevelManager").GetComponent <LvlManager>();

        clickSound.Play();
        gameManager.paused = false;
        Debug.Log("HUD -> Restart");
        Time.timeScale         = 1;
        playerHUD.alpha        = 1;
        playerHUD.interactable = true;
        playerHUD.gameObject.SetActive(true);
        pauseMenu.alpha        = 0;
        pauseMenu.interactable = false;
        pauseMenu.gameObject.SetActive(false);

        //if restarting from gameover screen
        if (goScreen)
        {
            deathMenu.alpha        = 0;
            deathMenu.interactable = false;
            deathMenu.gameObject.SetActive(false);
            goScreen = false;
        }

        gameManager.ReloadLevel();
    }
Esempio n. 2
0
    // Use this for initialization
    void Start()
    {
        WarriorClass = GameObject.Find("character");
        wrr          = WarriorClass.GetComponent <Warrior>();
        manager      = WarriorClass.GetComponent <LvlManager>();

        go.SetActive(false);
        wasActive = false;
        next      = false;
        level     = lvltext.text;
        if (GlobalControl.Instance.TreeGrade == "0")
        {
            RootNode.SetActive(false);
            Node2.SetActive(false);
            Node3.SetActive(false);
            Node3.SetActive(false);
            Node4.SetActive(false);

            stick1.SetActive(false);
            stick2.SetActive(false);
            stick3.SetActive(false);
        }
        else
        {
            char[] charArray = GlobalControl.Instance.TreeGrade.ToCharArray(0, 5);
            int    firstChar = (int)Char.GetNumericValue(charArray[0]);
            treelevel = firstChar;
        }
    }
Esempio n. 3
0
 protected void dgLevel_RowCommand(object sender, GridViewCommandEventArgs e)
 {
     if (e.CommandName == "AddNew")
     {
         dgLevel.FooterRow.Visible = true;
     }
     else if (e.CommandName == "Insert")
     {
         GlLevel glevel = new GlLevel();
         glevel.LvlCode    = ((TextBox)dgLevel.FooterRow.FindControl("txtLevelCode")).Text;
         glevel.LvlDesc    = ((TextBox)dgLevel.FooterRow.FindControl("txtLevelDesc")).Text;
         glevel.LvlMaxSize = ((TextBox)dgLevel.FooterRow.FindControl("txtLevelMaxSize")).Text;
         glevel.LvlEnabled = ((DropDownList)dgLevel.FooterRow.FindControl("ddlLevelEnabled")).SelectedValue;
         glevel.LvlSegType = ((DropDownList)dgLevel.FooterRow.FindControl("ddlLevelSegType")).SelectedValue;
         glevel.LvlOrder   = ((TextBox)dgLevel.FooterRow.FindControl("txtLevelOrder")).Text;
         LvlManager.InsertLevel(glevel);
         dgLevel.FooterRow.Visible = false;
         dgLevel.DataSource        = LvlManager.GetLevels();
         dgLevel.DataBind();
         dgGlCoaGen.DataSource = LvlManager.GetLevelsGrid();
         dgGlCoaGen.DataBind();
         //ClientScript.RegisterStartupScript(this.GetType(), "alert", "<script language=JavaScript>alert('Created Successfully! ');</script>");
     }
     else
     {
         dgLevel.FooterRow.Visible = false;
     }
 }
    void Start()
    {
        WarriorClass = GameObject.Find("character");
        wrr          = WarriorClass.GetComponent <Warrior>();

        LvlManagerClass = GameObject.Find("Main Camera");
        lvlmng          = LvlManagerClass.GetComponent <LvlManager>();

        unlockedAb = new bool[3];                       //инициализация
        levelAb    = new int[3];
        unlockedAb = wrr.unlockedabilities;
        levelAb    = wrr.levelofabilities;
        _level     = wrr.level;

        UnblockButton1.SetActive(false);
        UnblockButton2.SetActive(false);
        UnblockButton3.SetActive(false);

        Skill1.interactable = false;
        Skill2.interactable = false;
        Skill3.interactable = false;

        LvlUpSkill1.SetActive(false);
        LvlUpSkill2.SetActive(false);
        LvlUpSkill3.SetActive(false);
    }
Esempio n. 5
0
    // Use this for initialization
    void Start()
    {
        anim = GetComponent<Animator>();
        levelmanager = FindObjectOfType<LvlManager> ();

        enableControl = true;
    }
Esempio n. 6
0
    // Use this for initialization
    void Start()
    {
        anim         = GetComponent <Animator>();
        levelmanager = FindObjectOfType <LvlManager> ();

        enableControl = true;
    }
Esempio n. 7
0
    void Die()
    {
        Destroy(gameObject);
        LvlManager mng = GameObject.Find("LvlManager").GetComponent <LvlManager>();

        mng.LoadLevel("Win");
        AudioSource.PlayClipAtPoint(deathSound, transform.position, deathVolume);
    }
Esempio n. 8
0
    void Start()
    {
        WarriorClass = GameObject.Find("character");
        wrr          = WarriorClass.GetComponent <Warrior>();

        LvlManagerClass = GameObject.Find("Main Camera");
        lvlmng          = LvlManagerClass.GetComponent <LvlManager>();
    }
Esempio n. 9
0
    protected void dgLevel_RowCancelingEdit(object sender, GridViewCancelEditEventArgs e)
    {
        DataTable dtLvl = LvlManager.GetLevels();

        dgLevel.EditIndex  = -1;
        dgLevel.DataSource = dtLvl;
        dgLevel.DataBind();
    }
Esempio n. 10
0
 protected void dgLevel_RowDeleting(object sender, GridViewDeleteEventArgs e)
 {
     LvlManager.DeleteLevel(((Label)dgLevel.Rows[e.RowIndex].FindControl("lblLevelCode")).Text);
     dgLevel.DataSource = LvlManager.GetLevels();
     dgLevel.DataBind();
     dgGlCoaGen.DataSource = LvlManager.GetLevelsGrid();
     dgGlCoaGen.DataBind();
 }
Esempio n. 11
0
 private void Awake()
 {
     if (instance != null)
     {
         Destroy(gameObject);
         return;
     }
     instance = this;
 }
Esempio n. 12
0
    void Start()
    {
        APIClass = GameObject.Find("API");
        api      = APIClass.GetComponent <MainAPI>();

        WarriorClass = GameObject.Find("character");
        wrr          = WarriorClass.GetComponent <Warrior>();

        LvlManagerClass = GameObject.Find("Main Camera");
        lvlmng          = LvlManagerClass.GetComponent <LvlManager>();

        unlockedAb = new bool[3];                       //инициализация
        levelAb    = new int[3];
        unlockedAb = wrr.unlockedabilities;
        levelAb    = wrr.levelofabilities;
        _level     = wrr.level;
        string str = GlobalControl.Instance.LevelGrade;

        char[] charArray  = str.ToCharArray(0, 5);
        int    firstChar  = (int)Char.GetNumericValue(charArray[0]);
        int    secondChar = (int)Char.GetNumericValue(charArray[2]);
        int    thirdChar  = (int)Char.GetNumericValue(charArray[4]);

        _level        = wrr.level;
        unlockedAb[0] = true;
        unlockedAb[1] = true;
        unlockedAb[2] = true;
        levelAb[0]    = firstChar;
        levelAb[1]    = secondChar;
        levelAb[2]    = thirdChar;

        UnblockButton1.SetActive(false);
        UnblockButton2.SetActive(false);
        UnblockButton3.SetActive(false);

        Skill1.interactable = false;
        Skill2.interactable = false;
        Skill3.interactable = false;

        LvlUpSkill1.SetActive(false);
        LvlUpSkill2.SetActive(false);
        LvlUpSkill3.SetActive(false);

        Img1Skill1Lvl.SetActive(false);
        Img1Skill2Lvl.SetActive(false);
        Img1Skill3Lvl.SetActive(false);
        Img1Skill4Lvl.SetActive(false);
        Img2Skill1Lvl.SetActive(false);
        Img2Skill2Lvl.SetActive(false);
        Img2Skill3Lvl.SetActive(false);
        Img2Skill4Lvl.SetActive(false);
        Img3Skill1Lvl.SetActive(false);
        Img3Skill2Lvl.SetActive(false);
        Img3Skill3Lvl.SetActive(false);
        Img3Skill4Lvl.SetActive(false);
    }
Esempio n. 13
0
    // Use this for initialization
    void Start()
    {
        bubble = this.transform.Find("Bubble").gameObject;

        player       = GetComponent <Controller3>();
        levelmanager = FindObjectOfType <LvlManager> ();

        //init bubble with radius
        bubble.transform.localScale = new Vector3(player.radius, player.radius, 0);
    }
Esempio n. 14
0
    // Use this for initialization
    void Start()
    {
        bubble = this.transform.Find("Bubble").gameObject;

        player = GetComponent<Controller3>();
        levelmanager = FindObjectOfType<LvlManager> ();

        //init bubble with radius
        bubble.transform.localScale = new Vector3(player.radius,player.radius,0);
    }
Esempio n. 15
0
 private void Awake()
 {
     if (instance == null)
     {
         instance = this;
     }
     else
     {
         this.enabled = false;
     }
 }
Esempio n. 16
0
    /////////////////////////////////////////////////////////////// OnSceneFinishedLoading () /////////////////////////////////////////
    void OnSceneFinishedLoading(Scene scene, LoadSceneMode mode)
    {
        int newSceneIdx = scene.buildIndex;

        currentScene = newSceneIdx;
        Debug.Log("Game Manager -> Scene Loaded: idx=" + newSceneIdx + ", name=" + scene.name + ", loadMode=" + mode);
        Bloom bloomLayer;

        ppProfile.TryGetSettings(out bloomLayer);

        if (newSceneIdx > CREDITS)  // -- Level Loaded --
        {
            //prepare GameObjects in _Base for Gameplay. Ex: Activate player.
            if (!player.activeInHierarchy)
            {
                player.SetActive(true);
            }
            bool clearBoxes = false;
            if (playerDied || newFloor)
            {
                clearBoxes = true;
            }
            playerManager.ResetPlayer(clearBoxes);
            lvlManager = GameObject.Find("LevelManager").GetComponent <LvlManager>();
            lvlManager.InitLevel(this, lastSceneName, playerDied);

            //post processing
            bloomLayer.intensity.value = 63f;
            bloomLayer.threshold.value = 1.6f;
            bloomLayer.softKnee.value  = 0.7f;
            //Level Specific
            if (newSceneIdx == FLOOR_1)
            {
                GameObject.Find("Protagonist_v6").GetComponent <PlayerSound>().BossMusic();
            }
            if (floorList.Contains(newSceneIdx))
            {
                PlayerPrefs.SetInt("UnlockedFloor", currentScene);
            }
        }
        else if (newSceneIdx == CREDITS) // -- Credits Screen Loaded --
        {
            //post processing
            bloomLayer.intensity.value = 1f;
            bloomLayer.threshold.value = 0.4f;
            bloomLayer.softKnee.value  = 0f;
            if (player.activeInHierarchy)
            {
                player.SetActive(false);
            }
        }

        playerDied = false;
    }
 void Start()
 {
     healthBar = GetComponent <Slider>();
     theTime   = FindObjectOfType <TimeManager>();
     //text = GetComponent<Text>();
     // playerHealth = maxPlayerHealth;
     playerHealth = PlayerPrefs.GetInt("PlayerCurrentHealth");
     lvlmangr     = FindObjectOfType <LvlManager>();
     lifeSystem   = FindObjectOfType <LifeManager>();
     isDead       = false;
 }
Esempio n. 18
0
 private void Awake()
 {
     if (instance == null)
     {
         instance = this;
     }
     else
     {
         Destroy(this);
     }
 }
Esempio n. 19
0
    protected void dgLevel_RowEditing(object sender, GridViewEditEventArgs e)
    {
        string    le    = ((Label)dgLevel.Rows[e.NewEditIndex].FindControl("lblLevelEnabled")).Text.ToString();
        string    ls    = ((Label)dgLevel.Rows[e.NewEditIndex].FindControl("lblLevelSegType")).Text.ToString();
        DataTable dtLvl = LvlManager.GetLevels();

        dgLevel.EditIndex  = e.NewEditIndex;
        dgLevel.DataSource = dtLvl;
        dgLevel.DataBind();
        ((DropDownList)dgLevel.Rows[e.NewEditIndex].FindControl("ddlLevelEnabled")).SelectedIndex = ((DropDownList)dgLevel.Rows[e.NewEditIndex].FindControl("ddlLevelEnabled")).Items.IndexOf(((DropDownList)dgLevel.Rows[e.NewEditIndex].FindControl("ddlLevelEnabled")).Items.FindByValue(le));
        ((DropDownList)dgLevel.Rows[e.NewEditIndex].FindControl("ddlLevelSegType")).SelectedIndex = ((DropDownList)dgLevel.Rows[e.NewEditIndex].FindControl("ddlLevelSegType")).Items.IndexOf(((DropDownList)dgLevel.Rows[e.NewEditIndex].FindControl("ddlLevelSegType")).Items.FindByValue(ls));
    }
 void Awake()
 {
     if (instance == null)
     {
         instance = this;
         DontDestroyOnLoad(instance);
     }
     else
     {
         Destroy(gameObject);
     }
 }
Esempio n. 21
0
    // Use this for initialization
    void Start()
    {
        lvlMan = FindObjectOfType(typeof(LvlManager)) as LvlManager;

        if (lvlMan.numberOfLevels > lvlMan.lvl)
        {
            this.transform.Find("ButtonLevelSelect").gameObject.SetActive(false);
        }
        else
        {
            this.transform.Find("ButtonNext").gameObject.SetActive(false);
        }
    }
Esempio n. 22
0
    protected override void Awake()
    {
        DontDestroyOnLoad(gameObject);

        if (m_Instance != null)
        {
            Destroy(gameObject);
        }
        else
        {
            m_Instance = this;
        }
        base.Awake();
    }
Esempio n. 23
0
 protected void btnClearCoa_Click(object sender, EventArgs e)
 {
     System.Threading.Thread.Sleep(3000);
     //DataTable dtLvl = LvlManager.GetLevels();
     //DataColumn dcol1 = new DataColumn("seg_code", typeof(string));
     //dtLvl.Columns.Add(dcol1);
     //DataColumn dcol2 = new DataColumn("seg_desc", typeof(string));
     //dtLvl.Columns.Add(dcol2);
     //dgGlCoaGen.DataSource = dtLvl;
     //dgGlCoaGen.DataBind();
     //dgGlCoa.DataBind();
     dgGlCoaGen.DataSource = LvlManager.GetLevelsGrid();
     dgGlCoaGen.DataBind();
     btnSaveCoa.Visible  = false;
     lblTransStatus.Text = "";
 }
Esempio n. 24
0
    // Use this for initialization
    void Start()
    {
        //moveSpeed = OriginalMoveSpeed;

        moveSpeed = DebugInfo.OriginalMoveSpeed;
        IncreaseSpeedFrequency = DebugInfo.SpeedFrequency;
        IncreaseSpeedRate      = DebugInfo.SpeedRate;


        //startMoveSpeed = moveSpeed;
        myRigidBody     = GetComponent <Rigidbody2D>();
        myAnmin         = GetComponent <Animator>();
        theBoost        = FindObjectOfType <Boost>();
        theLevelManager = FindObjectOfType <LvlManager>();

        StartCoroutine("IncreaseSpeed");
    }
Esempio n. 25
0
    public virtual void EnemyDeathEnd()
    {
        int        coinflip   = (int)(Random.Range(0, 2));
        LvlManager lvlManager = GameObject.Find("LevelManager").GetComponent <LvlManager>();

        //Spawn Reward
        if (coinflip < 1)
        {
            lvlManager.SpawnRandomReward(gameObject.transform.position);
        }

        //save state
        PlayerPrefs.SetInt(objectID, 1);
        lvlManager.EnemyKilled();

        Destroy(gameObject);
    }
Esempio n. 26
0
    protected void dgLevel_RowUpdating(object sender, GridViewUpdateEventArgs e)
    {
        GlLevel lvl = LvlManager.getLevel(((TextBox)dgLevel.Rows[e.RowIndex].FindControl("txtLevelCode")).Text);

        lvl.LvlDesc    = ((TextBox)dgLevel.Rows[e.RowIndex].FindControl("txtLevelDesc")).Text;
        lvl.LvlMaxSize = ((TextBox)dgLevel.Rows[e.RowIndex].FindControl("txtLevelMaxSize")).Text;
        lvl.LvlEnabled = ((DropDownList)dgLevel.Rows[e.RowIndex].FindControl("ddlLevelEnabled")).SelectedValue.ToString();
        lvl.LvlSegType = ((DropDownList)dgLevel.Rows[e.RowIndex].FindControl("ddlLevelSegType")).SelectedValue.ToString();
        lvl.LvlOrder   = ((TextBox)dgLevel.Rows[e.RowIndex].FindControl("txtLevelOrder")).Text;
        LvlManager.UpdateLevel(lvl);
        DataTable dtLvl = LvlManager.GetLevels();

        dgLevel.EditIndex  = -1;
        dgLevel.DataSource = dtLvl;
        dgLevel.DataBind();
        dgGlCoaGen.DataSource = LvlManager.GetLevelsGrid();
        dgGlCoaGen.DataBind();
        //ClientScript.RegisterStartupScript(this.GetType(), "alert", "<script language=JavaScript>alert('Updated Successfully! ');</script>");
    }
Esempio n. 27
0
    protected void Page_Load(object sender, EventArgs e)
    {
        try
        {
            if (Session["user"] == null)
            {
                Response.Redirect("Default.aspx");
            }
            else
            {
                string pageName = DataManager.GetCurrentPageName();
                string modid    = PermisManager.getModuleId(pageName);
                per = PermisManager.getUsrPermis(Session["user"].ToString().Trim().ToUpper(), modid);
                if (per != null && per.AllowView == "Y")
                {
                    ((Label)Page.Master.FindControl("lblLogin")).Text         = Session["wnote"].ToString();
                    ((LinkButton)Page.Master.FindControl("lbLogout")).Visible = true;
                }
                else
                {
                    Response.Redirect("Default.aspx");
                }
            }
        }
        catch
        {
            Response.Redirect("Default.aspx");
        }
        txtOpenDate.Attributes.Add("onBlur", "formatdate('" + txtOpenDate.ClientID + "')");
        if (!IsPostBack)
        {
            DataTable dtLvl = LvlManager.GetLevels();
            dgLevel.DataSource = dtLvl;
            dgLevel.DataBind();

            dgGlCoaGen.DataSource = LvlManager.GetLevelsGrid();
            dgGlCoaGen.DataBind();
            Populate();
            TreeView1.CollapseAll();
        }
    }
Esempio n. 28
0
    void Start()
    {
        Cursor.visible   = false;
        myAnim           = GetComponent <Animator>();
        playerController = GetComponent <PlayerController>();
        audioSource      = GetComponent <AudioSource>();

        //health
        currentHealth         = maxHealth;
        healthSlider.maxValue = maxHealth;
        healthSlider.value    = currentHealth;

        //exp
        currentExp         = 0;
        requiredExp        = 100;
        expSlider.value    = currentExp;
        expSlider.maxValue = requiredExp;

        //CheckPoint
        lvlManager         = GameObject.FindGameObjectWithTag("LvlManager").GetComponent <LvlManager>();
        transform.position = lvlManager.lastCheckpoint;
    }
    IEnumerator DeathSequence()
    {
        deathSequence = true;
        animator.SetBool("dead", true);
        disableInputs = true;
        yield return(new WaitForSeconds(1.5f));

        disableInputs = false;
        hud.PlayerDied();
        health = origHealth;
        LvlManager lvlMngr = GameObject.Find("LevelManager").GetComponent <LvlManager>();

        if (lvlMngr != null)
        {
            if (lvlMngr.repairRoom)
            {
                health = 25;
            }
        }
        hud.SetHealth(health);
        deathSequence = false;
    }
Esempio n. 30
0
    public override void EnemyDeathEnd()
    {
        LvlManager lvlManager = GameObject.Find("LevelManager").GetComponent <LvlManager>();

        //Spawn Reward
        lvlManager.SpawnRandomReward(new Vector3(gameObject.transform.position.x, gameObject.transform.position.y - 5.8f, gameObject.transform.position.z));
        lvlManager.SpawnRandomReward(new Vector3(gameObject.transform.position.x - 2.5f, gameObject.transform.position.y - 5.8f, gameObject.transform.position.z));
        lvlManager.SpawnRandomReward(new Vector3(gameObject.transform.position.x + 2.5f, gameObject.transform.position.y - 5.8f, gameObject.transform.position.z));
        lvlManager.SpawnRandomReward(new Vector3(gameObject.transform.position.x, gameObject.transform.position.y - 4f, gameObject.transform.position.z));
        lvlManager.SpawnRandomReward(new Vector3(gameObject.transform.position.x - 2.5f, gameObject.transform.position.y - 4f, gameObject.transform.position.z));
        lvlManager.SpawnRandomReward(new Vector3(gameObject.transform.position.x + 2.5f, gameObject.transform.position.y - 4f, gameObject.transform.position.z));

        //Spawn Orb
        Instantiate(orb, gameObject.transform.position, Quaternion.identity);

        //cutscene stuff
        finalBossCutscene.BossDied();

        //save state
        PlayerPrefs.SetInt(objectID, 1);
        lvlManager.EnemyKilled();

        Destroy(gameObject);
    }
Esempio n. 31
0
 // Use this for initialization
 void Start()
 {
     lvlManager = FindObjectOfType <LvlManager>();
 }
Esempio n. 32
0
 // Use this for initialization
 void Start()
 {
     levelmanager = FindObjectOfType<LvlManager> ();
 }
 // Start is called before the first frame update
 void Start()
 {
     lvlManager = FindObjectOfType <LvlManager>();
     lifeSystem = FindObjectOfType <LifeManager>();
 }