Esempio n. 1
0
        public void Set(int characterId, Player target)
        {
            var spineResourcePath = $"Character/Monster/{characterId}";

            if (!(Animator.Target is null))
            {
                var animatorTargetName = spineResourcePath.Split('/').Last();
                if (Animator.Target.name.Contains(animatorTargetName))
                {
                    return;
                }

                Animator.DestroyTarget();
            }

            var origin = Resources.Load <GameObject>(spineResourcePath);
            var go     = Instantiate(origin, gameObject.transform);

            SpineController = go.GetComponent <CharacterSpineController>();
            Animator.ResetTarget(go);
            if (characterId == 205007)
            {
                Animator.Standing();
            }
            else
            {
                Animator.Idle();
            }
            _target = target;
        }
Esempio n. 2
0
        private void UpdateArmor()
        {
            var armorId           = CharacterModel?.RowData.Id ?? DefaultCharacter;
            var spineResourcePath = $"Character/Monster/{armorId}";

            if (!(Animator.Target is null))
            {
                var animatorTargetName = spineResourcePath.Split('/').Last();
                if (Animator.Target.name.Contains(animatorTargetName))
                {
                    return;
                }

                Animator.DestroyTarget();
            }

            var origin = Resources.Load <GameObject>(spineResourcePath);
            var go     = Instantiate(origin, gameObject.transform);

            SpineController = go.GetComponent <CharacterSpineController>();
            Animator.ResetTarget(go);
            UpdateHitPoint();
        }