Ejemplo n.º 1
0
 public static ComboSystemMng GetInstance()
 {
     if (!instance)
     {
         instance = (ComboSystemMng)GameObject.FindObjectOfType(typeof(ComboSystemMng));
         if (!instance)
         {
             Debug.LogError("instance is Null,, Can't Find GameObject what Have ComboSystemMng Component");
         }
     }
     return(instance);
 }
Ejemplo n.º 2
0
    private void OnTriggerStay(Collider other)
    {
        if (other.tag == "Player")
        {
            //통로에 설치된 콜라이더를 플레이어가 건드리면 입구 콜라이더의 트리거가 꺼지면서 다시 못돌아가게 만듬.
            entranceCollider.RemoveEntranceBoxColliderTrigger();

            //통로에 머무리는 동안 계속 체력이 차도록
            ComboSystemMng comboSystemMng = other.gameObject.GetComponent <ComboSystemMng>();
            comboSystemMng.ResetHpToDefault();
        }
    }
Ejemplo n.º 3
0
    private bool isEnemiesAllDead        = false; //적들 다수를 생성 후 모두 죽었는지 확인하기 위한 변수

    void Start()
    {
        tutorialTextMng = this.gameObject.GetComponentInChildren <TutorialTextMng>();
        if (!tutorialTextMng)
        {
            Debug.LogError("TutorialMng의 dutorialTextMng is null");
            Debug.Break();
        }

        player = GameObject.FindGameObjectWithTag("Player");
        if (!player)
        {
            Debug.LogError("TutorialMng의 player is null");
            Debug.Break();
        }
        else
        {
            playerController = player.gameObject.GetComponent <PlayerController>();
            if (!playerController)
            {
                Debug.LogError("DutorialMng의 playerController is null");
            }

            playerAtkMng = player.gameObject.GetComponent <PlayerAtkMng>();
            if (!playerAtkMng)
            {
                Debug.LogError("DutorialMng의 playerAtkMng is null");
            }

            comboSystemMng = player.gameObject.GetComponent <ComboSystemMng>();
            if (!comboSystemMng)
            {
                Debug.LogError("DutorialMng의 comboSystemMng is null");
            }
        }

        enemies = this.gameObject.GetComponentsInChildren <EnemyStats>();
        for (int i = 0; i < enemies.Length; ++i)
        {
            if (!enemies[i])
            {
                Debug.Log("DutorialMng의 enemies[" + i + "] is null");
            }

            else if (enemies[i])
            {
                enemies[i].gameObject.SetActive(false);
            }
        }
    }
Ejemplo n.º 4
0
    private void Start()
    {
        objTr = this.gameObject.transform;

        playerAnim = this.gameObject.GetComponent <Animator>();
        if (!playerAnim)
        {
            Debug.LogError("PlayerAtkMng의 playerAnim is null");
            Debug.Break();
        }

        comboSystemMng = ComboSystemMng.GetInstance();
        if (!comboSystemMng)
        {
            Debug.LogError("PlayerAtkMng의 comboSystemMng is null");
        }

        playerStats = this.gameObject.GetComponent <PlayerStats>();
        if (!playerStats)
        {
            Debug.LogError("playerAtkMng의 playerStats이 비었음");
        }

        normalAtkCtrl = this.gameObject.GetComponent <NormalAtkCtrl>();
        if (!normalAtkCtrl)
        {
            Debug.LogError("playerAtkMng의 normalAtkCtrl이 비었음");
        }

        elapsedMaintableTimeAfterSpecialAtk = playerStats.SpecialAtkMaintableTime;

        if (!specialAtkUiText)
        {
            Debug.LogError("PlayerAtkMng의 specialAtkUiText is null");
        }
        else
        {
            textUi = specialAtkUiText.GetComponent <Text>();
            if (!textUi)
            {
                Debug.LogError("textUi is Null , Maybe comboTextUi dont have Text Component");
            }
            specialAtkUiTextRct = specialAtkUiText.GetComponent <RectTransform>();
        }
        specialAtkUiText.gameObject.SetActive(false);

        SetForNormalAtk();
    }
Ejemplo n.º 5
0
    // Use this for initialization
    void Start()
    {
        comboSystemMng = ComboSystemMng.GetInstance();
        if (!comboSystemMng)
        {
            Debug.LogError("EndTutorial의 comboSystemMng is null");
            Debug.Break();
        }

        player = GameObject.FindGameObjectWithTag("Player");
        if (!player)
        {
            Debug.LogError("EndTutorial의 playeris null");
            Debug.Break();
        }
        else
        {
            playerAtkMng = player.gameObject.GetComponent <PlayerAtkMng>();
            if (!playerAtkMng)
            {
                Debug.LogError("EndTutorial의 playerAtkMng is null");
            }
        }
    }
Ejemplo n.º 6
0
    private void OnTriggerEnter(Collider other)
    {
        if (!isDead)
        {
            if (opponentObjAtkTagName == null)
            {
                Debug.LogError("WeaponTag Name is null");
            }

            if (other.tag == opponentObjAtkTagName)
            {
                float weaponDamage = other.gameObject.GetComponent <NeedWeaponThingsForSystem>().Damage;

                CharacterStat  objStat  = this.gameObject.GetComponent <CharacterStat>();
                WeaponMeshCtrl meshCtrl = other.GetComponent <WeaponMeshCtrl>();

                //Weapon의 메쉬일 경우
                if (meshCtrl.IsWeaponMesh)
                {
                    Weapon weapon = null;

                    if (meshCtrl)
                    {
                        weapon = meshCtrl.WeaponGameObject;
                    }
                    else
                    {
                        weapon = other.GetComponent <ProjectileCtrl>().WeaponGameObject;
                    }

                    Vector3 newPos = tr.position;
                    newPos.y += 1f;

                    // Paticle
                    Instantiate(ParticleMng.GetInstance().EffectBulletImpactWood(), newPos, tr.rotation);
                    Instantiate(ParticleMng.GetInstance().EffectBulletImpactMetal(), newPos, tr.rotation);

                    if (weapon.listSoundName.Capacity > 0)
                    {
                        int rand = Random.Range(0, weapon.listSoundName.Count);
                        AudioMng.GetInstance().PlaySound(weapon.listSoundName[rand], this.transform.position, 120f);
                    }

                    if (!isAttacked && meshCtrl)
                    {
                        isAttacked = true;
                        weapon.SubtractDurability();
                    }

                    // Combo
                    ComboSystemMng.GetInstance().AddCombo(50f);

                    // Taking Damage
                    objStat.TakeDamage(weaponDamage);
                }

                //노멀 어택의 메쉬인 경우
                else
                {
                    NormalAtkCtrl normalAtkCtrl = other.GetComponent <NormalAtkCtrl>();

                    Vector3 newPos = tr.position;
                    newPos.y += 1f;

                    // Paticle
                    Instantiate(ParticleMng.GetInstance().EffectBulletImpactWood(), newPos, tr.rotation);
                    Instantiate(ParticleMng.GetInstance().EffectBulletImpactMetal(), newPos, tr.rotation);

                    //경훈이가 만들었는데 사운드 부분이여서 일단 자름
                    //if (normalAtkCtrl.listSoundName.Capacity > 0)
                    //{
                    //    int rand = Random.Range(0, normalAtkCtrl.listSoundName.Count);
                    //    AudioMng.GetInstance().PlaySound(normalAtkCtrl.listSoundName[rand], this.transform.position, 120f);
                    //}

                    if (!isAttacked)
                    {
                        isAttacked = true;
                    }

                    // Combo
                    ComboSystemMng.GetInstance().AddCombo(50f);

                    // Taking Damage
                    objStat.TakeDamage(weaponDamage);
                }
            }
        }
    }
Ejemplo n.º 7
0
 // Use this for initialization
 void Start()
 {
     comboSystemMng = ComboSystemMng.GetInstance();
 }