예제 #1
0
    // Update is called once per frame
    void Update()
    {
        if (Input.GetKeyDown(KeyCode.Alpha1))
        {
            GUI_Manager.GetInstance().m_cSkillBtn1.UseSkill();
        }
        if (Input.GetKeyDown(KeyCode.Alpha2))
        {
            GUI_Manager.GetInstance().m_cSkillBtn2.UseSkill();
        }
        if (Input.GetKeyDown(KeyCode.Alpha3))
        {
            GUI_Manager.GetInstance().m_cSkillBtn3.UseSkill();
        }
        if (Input.GetKeyDown(KeyCode.Alpha4))
        {
            GUI_Manager.GetInstance().m_cSkillBtn4.UseSkill();
        }

        if (Input.GetKeyDown(KeyCode.Q))
        {
            QSkill();
            GUI_Manager.GetInstance().m_cSkillBtnQ.UseSkill();
        }
        else
        {
            GameManager.GetInstance().aniPlayer.SetBool("hit01Chk", false);
        }

        if (Input.GetKeyDown(KeyCode.E))
        {
            ESkill();
            GUI_Manager.GetInstance().m_cSkillBtnE.UseSkill();
        }
        else
        {
            GameManager.GetInstance().aniPlayer.SetBool("hit02Chk", false);
        }


        if (Input.GetKeyDown(KeyCode.R))
        {
            RSkill();
            GUI_Manager.GetInstance().m_cSkillBtnR.UseSkill();
        }
        else
        {
            GameManager.GetInstance().aniPlayer.SetBool("hit03Chk", false);
        }


        if (Input.GetKeyDown(KeyCode.F))
        {
            GUI_Manager.GetInstance().m_cSkillBtnF.UseSkill();
        }
    }
예제 #2
0
    private void Awake()
    {
        SharedInstance = this;

        mainCamera = Camera.main;
        mainCanvas = mainCamera.GetComponentInChildren <Canvas>();
        RectTransform rt = mainCanvas.GetComponent <RectTransform>();

        GetWorldCorners(rt); //so we know where to spawn our obstacles!
    }
예제 #3
0
 public void RSkill()
 {
     if (GUI_Manager.GetInstance().m_cSkillBtnR.m_bCanUseSkill)
     {
         GameManager.GetInstance().aniPlayer.SetBool("hit03Chk", true);
     }
     else
     {
         GameManager.GetInstance().aniPlayer.SetBool("hit03Chk", false);
     }
 }
예제 #4
0
    private void Awake()
    {
        if (instance == null)
            instance = this;
        else if (instance != this)
            Destroy(gameObject);

        PanelHP.SetActive(false);
        PanelChapter.SetActive(false);
        PanelToolTip.SetActive(false);
        PanelHeart.SetActive(false);
        UiHp.SetActive(false);
    }
예제 #5
0
 // Start is called before the first frame update
 void Start()
 {
     fired                = false;
     ship                 = Instantiate((GameObject)Resources.Load("Prefabs/ship"), new Vector3(0, 0, 0), Quaternion.identity);
     shipScript           = ship.GetComponent <Ship>();
     input                = this.GetComponent <Input_Manager>();
     gui                  = this.GetComponent <GUI_Manager>();
     gui.ShipLives        = 3;
     asteroidM            = this.GetComponent <Asteroid_Manager>();
     bManager             = this.GetComponent <Bullet_Manager>();
     sceneChange          = gameObject.GetComponent <Scene_Changer>();
     screenShake          = Camera.main.GetComponent <ShakeBehavior>();
     isCoroutineExecuting = false;
     AudioSource[] audioSources = GetComponents <AudioSource>();
     source = audioSources[0];
     laser  = audioSources[0].clip;
     crash  = audioSources[1].clip;
 }
예제 #6
0
    private void InitializeAndLoadPlayer()
    {
        tempGO   = Resources.Load("Pawn/Player") as GameObject;
        playerGO = Instantiate(tempGO, new Vector3(lengthTerrain / 2, maxHeight, widthTerrain / 2), Quaternion.identity);

        playerCharacterController = playerGO.GetComponentInChildren <CharacterController>();
        playerFP_Controller       = playerGO.GetComponentInChildren <FP_Controller>();
        playerPawn = playerGO.GetComponentInChildren <Pawn>();
        playerTR   = playerPawn.gameObject.GetComponent <Transform>();
        playerFP_Controller.walkSpeed = playerPawn.m_PawnSO.Speed;
        playerFP_Controller.runSpeed  = playerPawn.m_PawnSO.Speed * 2.0f;

        playerTR.position = new Vector3(lengthTerrain / 2, maxHeight + playerCharacterController.height, widthTerrain / 2);

        m_GUI_Manager = FindObjectOfType <GUI_Manager>();
        m_Camera      = Camera.main;

        CurrentGameMode = GameMode.Game;
    }
예제 #7
0
 private void Awake()
 {
     if (instance == null)
     {
         instance = this;
     }
     else if (instance != this)
     {
         Destroy(gameObject);
     }
     if (PanelChapter != null)
     {
         PanelChapter.SetActive(false);
     }
     if (PanelToolTip != null)
     {
         PanelToolTip.SetActive(false);
     }
     InitPanelHp();
 }
예제 #8
0
    //private void OnCollisionEnter(Collision collision)
    //{
    //    Debug.Log("OnCollisionEnter:" + collision.gameObject.name);
    //    if(collision.gameObject.tag == "Sword")
    //    {

    //    }
    //    if(collision.gameObject.tag == "Player")
    //    {

    //    }
    //}

    public void QSkill()
    {
        if (GUI_Manager.GetInstance().m_cSkillBtnQ.m_bCanUseSkill)
        {
            GameManager.GetInstance().aniPlayer.SetBool("hit01Chk", true);
        }
        else
        {
            GameManager.GetInstance().aniPlayer.SetBool("hit01Chk", false);
        }

        GameManager.GetInstance().monster.m_fHp = GameManager.GetInstance().monster.m_fHp -
                                                  (GameManager.GetInstance().player.m_fStr - GameManager.GetInstance().monster.m_fAtk_Def);
        Debug.Log("Monster Hp" + GameManager.GetInstance().monster.m_fHp);

        //if (.tag == "Sword")
        //{
        //    Debug.Log("검");

        //    if (GameManager.GetInstance().m_cPlayer.m_fMp >= 100)
        //    {
        //        GameManager.GetInstance().m_cMonster.m_fHp -= GameManager.GetInstance().m_cPlayer.m_fStr + (GameManager.GetInstance().m_cSword.m_nLv * 1.5f);
        //        GameManager.GetInstance().m_cPlayer.m_fMp -= 100;
        //    }
        //}
        //if (m_Item.gameObject.tag == "Wand")
        //{
        //    Debug.Log("지팡이.");

        //    if (GameManager.GetInstance().m_cPlayer.m_fMp >= 100)
        //    {
        //        GameManager.GetInstance().m_cMonster.m_fHp -= GameManager.GetInstance().m_cPlayer.m_fInt + (GameManager.GetInstance().m_cWand.m_nLv * 1.5f);
        //        GameManager.GetInstance().m_cPlayer.m_fMp -= 100;
        //    }
        //}
        //if (m_Item == null)
        //{
        //    Debug.Log("무기를 장착하세요.");
        //}
    }
예제 #9
0
 // Use this for initialization
 void Start()
 {
     instance = this;
 }
예제 #10
0
 private void Awake()
 {
     guiMan             = this;
     scoreText.text     = "Total Score: " + GameManager.manager.score;
     lifeScoreText.text = "Score This Life: " + GameManager.manager.lifeScore;
 }
예제 #11
0
 // Use this for initialization
 void Start()
 {
     m_cInstance = this;
 }