2022-01-18 17:18:15 +01:00

58 lines
1.7 KiB
C#

using System.Collections;
using System.Collections.Generic;
using UnityEngine;
namespace Passer {
/// <summary>
/// Possessions can be owned by an Humanoid
/// </summary>
///
/// \image html PossessionInspector.png
///
/// * %Possession type, see Possession::possessionType
/// * %Cross site allowed, see Possession::crossSite
/// * %Is unique, see Possession::isUnique
///
/// \version 4
[HelpURL("https://passervr.com/apis/HumanoidControl/Unity/class_passer_1_1_possessable.html")]
public class Possessable : MonoBehaviour {
/// <summary>
/// The possession type
/// </summary>
public enum Type {
Generic, ///< A generic Possession
Avatar, ///< An avatar can be worn by a Humanoid
}
/// <summary>
/// The Type of Possession
/// </summary>
public Type possessionType;
/// <summary>
/// If true, this Posession can be taken to other Sites.
/// </summary>
/// Non cross site possessions will be removed from the Humanoid's possessions
/// when they leave the site.
public bool crossSite = true;
/// <summary>
/// An unique Possession can be possessed only once.
/// </summary>
public bool isUnique = false;
public string siteLocation {
get {
if (SiteNavigator.currentSite == null)
return "";
string siteLocation = SiteNavigator.currentSite.siteLocation;
siteLocation = siteLocation.Substring(0, siteLocation.LastIndexOf("/"));
return (siteLocation + "/possessions");
}
}
public string assetPath;
}
}