private void PoisonBurnFreeze(GameObject enemy)
    {
        PlayerStateScript state = new PlayerStateScript();

        state.SetState(3, damage, elementIndex, enemy);
        enemy.GetComponent <PlayerScript>().States.Add(state);
    }
 void Awake()
 {
     rbMovementScript = GetComponentInParent <RigidbodyCharacterMovement>();
     playerState      = GetComponentInChildren <PlayerStateScript>();
     if (Cursor.lockState != CursorLockMode.Locked)
     {
         Cursor.lockState = CursorLockMode.Locked;
     }
 }
示例#3
0
 // Start is called before the first frame update
 void Start()
 {
     playerState       = FindObjectOfType <PlayerStateScript>();
     AIController      = GetComponentInChildren <AIControllerBase>();
     enemyUIController = GetComponentInChildren <EnemyUIController>();
     playerNavPoint    = FindObjectOfType <Player>().gameObject.GetComponentInChildren <NavPoint>();
     AI_Weapon         = GetComponentInChildren <EnemyWeapon>().gameObject;
     myWeapon          = AI_Weapon.GetComponent <EnemyWeapon>();
     damageEvent.AddListener(OnEnemyDamageApplied);
 }
示例#4
0
 void Awake()
 {
     GetPlayerUI    = FindObjectOfType <PlayerUIController>();
     GetPlayerState = GetComponentInChildren <PlayerStateScript>();
     pcStats        = GetComponent <CharacterStats>();
     styleIndex     = 1;
     //pcStats.currentCharacterStyle = CharacterStats.ECharacterStyle.Offense;
     player = GetComponent <Player>();
     //healthText = FindObjectOfType<HealthTextScript>();
 }
示例#5
0
    // Start is called before the first frame update
    void Start()
    {
        bShouldDestroyOnDeath = false;
        pCon         = GetComponentInChildren <InputSystem_PlayerController>();
        playerState  = GetComponentInChildren <PlayerStateScript>();
        playerSource = GetComponent <AudioSource>();
        PlayerStats  = GetComponent <PlayerStatsScript>();

        PlayerStats.UpdateHealthText();
        playerUI = FindObjectOfType <ID_PlayerUI>().gameObject;
    }
示例#6
0
 private void Update()
 {
     if (!playerState)
     {
         playerState = FindObjectOfType <PlayerStateScript>();
     }
     if (AIController.bIsPlayerVisible)
     {
         //Attempt to attack
         if (AI_Weapon)
         {
             AI_Weapon.GetComponent <EnemyWeapon>().AIFire();
         }
     }
     else
     {
         if (AIController.myNavAgent.myNavPoints.Contains(playerNavPoint))
         {
             AIController.myNavAgent.myNavPoints.Remove(playerNavPoint);
         }
     }
 }
 void Awake()
 {
     playerState    = FindObjectOfType <PlayerStateScript>();
     someListener   = new UnityAction(SomeFunction);
     DamageListener = new UnityAction(AIDamageFunction);
 }
    void EnableGameControls()
    {
        if (!playerStats)
        {
            playerStats = GetComponentInParent <PlayerStatsScript>();
        }
        if (!playerState)
        {
            playerState = GetComponentInChildren <PlayerStateScript>();
        }

        if (!rbMovement)
        {
            rbMovement = GetComponentInParent <InputSystem_RigidbodyCharacterMovement>();
        }
        if (!cameraLook)
        {
            cameraLook = GetComponentInChildren <InputSystem_CameraLook>();
        }
        if (!combatController)
        {
            combatController = GetComponent <InputSystem_PlayerCombatController>();
        }

        if (myControls == null)
        {
            myControls = new GameInputControls();
        }

        //if(myControls.gameplay.)
        bEnableGameInput = true;
        myControls.gameplay.Pause.performed             += OnGamePause;
        myControls.gameplay.Interact.performed          += OnInteractEvent;
        myControls.gameplay.CharacterMenu.performed     += OnCharMenu;
        myControls.gameplay.MoveRight.performed         += rbMovement.OnMoveRight;
        myControls.gameplay.MoveUp.performed            += rbMovement.OnMoveUp;
        myControls.gameplay.Sprint.performed            += rbMovement.OnSprint;
        myControls.gameplay.Jump.performed              += rbMovement.OnJump;
        myControls.gameplay.Fire.performed              += combatController.OnFire;
        myControls.gameplay.AltFire.performed           += cameraLook.OnLockOn;
        myControls.gameplay.AltFire.canceled            += cameraLook.OnLockOnStop;
        myControls.gameplay.SpecialAbility.performed    += rbMovement.OnSpecialAbility;
        myControls.gameplay.StyleSwitchUp.performed     += combatController.OnStyleSwitchUp;
        myControls.gameplay.StyleSwitchDown.performed   += combatController.OnStyleSwitchDown;
        myControls.gameplay.SelectWeaponOne.performed   += combatController.OnPrimaryWeaponSelect;
        myControls.gameplay.SelectWeaponTwo.performed   += combatController.OnSecondWeaponSelect;
        myControls.gameplay.SelectWeaponThree.performed += combatController.OnThirdWeaponSelect;
        myControls.gameplay.Zoom.performed              += cameraLook.OnZoom;
        myControls.gameplay.Look.performed              += cameraLook.OnLook;
        myControls.gameplay.Interact.Enable();
        myControls.gameplay.Fire.Enable();
        myControls.gameplay.Look.Enable();
        myControls.gameplay.Pause.Enable();
        myControls.gameplay.CharacterMenu.Enable();
        myControls.gameplay.AltFire.Enable();
        myControls.gameplay.SelectWeaponOne.Enable();
        myControls.gameplay.SelectWeaponTwo.Enable();
        myControls.gameplay.SelectWeaponThree.Enable();
        myControls.gameplay.SpecialAbility.Enable();
        myControls.gameplay.Sprint.Enable();
        myControls.gameplay.Jump.Enable();
        myControls.gameplay.MoveRight.Enable();
        myControls.gameplay.MoveUp.Enable();
        myControls.gameplay.StyleSwitchUp.Enable();
        myControls.gameplay.StyleSwitchDown.Enable();
        if (Cursor.lockState != CursorLockMode.Locked)
        {
            Cursor.lockState = CursorLockMode.Locked;
        }
        if (Time.timeScale <= 1)
        {
            Time.timeScale = 1;
        }
    }