Esempio n. 1
0
 public void PlayerControlLogic()
 {
     pc.up    = Input.GetKey(KeyCode.W);
     pc.down  = Input.GetKey(KeyCode.S);
     pc.left  = Input.GetKey(KeyCode.A);
     pc.right = Input.GetKey(KeyCode.D);
     pc.GetComponent <CharInventory>().weaponUse = Input.GetKey(KeyCode.I);
 }
    void Start()
    {
        GameObject managerObject = GameObject.Find("GameManager");

        print(managerObject);
        gm = managerObject.GetComponent <GameplayManager>();
        pc = gm.pc;
        ci = pc.GetComponent <CharInventory>();
        rm = pc.GetComponent <RoomManager>();
    }
Esempio n. 3
0
 public void Drop()
 {
     if (interactible)
     {
         interactible.enabled = true;
     }
     coll.enabled          = true;
     rigidbody2d.simulated = true;
     holder.heldObject     = null;
     gameObject.transform.SetParent(null, true);
     rigidbody2d.velocity        = holder.GetComponent <Rigidbody2D>().velocity;
     rigidbody2d.angularVelocity = holder.GetComponent <Rigidbody2D>().angularVelocity;
     holder = null;
 }
Esempio n. 4
0
 //Check
 public void WinCheck(CharController target, int score, bool playerBool)
 {
     if (LevelManager.Instance.levelGoal <= score)
     {
         WinSequence(target.transform, playerBool);
         OnGameOver += target.GetComponent <SimpleCharacterControl>().FinishedAnimation;
         OnGameOver.Invoke();
     }
 }
    public CharacterStatistics(CharId charId, CharController characterController)
    {
        _charId = charId;
        _characterController = characterController;

        _characterController.OnJump      += OnJump;
        _characterController.OnAttack    += OnAttack;
        _characterController.OnAttackHit += OnAttackHit;
        _characterController.OnProjectilePickupPicked           += OnProjectilePickupPicked;
        _characterController.GetComponent <Entity>().OnKillMade += OnKillMade;
    }
Esempio n. 6
0
 private void Die()
 {
     m_dieCanvas.SetActive(false);
     ResetPlayer();
     m_player.GetComponent <CharController>().isDieCheck = false;
     LoadingSceneMng.LoadScene("Village");
 }