示例#1
0
    // Start is called before the first frame update
    void Start()
    {
        /*
         * if(true == _isPlayer)
         * {
         *  _characterModule = _playerModule;
         *
         *  _stateDic.Add(eState.IDLE, new PlayerIdleState());
         *  _stateDic.Add(eState.WAIT, new WaitState());
         *  _stateDic.Add(eState.KICK, new KickState());
         *  _stateDic.Add(eState.WALK, new WalkState());
         *  _stateDic.Add(eState.RUN, new RunState());
         *  _stateDic.Add(eState.SLIDE, new SlideState());
         *  _stateDic.Add(eState.PATROL, new PatrolState());
         *  _stateDic.Add(eState.DEATH, new DeathState());
         *
         * }
         * else
         * {
         *  _characterModule = _playerModule;
         * }
         */

        _characterModule = _charModuleList[(int)_charType];
        _characterModule.BuildStateList();


        for (int i = 0; i < _stateDic.Count; i++)
        {
            eState state = (eState)i;
            _stateDic[state].SetCharacter(this);
        }

        ChangeState(eState.IDLE);
    }
示例#2
0
    // Start is called before the first frame update
    void Start()
    {
        _characterModule = _charModuleList[(int)_charType];
        _characterModule.BuildStateList();

        CreateWeapon();
    }
示例#3
0
    //  private GameObject enemyObj;
    void Start()
    {
        for (int i = 0; i < 5; i++)
        {
            float  posx     = Random.Range(-4.0f, 4.0f);
            float  posz     = Random.Range(-4.0f, 4.0f);
            int    nameNum  = Random.Range(0, heroPrefab.Length);
            string heroName = heroPrefab[nameNum].name;
            //Debug.Log("name" + heroName);
            Vector3 heroPos        = new Vector3(posx, transform.position.y, posz);
            Vector3 randomRotation = new Vector3(Random.Range(0f, 360f), 0f, 0f);

            CharacterModule.CreateHero(heroName, heroPos, randomRotation);
        }

        for (int i = 0; i < 20; i++)
        {
            float   posx           = Random.Range(-7.5f, 7.5f);
            float   posz           = Random.Range(-7.5f, 7.5f);
            Vector3 enemyPos       = new Vector3(posx, transform.position.y, posz);
            Vector3 randomRotation = new Vector3(Random.Range(0f, 360f), 0f, 0f);

            CharacterModule.CreateEnemy(enemyPos, randomRotation, i);
        }


        enemyDic  = new Dictionary <float, GameObject>();
        enemyList = new List <float>();
        targetArr = GameObject.FindGameObjectsWithTag("Enemy");
        //  quickEnemy();
    }
示例#4
0
        private void MakeCharacter <T>(CharacterModule module)
            where T : CharacterModule
        {
            var controller = MakeController <CharacterController, CharacterModule>(module);

            controller.When(c => c.SetAsPlayer()).Do(c => Campaigns.Current.Player = controller);
            CampaignController.GetCharacter <T>().Returns(controller);
        }
示例#5
0
    private void RegisterAllModules()
    {
        BagUIModule bagUIModule = new BagUIModule();

        bagUIModule.Load();

        ItemModule itemModule = new ItemModule();

        itemModule.Load();

        CharacterModule charaModule = new CharacterModule();

        charaModule.Load();

        CharacterModule characterModule = new CharacterModule();
        //.....add
    }
示例#6
0
 public KhClient()
 {
     Characters = new CharacterModule();
 }