Ejemplo n.º 1
0
    public void validatePlayerHealth()
    {
        m_Player playerModel = GameObject.FindGameObjectWithTag("Player").GetComponent <m_Player>();

        Assert.IsTrue(playerModel.MaxHealth > 0);
        Assert.IsTrue(playerModel.DamagePerShot >= 0);
        Assert.IsTrue(playerModel.armorValue >= 0);
        Assert.IsTrue(playerModel.attackSpeed > 0 && playerModel.attackSpeed < 60);
        Assert.IsTrue(playerModel.shootingRange > 10 && playerModel.shootingRange < 200);
    }
Ejemplo n.º 2
0
    void Awake()
    {
        playerModel = GetComponent <m_Player>();

        speed = playerModel.MovementSpeed;

        floorMask       = LayerMask.GetMask("Floor");
        anim            = GetComponent <Animator>();
        playerRigidbody = GetComponent <Rigidbody>();
    }
Ejemplo n.º 3
0
    void Awake()
    {
        playerModel = GetComponentInParent <m_Player>();

        range              = playerModel.shootingRange;
        damageType         = playerModel.damageType;
        damagePerShot      = playerModel.DamagePerShot;
        timeBetweenBullets = playerModel.attackSpeed;

        shootableMask = LayerMask.GetMask("Shootable");
        gunParticles  = GetComponent <ParticleSystem> ();
        gunLine       = GetComponent <LineRenderer> ();
        gunAudio      = GetComponent <AudioSource> ();
        gunLight      = GetComponent <Light> ();
    }
Ejemplo n.º 4
0
    void Awake()
    {
        playerModel    = GetComponent <m_Player>();
        startingHealth = playerModel.MaxHealth;
        armor          = playerModel.armorType;
        armorValue     = playerModel.armorValue;
        //tempDMGTimer = Time.realtimeSinceStartup;
        anim           = GetComponent <Animator> ();
        playerAudio    = GetComponent <AudioSource> ();
        playerMovement = GetComponent <PlayerMovement> ();
        playerShooting = GetComponentInChildren <PlayerShooting> ();
        currentHealth  = startingHealth;

        UILog          = GameObject.FindGameObjectWithTag("Canvas").GetComponentInChildren <Text>(true);
        attackListener = new UnityAction(UnitAttacked);
        damageListener = new UnityAction(UnitDamage);

        //Fetch data from Game System
        Game.current.LoadPlayerData();
    }