您最多选择25个主题
主题必须以中文或者字母或数字开头,可以包含连字符 (-),并且长度不得超过35个字符
25 行
532 B
25 行
532 B
using UnityEngine;
|
|
using System.Collections;
|
|
|
|
[CreateAssetMenu(menuName = "Runtime Anchors/Transform")]
|
|
public class TransformAnchor : RuntimeAnchorBase
|
|
{
|
|
[HideInInspector] public bool isSet = false; // Any script can check if the transform is null before using it, by just checking this bool
|
|
|
|
private Transform _transform;
|
|
public Transform Transform
|
|
{
|
|
get { return _transform; }
|
|
set
|
|
{
|
|
_transform = value;
|
|
isSet = _transform != null;
|
|
}
|
|
}
|
|
|
|
public void OnDisable()
|
|
{
|
|
_transform = null;
|
|
isSet = false;
|
|
}
|
|
}
|