Esempio n. 1
0
 public SteeringPipeline(KinematicData character)
 {
     this.Target           = new KinematicData();
     this.Character        = character;
     this.DeadlockMovement = new DynamicWander
     {
         Character       = this.Character,
         MaxAcceleration = 10.0f
     };
     this.Targeters   = new List <Targeter>();
     this.Decomposers = new List <Decomposer>();
     this.Constraints = new List <Constraint>();
 }
Esempio n. 2
0
    public void SetReferenceVars()
    {
        PlayerReference pRef = GeneralVariables.playerRef;

        if (pRef != null)
        {
            pe  = pRef.GetComponent <PlayerEffects>();
            wm  = pRef.wm;
            dm  = pRef.dm;
            pm  = pRef.GetComponent <PlayerMovement>();
            ac  = pRef.ac;
            acs = pRef.acs;
        }
    }
Esempio n. 3
0
    void Start()
    {
        tr = transform;

        PlayerReference pr = GeneralVariables.playerRef;

        dm = pr.dm;
        wm = pr.wm;
        ac = pr.ac;
        cb = pr.cb;

        mainCamTr    = GeneralVariables.mainPlayerCamera.transform;
        useLabel     = GeneralVariables.uiController.useGUI;
        useKeyString = cInput.GetText("Use", 1);
    }
Esempio n. 4
0
    void Awake()
    {
        tr    = transform;
        acoTr = antiClipObj.transform;

        PlayerReference pr = GeneralVariables.playerRef;

        wm = pr.wm;
        pm = pr.GetComponent <PlayerMovement>();
        dm = pr.dm;
        ac = pr.ac;

        switchRotX = dm.drawRot.x;
        switchRotY = -dm.drawRot.y;
        switchRotZ = dm.drawRot.z;
    }
Esempio n. 5
0
    public void InitializeVariables()
    {
        PlayerReference pr = GeneralVariables.playerRef;

        if (pr != null)
        {
            pm = pr.GetComponent <PlayerMovement>();
            pl = pr.GetComponent <PlayerLook>();
            dm = pr.dm;
            ia = pr.ia;
            ac = pr.ac;
            cb = pr.cb;

            initialized = true;
        }
    }
Esempio n. 6
0
    public void InitializeVariables()
    {
        PlayerReference pr = GeneralVariables.playerRef;

        if (pr != null)
        {
            dm = pr.dm;
            ac = pr.ac;
        }
        else
        {
            this.enabled = false;
            return;
        }

        defaultPos = reflexDot.localPosition;
    }
Esempio n. 7
0
    public void RunStart()
    {
        if (mpReferenceOnly)
        {
            return;
        }

        PlayerReference pr = GeneralVariables.playerRef;

        pl  = pr.GetComponent <PlayerLook>();
        pm  = pr.GetComponent <PlayerMovement>();
        wm  = pr.wm;
        dm  = pr.dm;
        ac  = pr.ac;
        acs = pr.acs;
        tss = firePos.GetComponent <TimeScaleSound>();

        UIController uiController = GeneralVariables.uiController;

        curAmmoDisplay  = uiController.curAmmoDisplay;
        ammoLeftDisplay = uiController.ammoLeftDisplay;
        ammoBar         = uiController.ammoBar;
        crosshair       = uiController.crosshairs;

        if (muzzleLight != null)
        {
            muzzleBrightness = muzzleLight.intensity;
        }

        initializeTime = Time.time;
        PoolManager.Instance.Initialize();
        gunVisuals       = GetComponent <GunVisuals>();
        shootImpulseGUI  = 1f;
        reloadImpulseGUI = 1f;

        pa       = GetComponent <PistolAnim>();
        maxIndex = 2;
        SwitchFiringMethod();
        flashlightOn  = false;
        startCounting = false;
        fireCount     = 0;
        asm           = 1f;
        spreadReal    = baseSpreadAmount;
        bsna          = baseSpreadAmount;
    }
Esempio n. 8
0
    void Start()
    {
        GeneralVariables.player = gameObject;
        GeneralVariables.uiController.guiCamera.enabled = true;
        tr             = transform;
        controller     = GetComponent <CharacterController>();
        tss            = footsteps.footstepPos.GetComponent <TimeScaleSound>();
        playerMeshAnim = animations.playerMesh.GetComponent <Animation>();

        UIController uic = GeneralVariables.uiController;

        fadeSprite = uic.fadeFromBlack;
        uic.guiCamera.GetComponent <GUISway>().InitializeVariables();

        PlayerReference pr = GetComponent <PlayerReference>();

        pv = GetComponent <PlayerVitals>();
        pl = GetComponent <PlayerLook>();
        ia = pr.ia;
        wc = pr.wc;
        ac = pr.ac;
        wm = pr.wm;
        dm = pr.dm;

        defaultHeight  = controller.height;
        defaultHeadPos = head.localPosition;
        defaultLegPos  = animations.playerMesh.transform.localPosition + (Vector3.down * animations.meshOffset);
        normalLimit    = Mathf.Cos(controller.slopeLimit * Mathf.Deg2Rad);
        curSpeed       = movement.runSpeed;
        jumpTime       = -0.25f;
        impactMod      = 1f;
        fDmgSpeedMult  = 1f;

        AntiHackSystem.ProtectFloat("runSpeed", movement.runSpeed);
        AntiHackSystem.ProtectFloat("sprintSpeed", movement.sprintSpeed);
        AntiHackSystem.ProtectFloat("crouchSpeed", movement.crouchSpeed);
        AntiHackSystem.ProtectFloat("walkSpeed", movement.walkSpeed);
        AntiHackSystem.ProtectFloat("jumpHeight", movement.jumpHeight);

        grounded = false;
        movement.crouchDetection.gameObject.SetActive(false);
        AudioSource.PlayClipAtPoint(initializeSound, footsteps.footstepPos.transform.position, 0.12f);
        StartCoroutine(FadeFromBlack());
    }
Esempio n. 9
0
    void Start()
    {
        camTr        = GeneralVariables.mainPlayerCamera.transform;
        isMeleeState = false;

        PlayerReference pr = GeneralVariables.playerRef;

        dm  = pr.dm;
        acs = pr.acs;
        wm  = pr.wm;

        UIController uic = GeneralVariables.uiController;

        nameLabel     = uic.weaponName;
        ammoBar       = uic.ammoBar;
        curAmmoLabel  = uic.curAmmoDisplay;
        ammoLeftLabel = uic.ammoLeftDisplay;

        friendlyFire = NetworkingGeneral.friendlyFire;
    }
Esempio n. 10
0
    void Start()
    {
        PlayerReference pRef = GeneralVariables.playerRef;

        pm   = GeneralVariables.player.GetComponent <PlayerMovement>();
        wm   = pRef.wm;
        dm   = pRef.dm;
        pl   = pm.GetComponent <PlayerLook>();
        pv   = pm.GetComponent <PlayerVitals>();
        vc   = GetComponent <VignettingC>();
        wdof = GetComponent <WeaponDepthOfField>();
        cb   = pRef.cb;
        acs  = pRef.acs;
        ia   = pRef.ia;

        GetComponent <Camera>().fieldOfView = (float)GameSettings.settingsController.FOV;

        cachedTr.localPosition = Vector3.zero;
        lastUnAim = -0.25f;
        lastAim   = -0.25f;
        lastShake = -100f;
    }
Esempio n. 11
0
    public void Initialize()
    {
        if (nadeList != null)
        {
            GrenadeDatabase.savedGrenadeList = nadeList;
        }

        PlayerReference playerRef = GeneralVariables.playerRef;

        wm  = playerRef.wm;
        dm  = playerRef.dm;
        gam = playerRef.gam;

        grenadeInventory[0] = AddGrenadeToInventory(gam.grenadeTypeOne);
        grenadeInventory[1] = AddGrenadeToInventory(gam.grenadeTypeTwo);

        CheckGrenades();

        curGrenade = availableGrenades[0];
        curGrenade.OnSelect();
        canSwitch = true;
        gameObject.SetActive(false);
    }
Esempio n. 12
0
 public MovementWithWeight(DynamicMovement.DynamicMovement movement, float weight)
 {
     this.Movement = movement;
     this.Weight = weight;
 }
Esempio n. 13
0
 public MovementWithWeight(DynamicMovement.DynamicMovement movement)
 {
     this.Movement = movement;
     this.Weight = 1.0f;
 }
Esempio n. 14
0
    void Start()
    {
        player = GeneralVariables.player;
        dm     = GetComponent <DynamicMovement>();
        pm     = player.GetComponent <PlayerMovement>();
        pv     = player.GetComponent <PlayerVitals>();
        pl     = player.GetComponent <PlayerLook>();
        pe     = player.GetComponent <PlayerEffects>();
        gam    = GeneralVariables.playerRef.gam;
        ac     = GeneralVariables.playerRef.ac;
        acs    = GeneralVariables.playerRef.acs;

        UIController uiController = GeneralVariables.uiController;

        curAmmoDisplay        = uiController.curAmmoDisplay;
        ammoLeftDisplay       = uiController.ammoLeftDisplay;
        weaponName            = uiController.weaponName;
        weaponIcon            = uiController.weaponIcon;
        weaponSlot            = uiController.weaponSlot;
        ammoBar               = uiController.ammoBar;
        muzGlow               = uiController.muzzleHelmetGlow;
        fireModeDisplay       = uiController.fireModeLabel;
        reloadIndImpulse      = uiController.reloadIndicatorLabel.GetComponent <ImpulseGUI>();
        grenadeSelection      = uiController.grenadeSelectionSprite;
        grenadeSelectionLabel = uiController.grenadeSelectionLabel;
        defaultIconPos        = new Vector3(-172f, 14f, 2f);

        grenadeSelectionLabel.alpha = 0.2f;
        grenadeSelection.transform.localPosition = new Vector3(-35f, 83f, 0f);

        grenadeManager.gameObject.SetActive(true);
        grenadeManager.Initialize();
        queuedAmmo    = -1;
        queuedReserve = -1;
        queuedChamber = false;
        curWeaponNum  = -1;

        if (mpSpawnStartPrimary > -1)
        {
            AddWeapon(mpSpawnStartPrimary, false);
            mpSpawnStartPrimary = -1;
        }
        else if (startingPrimary > -1)
        {
            AddWeapon(startingPrimary, false);
        }

        if (mpSpawnStartSecondary > -1)
        {
            AddWeapon(mpSpawnStartSecondary, false);
            mpSpawnStartSecondary = -1;
        }
        else if (startingSecondary > -1)
        {
            AddWeapon(startingSecondary, false);
        }

        if (Topan.Network.isConnected)
        {
            StartCoroutine(WaitForNetworkInit());
        }
        else
        {
            FindWeaponToUse(true, 0);
        }

        dca             = 0f;
        dal             = 0f;
        displayCurAmmo  = 0;
        displayAmmoLeft = 0;
        friendlyFire    = NetworkingGeneral.friendlyFire;
        initTime        = Time.time;
    }