Exemple #1
0
 // Update is called once per frame
 void Update()
 {
     ownedBG.text = ("Owned: " + Player.bubbleGum);
     if (sword == false)
     {
         swordStock.text = ("In stock: 1");
         swordOwned.text = ("Do not own");
     }
     else
     {
         swordStock.text = ("In stock: 0");
         swordOwned.text = ("Proud owner!");
         swd.Activate();
     }
     if (armor == false)
     {
         armorStock.text = ("In stock: 1");
         armorOwned.text = ("Do not own");
     }
     else
     {
         armorStock.text = ("In stock: 0");
         armorOwned.text = ("Proud owner!");
         amr.Activate();
     }
 }
Exemple #2
0
    public void ThrowSword()
    {
        Sword sword = GameManager.m_Instance.GetObjectPool.GetSword();

        if (sword != null)
        {
            //Vector2 direction = GameManager.m_Instance.GetBulletDirection(transform.position, Camera.main.ScreenToWorldPoint(Input.mousePosition));
            Vector2 direction = GameManager.m_Instance.GetBulletDirection(m_SwordThrowPoint.position, new Vector2(m_SwordThrowPoint.position.x, m_SwordThrowPoint.position.y + 1f));
            sword.Activate(m_SwordThrowPoint.position, direction);
        }
    }
    // 입력 체크..
    void Update()
    {
        // indexTriggerName - 검지용 트리거를 누른 순간
        if (Input.GetAxisRaw(indexTriggerName) >= 0.1f)
        {
            // 여기 내용을 원하는 처리로 교체하면 다른 게임에 적용 가능

            // 검을 소환한다
            sword.Activate();
            Debug.Log("방아쇠를 누름");
        }

        // gripTriggerName - 쥐는 트리거를 누른 순간
        if (Input.GetAxisRaw(gripTriggerName) >= 0.1f)
        {
            // 여기 내용을 원하는 처리로 교체하면 다른 게임에 적용 가능

            // 검기를 모은다
            sword.Charge();
            Debug.Log("사이드 방아쇠를 누름");
        }
    }