void Awake() { Animator = GetComponent <Player3DAnimator>(); playerColorAssigner = GetComponent <PlayerColorAssigner>(); modelParts = GetComponent <PlayerModelPartSwapper>(); cameraController = GetComponent <Player3rdPersonCamera>(); //Cache the scales faceRightScale = transform.localScale; faceLeftScale = faceRightScale; faceLeftScale.x *= -1f; }
void Awake() { //Reference Rb = GetComponent <Rigidbody>(); Raycaster = GetComponent <MotorRaycaster>(); feedback = GetComponentInChildren <PlayerFeedbacks>(); cameraController = GetComponent <Player3rdPersonCamera>(); //Initialize Instance = this; status = new PlayerControllerStatus(); stateClassLookup = new Dictionary <MotorStates, MotorStateBase> { { MotorStates.OnGround, new MotorState_MoveOnGround(this, feedback) }, { MotorStates.Aerial, new MotorState_Aerial(this, feedback) }, { MotorStates.Dead, new MotorState_Dead(this, feedback) }, //{MotorStates.Hurt, new MotorState_Hurt(this, Feedbacks)}, }; currentStateType = MotorStates.OnGround; currentStateClass = stateClassLookup[currentStateType]; }