Beispiel #1
0
    // Update is called once per frame
    void Update()
    {
        if (Input.GetKey(KeyCode.Escape))
        {
            SceneManager.LoadScene(9);
        }

        // texto -> clica -> texto +1

        if (_effect.endText == false && index <= texts.Length)
        {
            if (index == 0)
            {
                _effect.fullText = texts[index];
                StartCoroutine(_effect.ShowText());
                index++;
                _effect.endText = false;
            }
            else if (Input.GetMouseButtonDown(0))
            {
                _effect.fullText = texts[index];
                StartCoroutine(_effect.ShowText());
                index++;
            }
        }
    }
Beispiel #2
0
    public void Hit(float amount)
    {
        mCurrentHP -= amount;
        //Show HPBar
        if (mHPBar == null)
        {
            mHPBar = GaugeBarPool.Instance.GetFromPool();
        }
        if (mCurrentHP <= 0)
        {
            mState      = eEnemyState.Die;
            mDelayCount = 0;
            mController.AddCoin(mReward);

            mHPBar.gameObject.SetActive(false);
            mHPBar = null;
            TextEffect textEffect = mController.GetTextEffect();
            textEffect.ShowText(mReward);
            textEffect.transform.position = mHPBarPos.position;// 월드좌표 카메라
            //textEffect.transform.position = Camera.main.WorldToScreenPoint(mHPBarPos.position);// 오버레이일때  tag가 MainCamera돼어야 Camera.가능
            //text effect
        }
        else
        {
            mHPBar.SetGauge(mCurrentHP, mMaxHP);
            mHPBar.transform.position = mHPBarPos.position; // 위치 변경하려면  Update에 넣으면됨.
        }
    }
Beispiel #3
0
 public void useGun()
 {
     Debug.Log("usou arma");
     // Destroy(this.gameObject);
     Destroy(doppelganger);
     _text.fullText = "the shadow figure just vanished !\nYou must find the creature and end this nightmare.\nPress esc to finish.";
     StartCoroutine(_text.ShowText());
     creatureDown = true;
 }
 // Start is called before the first frame update
 void Start()
 {
     isDeath = false;
     _text   = GameObject.FindGameObjectWithTag("gametext").GetComponent <TextEffect>();
     _gun    = GameObject.Find("gun");
     if (_gun == null)
     {
         Death();
     }
     else
     {
         _text.fullText = "A shadow figure attacks you.";
         StartCoroutine(_text.ShowText());
     }
 }
Beispiel #5
0
 public void Hit(float amount)
 {
     mCurrentHP -= amount;
     //Show HPBar
     if (mCurrentHP <= 0)
     {
         mState      = eEnemyState.Die;
         mDelayCount = 0;
         mController.AddCoin(mReward);
         TextEffect textEffect = mController.GetTextEffect();
         textEffect.ShowText(mReward);
         textEffect.transform.position = mHPBarPos.position;// 월드좌표 카메라
         //textEffect.transform.position = Camera.main.WorldToScreenPoint(mHPBarPos.position);// 오버레이일때  tag가 MainCamera돼어야 Camera.가능
         //text effect
     }
 }
Beispiel #6
0
    public void JobFinish(int id, Vector3 pos)
    {
        ColleagueData data = mDataArr[id];

        switch (data.JobType)
        {
        case eJobType.Gold:
            GameController.Instance.Gold += data.ValueCurrent;
            TextEffect effect = mTextEffectPool.GetFromPool((int)eTextEffectType.ColleagueIncome);
            effect.ShowText(UnitBuilder.GetUnitStr(data.ValueCurrent));
            effect.transform.position = pos;
            break;

        case eJobType.Touch:
            GameController.Instance.Touch();
            break;

        default:
            Debug.LogError("Wrong job type " + data.JobType);
            break;
        }
    }
 public void Death()
 {
     _text.fullText = "A shadow figure attacks you. \nSadly, you dont' have any way to defend yourself and died. \n Press ESC to return to the Main Menu";
     StartCoroutine(_text.ShowText());
     isDeath = true;
 }