void Start() { animator = GetComponent<Animator>(); actions = GetComponent<Actions>(); fraction = AIFraction.Friend; base.OnStartEnemyBehaviorAI(animator,null); }
public void setUp(Actions actions, MouseLook mouseLook, FOVKick fovKick, CurveControlledBob headBob, LerpControlledBob jumpBob, AttackController attackController) { this.actions=actions; this.mouseLook=mouseLook; this.headBob=headBob; this.jumpBob=jumpBob; this.attackController=attackController; this.mainCameraObject = SingletonNames.getMainCamera(); this.playerObject = SingletonNames.getPlayer(); //this.audioSource = playerObject.gameObject.AddComponent<AudioSource>(); //this.audioData = playerObject.GetComponent<MovementAudioData>(); this.characterController = playerObject.GetComponent<CharacterController>(); originalCameraPosition = mainCameraObject.transform.localPosition; }
public void setUp(Actions actions, MouseLook mouseLook, FOVKick fovKick, CurveControlledBob headBob, LerpControlledBob jumpBob, AttackController attackController) { this.actions=actions; this.mouseLook=mouseLook; this.fovKick=fovKick; this.headBob=headBob; this.jumpBob=jumpBob; this.attackController=attackController; this.mainCameraObject = SingletonNames.getMainCamera(); this.playerObject = SingletonNames.getPlayer(); this.audioSource = playerObject.gameObject.AddComponent<AudioSource>(); this.audioData = playerObject.GetComponent<MovementAudioData>(); this.characterController = playerObject.GetComponent<CharacterController>(); objectsSelector = mainCameraObject.GetComponent<ObjectsSelector>(); originalCameraPosition = mainCameraObject.transform.localPosition; fovKick.Setup(mainCameraObject); headBob.Setup(mainCameraObject, stepInterval); mouseLook.Init(playerObject.transform, mainCameraObject.transform); stepCycle = 0f; nextStep = stepCycle / 2f; isJumping = false; }
void Start() { actions = playerHands.GetComponent<Actions>(); movementType = EMovementType.inground; // инициализируем контроллеры движения ingroundMovement = gameObject.GetComponent<IngroundMovements>(); if (ingroundMovement==null) ingroundMovement = gameObject.AddComponent<IngroundMovements>(); ingroundMovement.setUp(actions, mouseLook, fovKick, headBob, jumpBob, attackController); underwaterMovement = gameObject.GetComponent<UnderwaterMovements>(); if (underwaterMovement == null) underwaterMovement = gameObject.AddComponent<UnderwaterMovements>(); underwaterMovement.setUp(actions, mouseLook, fovKick, headBob, jumpBob, attackController); inwaterMovement = gameObject.GetComponent<InwaterMovements>(); if (inwaterMovement == null) inwaterMovement = gameObject.AddComponent<InwaterMovements>(); inwaterMovement.setUp(actions, mouseLook, fovKick, headBob, jumpBob, attackController); currentMovement = ingroundMovement; }