VAUDirectivity.cs 775 Bytes
Newer Older
1 2 3 4 5 6
using System.Collections;
using System.Collections.Generic;
using UnityEngine;

public class VAUDirectivity : MonoBehaviour {

Dipl.-Ing. Jonas Stienen's avatar
Dipl.-Ing. Jonas Stienen committed
7
    protected int _ID = -1; // Stores the internal id that is assigned by VA
8 9
    [Tooltip("Absolute or relative path (relative to Assets folder), also use AddSearchPath for special folders.")]
    public string FilePath = ""; 
Dipl.-Ing. Jonas Stienen's avatar
Dipl.-Ing. Jonas Stienen committed
10
    public string Name = ""; // Versatile name for this directivity
11 12 13 14 15 16 17 18

    public int ID
    {
        get
        {
            return _ID;
        }
    }
Dipl.-Ing. Jonas Stienen's avatar
Dipl.-Ing. Jonas Stienen committed
19
    
20 21
    void Start ()
    {
Dipl.-Ing. Jonas Stienen's avatar
Dipl.-Ing. Jonas Stienen committed
22 23
        if (FilePath.Length > 0)
            _ID = VAUAdapter.VA.LoadDirectivity(FilePath, Name);
24
	}
Dipl.-Ing. Jonas Stienen's avatar
Dipl.-Ing. Jonas Stienen committed
25 26 27 28 29 30 31

    private void OnDestroy()
    {
        if (_ID != -1)
            VAUAdapter.VA.FreeDirectivity(_ID);
        _ID = -1;
    }
32
}