Пример #1
0
        void Awake()
        {
            eventPlayer = GetComponent <EventPlayer>();
            eventPlayer.AddParameters(new CustomParameter[] {
                new CustomParameter("Agitated", false),
            });

            ragdollController = GetComponent <RagdollController>();



            movement = GetComponent <MovementController>();
            turner   = GetComponent <Turner>();
            //jumper = GetComponent<Jumper>();
            platformer = GetComponent <Platformer>();
            combat     = GetComponent <CharacterCombat>();

            charAnimationMover = GetComponent <CharacterAnimatorMover>();
            characterMovement  = GetComponent <CharacterMovement>();

            turner.doAutoTurn = true;
            cam = Camera.main;

            combat.SetAimTargetCallback(() => cam.transform.position + cam.transform.forward * 500);

            turner.SetTurnTargetCallback(() => CalculateFaceDir());
        }
Пример #2
0
        protected override void Awake()
        {
            base.Awake();

            aiAgent = GetComponent <AIAgent>();

            waypointTracker = GetComponent <WaypointTracker>();

            platformer = GetComponent <Platformer>();
            platformer.onPlatformEnd += OnPlatformEnd;

            agent = GetComponentInChildren <NavMeshAgent>();
            agent.updateRotation = false;
            agent.updatePosition = false;

            turner = GetComponent <Turner>();

            animationMover = GetComponent <CharacterAnimatorMover>();
            animationMover.SetMoveModifier(ModifyCharacterMovement);
        }