Example #1
0
    public void DropEvent()
    {
        Debug.Log("주사위 드랍");


        // 주사위를 쥐고있지 않을 경우 스킵한다
        if (bcm.GetDragDice() != null)
        {
            bcm.SetDragDice(null);

            // 드랍된 위치 체크. 전투슬롯의 위치인가?
            List <RaycastResult> results = new List <RaycastResult>();
            PointerEventData     ped     = new PointerEventData(null);
            ped.position = Input.mousePosition;

            graphicRaycaster.Raycast(ped, results);

            for (int i = 0; i < results.Count; i++)
            {
                BattleSlot bs = results[i].gameObject.GetComponent <BattleSlot>();
                if (bs)
                {
                    // 적쪽에 못올라가도록
                    if (bs.transform.parent.name == "EnemyZone")
                    {
                        break;
                    }

                    bcm.ResetDiceSlot();

                    // 전투 슬롯에 주사위 설정
                    bs.SetDice(this);

                    isOnBattleSlot = true;


                    // 타겟팅 시스템 설정
                    TargettingManager tm = FindObjectOfType <TargettingManager>();
                    if (tm)
                    {
                        bs.GetCurrentCommand().SetCaster(bs.gameObject);
                        tm.CreateTargetWindow(bs.GetCurrentCommand());
                    }



                    return;
                }
            }
        }

        //transform.position = defPos;
        bcm.ResetDiceSlot();
        bcm.SetDiceZone(this); // 주사위 존으로 되돌린다
        bcm.SetDragDice(null);
        isOnBattleSlot = false;
    }
Example #2
0
    /// <summary>
    /// 타게팅 배열이 비어있는지 확인, 리턴한다.
    /// </summary>
    public bool IsTargettingClear()
    {
        for (int i = 0; i < players.Length; i++)
        {
            TargettingManager tg = players [i].GetComponent <TargettingManager> ();
            if (!tg.IsEmpty())
            {
                return(false);
            }
        }

        return(true);
    }
Example #3
0
    // 참조 필요한 객체 참조(Called by Start())
    void InitailizeRefernce()
    {
        StatManager tempStatManager = GetComponent<StatManager>();
        _moveSpeed = tempStatManager.CurrentStats[INDEX_MOVE_SPEED];
        _rotationSpeed = tempStatManager.CurrentStats[INDEX_ROTATION_SPEED];

        targets = GetComponent<TargettingManager>();
        target = targets.selectedTarget;
        // 타겟 배열이 존재 할 시 0번 타겟 선택
/*
        if (targets != null)
            target = targets[0];
*/
    }
Example #4
0
    //참조 초기화
    private void InitializeReference()
    {
        StatManager tempStat = GetComponent <StatManager>();

        _moveSpeed     = tempStat.CurrentStats[INDEX_MOVE_SPEED];
        _rotationSpeed = tempStat.CurrentStats[INDEX_ROTATION_SPEED];
        _attackRange   = tempStat.CurrentStats[INDEX_ATTACK_RANGE];

        targetManager = GetComponent <TargettingManager>();
        navMeshAgent  = GetComponent <NavMeshAgent>();

        characterController = GetComponent <CharacterController>();

        isMoveState = false;
    }
Example #5
0
    void Start()
    {
        //필요 스텟참조
        StatManager _statManager = GetComponent <StatManager>();

        _attackDamage = _statManager.CurrentStats[_attackDamageIndex];
        _attackSpeed  = _statManager.CurrentStats[_attackSpeedIndex];
        _attackRange  = _statManager.CurrentStats[_attackRangeIndex];

        _targetManager = GetComponent <TargettingManager>();

        ATTACK_BLOCK = false;

        _coolDown = 0f;
    }
Example #6
0
    //참조초기화
    public void InitializeReference()
    {
        TargetList  = GetComponent <TargettingManager>();
        MoveManager = GetComponent <MovementManager>();
        stats       = GetComponent <StatManager>();

        // 선택된 타겟을 참조
        CurrentTarget = TargetList.selectedTarget;

        //초기화-참조가 되었는지 플래그설정
        if (TargetList != null && MoveManager != null)
        {
            isInitialized = true;
        }
    }
Example #7
0
    // Use this for initialization
    void Start()
    {
        //?봔€筌뤴몿而쇽㎗???GameObject'??'???癒?퐣 TargettingManager 筌〓챷??
        targettingManager = GetComponentInParent <TargettingManager>();
        TargetLayer       = new LayerMask();

        if (this.transform.parent.tag == "Player")
        {
            TargetLayer = LayerMask.NameToLayer("Minion");
            EnemyTag    = "Enemy";
        }
        else if (this.transform.parent.tag == "Enemy")
        {
            TargetLayer = LayerMask.NameToLayer("Hero");
            EnemyTag    = "Ally";
        }
    }
Example #8
0
    // 파라메터로 받은 라운드의 웨이브 생성
    public void GenerateWave(int waveNumber)
    {
        Wave wave = waveList[waveNumber];
        Debug.Log(wave.Debug());

        if (wave != null && wave.IsNext()){
            // 프리팹 생성을 위한 값 할당
            WaveMember member = wave.GetWaveMemberByCounter();

            if (member.IsNext()){
                // 맴버 이름으로 prefabList에서 게임오브젝트(프리팹)을 받아온다
                GameObject gameObject = prefabList.GetGameObjectByName (member.name);
                Quaternion angle = new Quaternion(0, 0, 0, 0);

                //프리팹 생성 & 이름 설정
                prefab = Instantiate(gameObject, member.location, angle) as GameObject;
                prefab.name = prefab.name + (member.counter + 1);

                // 맴버의 카운터 증가.
                member.IncreaseCounter();

                //타겟팅에 추가하기 위한 타겟정보
                GameObject enemy = prefab;

                // 모든 플레이어의 Targetting 컴포넌트에 생성된 오브젝트 추가 및 정렬
                for(int i=0; i<playerList.Count; i++){
                    TargettingManager tg = playerList[i].GetComponent<TargettingManager>();
                    tg.AddTarget(enemy);
                    tg.SortTargetByDistance();

                    //if (i == 0)
                        //tg.TargetEnemy();
                }

                // 맴버 생성이 모두 완료되면, 웨이브 카운트 증가
                if (!member.IsNext())
                    wave.IncreaseCount();

                prefab = null;
                // 생성 타이머를 0f로 초기화
                timeCounter = 0f;
            }
        }
    }
Example #9
0
    void Start()
    {
        //buttonComp = GetComponent<Button>();
        highlightObj = transform.Find("Highlight").gameObject;
        //buttonComp.enabled = false;

        hpBar       = GetComponentInChildren <Slider>();
        hpBar.value = battleUnit.curHp / battleUnit.maxHp;

        bcm = FindObjectOfType <BattleSceneManager>();

        diceSlot = transform.Find("DiceSlot");

        if (battleUnit.animPath != null)
        {
            animator.runtimeAnimatorController =
                Resources.Load <RuntimeAnimatorController>(battleUnit.animPath);
        }
        tm = FindObjectOfType <TargettingManager>();
    }