示例#1
0
    public void SetHeroActionType(BattleHero.EAtionType eAtionType)
    {
        int heroNo = BattleScene.ActiveTurnHeroNo;

        if (BattleScene.GetActiveHeroTeam() == false)
        {
            heroNo = BattleScene.ActiveTargetHeroNo;
        }

        var heroCont = BattleHeroManager.Instance.GetHeroControl(heroNo);

        if (heroCont != null)
        {
            heroCont.ActionType = eAtionType;
        }

        // 원래는 상대방의 입력 정보를 알아와야되는데
        // 지금은 AI로 대체 . 랜덤으로 타입을 정해준다.
        heroNo = BattleScene.ActiveTargetHeroNo;
        if (BattleScene.GetActiveHeroTeam() == false)
        {
            heroNo = BattleScene.ActiveTurnHeroNo;
        }
        BattleScene.BattleAIManager.SetRandomActionType(heroNo);

        BattleScene.BattleStateManager.ChangeState(EBattleState.BattleState_Action);
        BattleScene.OnlyActionInput = false;
    }
示例#2
0
    void Update()
    {
        TimeElapsed += UnityEngine.Time.deltaTime;
        if (TimeElapsed >= 1f)
        {
            Time -= TimeElapsed;
            LabelTurnTimer.text = string.Format("{0:N0} Sec", Time);
            TimeElapsed        -= 1f;

            int iTime = Mathf.CeilToInt(Time);
            if (iTime == 0)
            {
                if (Type == ETurnTimeType.TURNTIME_SEL_TARGET)
                {
                    if (mBattleScene.ActiveTargetHeroNo > 0)
                    {
                        Owner.SetBattleSelActionType();
                    }
                    else
                    {
                        // turn out
                        int    place = 0;
                        byte[] data  = new byte[128];
                        System.Buffer.BlockCopy(System.BitConverter.GetBytes(true), 0, data, place, sizeof(bool));
                        mBattleScene.BattleStateManager.ChangeState(EBattleState.BattleState_Action, data);
                    }
                }
                else
                {
                    // random att type
                    if (mBattleScene.ActiveTargetHeroNo > 0)
                    {
                        BattleHero.EAtionType actionType = (BattleHero.EAtionType)Random.Range(0, (int)BattleHero.EAtionType.ACTION_MAX);
                        Owner.SetHeroActionType(actionType);
                    }
                }
            }
        }
    }