Exemple #1
0
 protected override void Start()
 {
     CoolDownBefore = Random.Range(TpCooldownRange.x, TpCooldownRange.y);
     arena          = GameObject.FindGameObjectWithTag("GameController")
                      .GetComponent <ArenaEnemySpawner>();
     base.Start();
 }
Exemple #2
0
    public void Damage(GameObject source, int damage = 1, bool ignoreInvulurability = false)
    {
        if (HP <= 0)
        {
            return;          // Already dead
        }
        if ((THE_BOY && Vulnurable() || ignoreInvulurability) && SpecialConditions(source))
        {
            HP -= damage;
            if (HP <= 0)
            {
                ArenaEnemySpawner.ChangeTheBoy(gameObject);

                PreDestroyEffect();

                Destroy(gameObject);
            }
            else
            {
                HitEffect();
            }
        }
        else
        {
            if (absorbPrefab)
            {
                var absorb = Instantiate(absorbPrefab, gameObject.transform.position, Quaternion.identity);
                absorb.transform.SetParent(gameObject.transform);
                Destroy(absorb, 0.5f);
            }
        }
    }
    private void Start()
    {
        arena    = GetComponent <ArenaEnemySpawner>();
        maxvalue = arena.EnemyCount();
        GameObject TileMap = GameObject.FindGameObjectWithTag("TailMap");

        Tile    = TileMap.transform.GetChild(0).gameObject;
        Light   = 0.2f + (TotalValue / maxvalue) * 0.8f;
        tilemap = Tile.GetComponent <Tilemap>();
        NewLight(Light);

        SetSwampMaterial();
    }
Exemple #4
0
    protected virtual void Awake()
    {
        ArenaEnemySpawner spawn = GetComponent <ArenaEnemySpawner>();

        CharacterLife.isDeath = false;
        Canvas = GameObject.FindGameObjectWithTag("Canvas");
        var arena = GetComponent <ArenaEnemySpawner>();

        maxvalue = arena.EnemyCount();

        Canvas.transform.GetChild(0).gameObject.SetActive(false);
        isVictory = false;
        PlayerPrefs.SetInt("CurrentScene", SceneManager.GetActiveScene().buildIndex);
    }
 private void Start()
 {
     arena    = GetComponent <ArenaEnemySpawner>();
     maxvalue = arena.EnemyCount();
     Debug.Log(maxvalue);
 }