public MechState(Transform playerTransform) { playerInput = playerTransform.GetComponent <PlayerInput>(); slotInputs = playerInput.slotInputs; slots = playerInput.slots; driver = playerInput.transform.GetComponent <MechDriver>(); }
public MineState(Transform playerTransform) { playerInput = playerTransform.GetComponent <PlayerInput>(); lastKeyIndex = playerInput.lastKeyIndex; minePrefab = playerInput.slots[lastKeyIndex]; otherSlotInputs = new List <string>(playerInput.slotInputs); otherSlotInputs.RemoveAt(lastKeyIndex); otherSlots = new List <Transform>(playerInput.slots); otherSlots.RemoveAt(lastKeyIndex); mineDeployer = minePrefab.GetComponent <MineDeployer>(); driver = playerInput.transform.GetComponent <MechDriver>(); }
public RepairState(Transform playerTransform) { playerInput = playerTransform.GetComponent <PlayerInput>(); lastKeyIndex = playerInput.lastKeyIndex; otherSlotInputs = new List <string>(playerInput.slotInputs); otherSlotInputs.RemoveAt(lastKeyIndex); otherSlots = new List <Transform>(playerInput.slots); otherSlots.RemoveAt(lastKeyIndex); driver = playerInput.transform.GetComponent <MechDriver>(); hitEffectPool = GameObject.Find("MGImpactPool").GetComponent <ObjectPooler>(); }
public WeaponState(Transform playerTransform) { playerInput = playerTransform.GetComponent <PlayerInput>(); lastKeyIndex = playerInput.lastKeyIndex; weapon = playerInput.slots[lastKeyIndex]; shootInput = weapon.GetComponent <IWeapon>(); shootInput.ToggleActive(); otherSlotInputs = new List <string>(playerInput.slotInputs); otherSlotInputs.RemoveAt(lastKeyIndex); otherSlots = new List <Transform>(playerInput.slots); otherSlots.RemoveAt(lastKeyIndex); originalRotation = weapon.localRotation; driver = playerInput.transform.GetComponent <MechDriver>(); mouseInput = new SmoothMouseLook(weapon); mouseInput.SetClamping(-60, 60, -30, 30); }
void Awake() { rb = gameObject.GetComponent <Rigidbody>(); mechDriver = GetComponent <MechDriver>(); avoid = GetComponent <Avoidance>();; }