Esempio n. 1
0
        void Awake()
        {
            CharacterAnimationController characterAnimationController = GetComponentInParent <CharacterAnimationController>();
            EquipmentController          equipmentController          = GetComponentInParent <EquipmentController>();

            spriteRenderer             = GetComponent <SpriteRenderer>();
            gearSlotAnimator           = GetComponent <Animator>();
            animatorOverrideController = new AnimatorOverrideController(gearSlotAnimator.runtimeAnimatorController);

            characterAnimationController.PlayerMoving           += SetAnimationDirection;
            characterAnimationController.OnLayerChanged         += ActivateLayer;
            characterAnimationController.AttackAnimationChanged += SetAttackAnimation;
            equipmentController.OnItemEquipped += RegisterEquippedItemEvent;
        }
Esempio n. 2
0
        void Awake()
        {
            damageController             = GetComponent <DamageController>();
            weaponController             = GetComponent <WeaponController>();
            characterMovementController  = GetComponent <CharacterMovementController>();
            characterAnimationController = GetComponent <CharacterAnimationController>();

            nameText.text = characterName;
            AddBoxColliderComponent();

            if (StatPanel != null)
            {
                statPanel.SetPrimaryStats(characterStats);
                statPanel.UpdateStatValues();
            }
        }