// Use this for initialization
    void Start()
    {
        rb.velocity = transform.right * speed;
        GameObject player = GameObject.Find("PlayerViking");

        cs = player.GetComponent <CharacterStatsystem>();

        if (type == 0)
        {
            damage = cs.damage.GetValue();             //беру дамаг из статов плеера
        }
        else if (type == 1)
        {
            damage = cs.poisonDamage.GetValue();             //беру дамаг из статов плеера
        }
        else if (type == 2)
        {
            damage = cs.frostDamage.GetValue();             //беру дамаг из статов плеера
        }
        else if (type == 3)
        {
            damage = cs.fireDamage.GetValue();             //беру дамаг из статов плеера
        }
        else if (type == 4)
        {
            damage = cs.shadowDamage.GetValue();             //беру дамаг из статов плеера
        }
    }
Exemple #2
0
 // Start is called before the first frame update
 void Start()
 {
     collider    = GetComponent <BoxCollider2D>();
     cs          = GameObject.Find("PlayerViking").GetComponent <PlayerStats>();
     lootManager = GameObject.Find("GameManager").GetComponent <LootManager>();
 }