Пример #1
0
        public void Init(CharacterData data)
        {
            characterData = data;
            data.Init();
            //data.equipments.ObserveCountChanged().Subscribe(_ => UpdateStats(0)).AddTo(this);
            //data.weapons.ObserveCountChanged().Subscribe(_ => UpdateStats(1)).AddTo(this);
            skillWheel = data.skills;

            UpdateStats();
            GetComponentInChildren <CharacterVfx>().Init();
        }
Пример #2
0
        //public void Init(ExpeditionMenu.Monster monster)
        //{//CharacterData data) {
        //    characterData = data;
        //    data.Init();
        //    data.armors.ObserveCountChanged().Subscribe(_ => UpdateStats(0)).AddTo(this);
        //    data.weapons.ObserveCountChanged().Subscribe(_ => UpdateStats(1)).AddTo(this);
        //    skillWheel = data.skills;

        //    characterData = monster.Character;
        //    characterData.Init();
        //    characterData.armors.ObserveCountChanged().Subscribe(_ => UpdateStats(0)).AddTo(this);
        //    characterData.weapons.ObserveCountChanged().Subscribe(_ => UpdateStats(1)).AddTo(this);

        //    Skills.Skill[] temp = new Skills.Skill[4];

        //    for (int j = 0; j < monster.SkillWheel.Length; j++)
        //        temp[j] = characterData.skills[monster.SkillWheel[j]];
        //    skillWheel = temp;

        //    UpdateStats(0);
        //    GetComponentInChildren<CharacterVfx>().Init();
        //}

        //public void Init(Client client){//CharacterData data) {
        //    characterData = data;
        //    data.Init();
        //    data.armors.ObserveCountChanged().Subscribe(_ => UpdateStats(0)).AddTo(this);
        //    data.weapons.ObserveCountChanged().Subscribe(_ => UpdateStats(1)).AddTo(this);
        //    skillWheel = data.skills;

        //    characterData = client.Character;
        //    characterData.Init();
        //    characterData.armors.ObserveCountChanged().Subscribe(_ => UpdateStats(0)).AddTo(this);
        //    characterData.weapons.ObserveCountChanged().Subscribe(_ => UpdateStats(1)).AddTo(this);

        //    Skills.Skill[] temp = new Skills.Skill[4];

        //    for (int j = 0; j < client.SkillWheel.Length; j++)
        //        temp[j] = characterData.skills[client.SkillWheel[j]];
        //    skillWheel = temp;

        //    UpdateStats(0);
        //    GetComponentInChildren<CharacterVfx>().Init();
        //}

        public void Init(CharacterData data, int[] intSkillWheel)
        {
            characterData = data;
            characterData.Init();
            characterData.armors.ObserveCountChanged().Subscribe(_ => UpdateStats(0)).AddTo(this);
            characterData.weapons.ObserveCountChanged().Subscribe(_ => UpdateStats(1)).AddTo(this);

            Skill[] temp = new Skill[4];

            for (int j = 0; j < intSkillWheel.Length; j++)
            {
                temp[j] = characterData.skills[intSkillWheel[j]];
            }
            skillWheel = temp;

            UpdateStats(0);
            GetComponentInChildren <CharacterVfx>().Init();
        }
Пример #3
0
        public async Task Init(CharacterData data, int[] intSkillWheel)
        {
            characterData = data;
            characterData.Init();
            //characterData.armors.ObserveCountChanged().Subscribe(_ => UpdateStats(0)).AddTo(this);
            //characterData.weapons.ObserveCountChanged().Subscribe(_ => UpdateStats(1)).AddTo(this);

            Skill[] temp = new Skill[5];

            for (int j = 0; j < intSkillWheel.Length; j++)
            {
                temp[j] = characterData.skills[intSkillWheel[j]];
            }
            skillWheel = temp;

            currentStats.Init();
            UpdateStats();

/*
 *          if(team == Team.PlayerTeam)
 *              currentStats.hp = new ReactiveProperty<float>(GameManager.curentHPClients[clientNumber]);
 *          else
 *              currentStats.hp = new ReactiveProperty<float>(currentStats.maxHp);
 */         //develop-nico stuff

            slotAction    = new Subject <SlotAction>();
            statusEffects = new ReactiveCollection <StatusEffect>();
            effectTypes   = new ReactiveProperty <EffectType>(EffectType.None);
            skillSlot     = skillWheel.ToList();

            //animator
            _combatManager = CombatManager.Instance;
            _animator      = GetComponentInChildren <Animator>();
            AnimatorOverrideController myOverrideController = await Utils.LoadResource <AnimatorOverrideController>(characterData.animatorController);

            _animator.runtimeAnimatorController = myOverrideController;
        }