Exemple #1
0
    void Start()
    {
        audio = GetComponent <CompAudio>();

        Vector3 global_pos = transform.GetGlobalPosition();

        door_pos_x = (int)((global_pos.x + (12.7f)) / 25.4);
        door_pos_y = (int)((global_pos.z + (12.7f)) / 25.4);

        if (door_closed)
        {
            Vector3 pos = GetComponent <Transform>().GetPosition();
            if (pos.y != min_height)
            {
                pos.y = min_height;
                GetComponent <Transform>().SetPosition(pos);
            }
            GetLinkedObject("map_obj").GetComponent <LevelMap>().UpdateMap(door_pos_x, door_pos_y, 1);
        }
        else
        {
            Vector3 pos = GetComponent <Transform>().GetPosition();
            if (pos.y != max_height)
            {
                pos.y = max_height;
                GetComponent <Transform>().SetPosition(pos);
            }
            GetLinkedObject("map_obj").GetComponent <LevelMap>().UpdateMap(door_pos_x, door_pos_y, 0);
        }

        temp_bt_sw = Enemy_connected.GetComponent <EnemySword_BT>();
        temp_bt_sp = Enemy_connected.GetComponent <EnemySpear_BT>();
        temp_bt_sh = Enemy_connected.GetComponent <EnemyShield_BT>();
    }
Exemple #2
0
 public void DeleteLanceEnemy(GameObject enemy)
 {
     if (lance_enemies == null)
     {
         Debug.Log("[error] EnemiesManager: Lance_enemies is null");
     }
     else
     {
         lance_enemies.Remove(enemy);
         EnemySpear_BT temp_bt = enemy.GetComponent <EnemySpear_BT>();
         temp_bt.DeactivateHUD(temp_bt.spear_name);
     }
 }