Пример #1
0
    //public async Task ExecuteActionAsync()
    //{
    //    GameEntityControllRemote remote = entity.GetControllRemote();
    //    if (inAttackSight && remote.PReleaseSkill(remote.SelectedSkillID))
    //    {
    //        entity.DoReleaseSkill(remote.SelectedSkillID);
    //    }
    //    await new WaitForEndOfFrame();
    //}
    public IEnumerator ExecuteActionAsync()
    {
        GameEntityControllRemote remote = entity.GetControllRemote();

        if (inAttackSight && remote.PReleaseSkill(remote.SelectedSkillID))
        {
            entity.DoReleaseSkill(remote.SelectedSkillID);
        }
        yield return(new WaitForEndOfFrame());
    }
Пример #2
0
    private calculateResult calculateSkill(Skill skill, GameEntityControllRemote opSender, GameEntityControllRemote opTarget)
    {
        GameEntityRuntimeData senderRuntime = opSender.GetOrUpdateRuntimeData(null);
        GameEntityRuntimeData targetRuntime = opTarget.GetOrUpdateRuntimeData(null);

        return(new calculateResult()
        {
            type = resultEnum.enum1 | resultEnum.enum2, damagePart = new damageResult()
            {
                finalDamage = Mathf.CeilToInt(skill.cd * 2) * 0
            }
        });
    }
Пример #3
0
    public void QuestSkillCalculate(int skillID, GameEntityControllRemote opSender, GameEntityControllRemote opTarget)
    {
        Skill skill = GetSkillByID(skillID);

        if (skill == null)
        {
            HDebug.Error("null skill " + skill);
            return;
        }
        opSender.DoReleaseSkill(skill);
        calculateResult result = calculateSkill(skill, opSender, opTarget);

        if ((result.type & resultEnum.enum1) == resultEnum.enum1)
        {
            opTarget.CaughtDamage(result.damagePart.finalDamage, DamageTypeEnum.ColdWeapon);
        }
        if ((result.type & resultEnum.enum2) == resultEnum.enum2)
        {
        }
    }
Пример #4
0
    IEnumerator Start()
    {
        m_Transform  = this.transform;
        m_GameObject = this.gameObject;
        yield return(null);

        mapController = GameCore.GetRegistServices <MapController>();
        currentCell   = mapController.GetRandomCell().Point;
        var mapSize = mapController.GetMapSize();

        //this.transform.position = HexCoords.GetHexVisualCoords(currentCell, mapSize);
        this.transform.position = Coords.PointToVisualPosition(currentCell);

        //设定职业
        applyZhiye();

        player_LogicSwitchA      = playerUpdate();
        playerAndAI_LogicSwitchB = actionRemote.AutoUpdate();

        //设定模型外观
        int index = GameEntityMgr.Instance.GetAllEntities().IndexOf(this);

        entityVisual = new GameEntityVisual(this.transform.Find("Model").gameObject, ModelID, index);


        if (controllType == EntityType.Player)
        {
            PlayerEntitiyControll player = new PlayerEntitiyControll();
            player.SetEntityID(entityID);
            controllRemote = player;
            runtimeData    = controllRemote.GetOrUpdateRuntimeData(this);

            runtimeSwitcher = player_LogicSwitchA;
            //StartCoroutine(updateContainer());
            //Observable.FromCoroutine(updateContainer).Subscribe();
            //MainThreadDispatcher.StartCoroutine(updateContainer());
        }
        else if (controllType == EntityType.AI)
        {
            entityVisual.ChangeHPColor(Color.cyan);
            AIEntitiyControll ai = new AIEntitiyControll();
            ai.SetEntityID(entityID);
            controllRemote  = ai;
            runtimeData     = controllRemote.GetOrUpdateRuntimeData(this);
            runtimeSwitcher = playerAndAI_LogicSwitchB;
            //StartCoroutine(updateContainer());
            //Observable.FromCoroutine(updateContainer).Subscribe();
            //MainThreadDispatcher.StartCoroutine(updateContainer());
        }
        else if (controllType == EntityType.PlayerSummon)
        {
            entityVisual.ChangeHPColor(Color.yellow);
            AIEntitiyControll ai = new AIEntitiyControll();
            ai.SetEntityID(entityID);
            controllRemote  = ai;
            runtimeData     = controllRemote.GetOrUpdateRuntimeData(this);
            runtimeSwitcher = playerAndAI_LogicSwitchB;
            //StartCoroutine(updateContainer());
            //Observable.FromCoroutine(updateContainer).Subscribe();
        }



        GameTimer.AwaitLoopSecondsBaseOnCore(1, controllRemote.CalledEverySeconds);

        calculateRangeOnEnterPoint();


        initUniRxPrograming();
        //if (controllType == EntityControllType.AI)
        //{
        //    onReachDst += async () =>
        //    {
        //        await new WaitForSeconds(1);
        //        randomMove();
        //    };
        //    randomMove();
        //}
    }