void Start() { // Sets our AudioPlayer to the RigController ClawAudioPlayer = this.GetComponentInChildren <ClawAudioPlayer>(); // Sets our ClawRayCaster to the RigController ClawRayCaster = this.GetComponentInChildren <ClawRayCaster>(); // Sets our Claw to the RigController Claw = this.GetComponentInChildren <Claw>(); input = new ClawRigControlMap(); //Moving the horizontal railing so that it is directly over the claw hRail.position = new Vector3(hRail.position.x, hRail.position.y, Claw.transform.position.z); //Moving the vertical railing so that it is directly over the claw vRail.position = new Vector3(Claw.transform.position.x, vRail.position.y, vRail.position.z); // initializing our claw rig states with a refrence to this. rigIsOff = new ClawStatePowerOff(this); rigIsEmpty = new ClawStateNotHoldingBox(this); rigIsHoldingBox = new ClawStateHoldingBox(this); clawLowering = new ClawLowering(this); clawLifting = new ClawLifting(this); // setting the initial state to off. currentClawRigState = rigIsOff; }
// Returns our various claw states so it can switch states. public void SetClawState(IClawRigControllerStates newClawRigState) { currentClawRigState = newClawRigState; }