Beispiel #1
0
    public MechState(Transform playerTransform)
    {
        playerInput = playerTransform.GetComponent <PlayerInput>();

        slotInputs = playerInput.slotInputs;
        slots      = playerInput.slots;
        driver     = playerInput.transform.GetComponent <MechDriver>();
    }
Beispiel #2
0
    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>();
    }
Beispiel #3
0
    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>();
    }
Beispiel #4
0
    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);
    }
Beispiel #5
0
 void Awake()
 {
     rb         = gameObject.GetComponent <Rigidbody>();
     mechDriver = GetComponent <MechDriver>();
     avoid      = GetComponent <Avoidance>();;
 }