コード例 #1
0
    // WhiteWizard 타겟을 나로 바꾸고 주변 노드만 가져와서 때리면 됨
    IEnumerator King_skill()
    {
        mSkillObj.SetActive(true);

        Debug.Log(mSkillObj.name);
        Debug.Log("King_skill / Enter");

        // 나의 타겟 노드를 나의 노드로
        Node EnemyNowNode = now_node;

        List <GameObject> aliveEnemyList = GameMGR.AliveEnemy;

        // 타겟 주변의 노드를 가져와
        List <Node> NodeList = GridMGR.GetNeighboringNodes(EnemyNowNode);

        yield return(new WaitForSeconds(0.5f));

        for (int i = 0; i < NodeList.Count; i++)
        {
            Node indexNode = NodeList[i];

            for (int j = 0; j < aliveEnemyList.Count; j++)
            {
                GameObject aliveEnemy = aliveEnemyList[j];

                if (aliveEnemy.GetComponent <EnemyM>().now_node.Equals(indexNode))
                {
                    aliveEnemy.GetComponent <EnemyM>().GetHit(100);
                }
            }
        }
        mSkillObj.SetActive(false);
        Skill_Switch = false;
        yield break;
    }
コード例 #2
0
    IEnumerator WhiteWizard_skill()
    {
        mSkillObj.SetActive(true);
        // 나중에 스킬 핸들링 들어갈때, mSkillObj안에 자식들(주문진, 맞는 타겟 연기 등등)을
        // 활성화 하고 비활성화 하는 방법으로 조금 더 완성된 퀄리티로 만들기.

        yield return(null);

        Debug.Log("WhiteWizard_skill / Enter");

        GameObject Effect = mSkillObj.transform.GetChild(0).transform.GetChild(1).gameObject;

        // 나의 타겟
        Node EnemyNowNode = MyTarget.GetComponent <EnemyM>().now_node;

        List <GameObject> aliveEnemyList = GameMGR.AliveEnemy;

        // 타겟 주변의 노드를 가져와
        List <Node> NodeList = GridMGR.GetNeighboringNodes(EnemyNowNode);

        yield return(new WaitForSeconds(0.8f));

        for (int i = 0; i < NodeList.Count; i++)
        {
            Node indexNode = NodeList[i];

            for (int j = 0; j < aliveEnemyList.Count; j++)
            {
                GameObject aliveEnemy = aliveEnemyList[j];

                if (aliveEnemy.GetComponent <EnemyM>().now_node.Equals(indexNode))
                {
                    aliveEnemy.GetComponent <EnemyM>().GetHit(100);
                }
            }
        }
        MyTarget.GetComponent <EnemyM>().GetHit(100);

        Effect.transform.position = MyTarget.transform.position;
        Effect.SetActive(true);

        Skill_Switch = false;

        yield return(new WaitForSeconds(2f));

        Effect.SetActive(false);
        mSkillObj.SetActive(false);
        yield break;
    }
コード例 #3
0
    IEnumerator BlackWizard_skill()
    {
        Debug.Log("My Name is:" + gameObject.name + " / I have a:" + mSkillObj.name);
        yield return(null);

        Debug.Log("BlackWizard_skill / Enter");

        // 나의 타겟
        Node EnemyNowNode = MyTarget.GetComponent <EnemyM>().now_node;

        List <GameObject> aliveEnemyList = GameMGR.AliveEnemy;

        // 타겟 주변의 노드를 가져와
        List <Node> NodeList = GridMGR.GetNeighboringNodes(EnemyNowNode);

        // 나의 타겟의 위치에 mSkillObj를 보내놓고 활성화를 시킨다.
        Debug.Log("MyPosition : " + gameObject.transform.position + " / Target : " + MyTarget.transform.position);
        mSkillObj.transform.position = MyTarget.transform.position;
        mSkillObj.SetActive(true);

        yield return(new WaitForSeconds(mAnimator.GetCurrentAnimatorStateInfo(0).length));

        for (int i = 0; i < NodeList.Count; i++)
        {
            Node indexNode = NodeList[i];

            for (int j = 0; j < aliveEnemyList.Count; j++)
            {
                GameObject aliveEnemy = aliveEnemyList[j];

                if (aliveEnemy.GetComponent <EnemyM>().now_node.Equals(indexNode))
                {
                    aliveEnemy.GetComponent <EnemyM>().GetHit(100);
                }
            }
        }
        MyTarget.GetComponent <EnemyM>().GetHit(100);
        Skill_Switch = false;



        mSkillObj.SetActive(false);
        yield break;
    }
コード例 #4
0
    IEnumerator EnemyWizard_skill()
    {
        yield return(null);

        Debug.Log("EnemyWizard_skill / Enter");

        // 나의 타겟의 위치에 mSkillObj를 보내놓고 활성화를 시킨다.
        mSkillObj.transform.position = MyTarget.transform.position;
        mSkillObj.SetActive(true);

        // 나의 타겟
        Node EnemyNowNode = MyTarget.GetComponent <CharacterM>().now_node;

        List <GameObject> aliveCharacterList = GameMGR.Positioned_Character;

        // 타겟 주변의 노드를 가져와
        List <Node> NodeList = GridMGR.GetNeighboringNodes(EnemyNowNode);

        for (int i = 0; i < NodeList.Count; i++)
        {
            Node indexNode = NodeList[i];

            for (int j = 0; j < aliveCharacterList.Count; j++)
            {
                GameObject aliveCharacter = aliveCharacterList[j];

                if (aliveCharacter.GetComponent <CharacterM>().now_node.Equals(indexNode))
                {
                    aliveCharacter.GetComponent <CharacterM>().GetHit(100);
                }
            }
        }
        MyTarget.GetComponent <CharacterM>().GetHit(100);
        Skill_Switch = false;

        yield return(new WaitForSeconds(2f));

        mSkillObj.SetActive(false);
        yield break;
    }