Exemplo n.º 1
0
    // Start is called before the first frame update
    void Start()
    {
        dropableItem   = GetComponent <ItemDropEvent>();
        anim           = GetComponentInChildren <Animator>();
        collider       = GetComponent <Collider>();
        enemyRigidbody = GetComponent <Rigidbody>();
        targetPlayer   = GameObject.FindGameObjectWithTag("Player");

        stateMachine = new StateMachine <Enemy>();
        stateMachine.Setup(this, new EnemyMovement());
        currentState = stateMachine.GetCurrentState.ToString();

        isDeath     = false;
        forceAttack = false;
        canAttack   = true;
        canMove     = true;
        isStun      = false;
        maxHealth   = enemyStat.health;
        if (enemyStat.attackType != AttackType.AreaMelee && enemyStat.attackType != AttackType.AreaRanged)
        {
            enemyStat.attackRadiusOfArea = 0;
        }

        input = new Debuginput();
        input.Enable();

        input.debugging.DropItem.performed += _ => dropableItem.DropItem();
    }
Exemplo n.º 2
0
    // Start is called before the first frame update
    void Start()
    {
        isPaused     = false;
        pauseObjects = new List <GameObject>();
        for (int i = 0; i < gameObject.transform.childCount; i++)
        {
            pauseObjects.Add(this.gameObject.transform.GetChild(i).gameObject);
        }

        input = new Debuginput();
        input.Enable();

        input.debugging.Option.performed += _ => PauseGame();
    }