本文整理汇总了C#中AMITarget.SetCache方法的典型用法代码示例。如果您正苦于以下问题:C# AMITarget.SetCache方法的具体用法?C# AMITarget.SetCache怎么用?C# AMITarget.SetCache使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类AMITarget
的用法示例。
在下文中一共展示了AMITarget.SetCache方法的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: setCamera
public bool setCamera(AMITarget itarget, Camera camera)
{
if(getCamera(itarget) != camera) {
if(camera) {
if(itarget.isMeta) {
_camera = null;
_cameraPath = AMUtil.GetPath(itarget.root, camera);
itarget.SetCache(_cameraPath, camera.transform);
}
else {
_camera = camera;
_cameraPath = "";
}
}
else {
_camera = null;
_cameraPath = "";
}
return true;
}
return false;
}
示例2: getCamera
public Camera getCamera(AMITarget itarget)
{
if(itarget.isMeta) {
if(!string.IsNullOrEmpty(_cameraPath)) {
Transform t = itarget.GetCache(_cameraPath);
if(t)
return t.GetComponent<Camera>();
else {
t = AMUtil.GetTarget(itarget.root, _cameraPath);
itarget.SetCache(_cameraPath, t);
if(t)
return t.GetComponent<Camera>();
}
}
return null;
}
else
return _camera;
}
示例3: GetTarget
public Transform GetTarget(AMITarget itarget)
{
Transform ret = null;
if(itarget.isMeta) {
if(!string.IsNullOrEmpty(targetPath)) {
ret = itarget.GetCache(targetPath);
if(ret == null) {
ret = AMUtil.GetTarget(itarget.root, targetPath);
itarget.SetCache(targetPath, ret);
}
}
}
else
ret = target;
return ret;
}
示例4: maintainKey
public override void maintainKey(AMITarget itarget, UnityEngine.Object targetObj)
{
if(itarget.isMeta) {
if(string.IsNullOrEmpty(_cameraPath)) {
if(_camera) {
_cameraPath = AMUtil.GetPath(itarget.root, _camera);
itarget.SetCache(_cameraPath, _camera.transform);
}
}
if(string.IsNullOrEmpty(_cameraEndPath)) {
if(_cameraEnd) {
_cameraEndPath = AMUtil.GetPath(itarget.root, _cameraEnd);
itarget.SetCache(_cameraEndPath, _cameraEnd.transform);
}
}
_camera = null;
_cameraEnd = null;
}
else {
if(!_camera) {
if(!string.IsNullOrEmpty(_cameraPath)) {
Transform t = itarget.GetCache(_cameraPath);
if(!t)
t = AMUtil.GetTarget(itarget.root, _cameraPath);
_camera = t ? t.GetComponent<Camera>() : null;
}
}
if(!_cameraEnd) {
if(!string.IsNullOrEmpty(_cameraEndPath)) {
Transform t = itarget.GetCache(_cameraEndPath);
if(!t)
t = AMUtil.GetTarget(itarget.root, _cameraEndPath);
_cameraEnd = t ? t.GetComponent<Camera>() : null;
}
}
_cameraPath = "";
_cameraEndPath = "";
}
}
示例5: SetTarget
public void SetTarget(AMITarget itarget, Transform t)
{
if(itarget.isMeta) {
target = null;
targetPath = AMUtil.GetPath(itarget.root, t);
itarget.SetCache(targetPath, t);
}
else {
target = t;
targetPath = "";
}
}
示例6: maintainKey
public override void maintainKey(AMITarget itarget, UnityEngine.Object targetObj)
{
if(itarget.isMeta) {
if(string.IsNullOrEmpty(targetPath)) {
if(target) {
targetPath = AMUtil.GetPath(itarget.root, target);
itarget.SetCache(targetPath, target);
}
}
target = null;
}
else {
if(!target) {
if(!string.IsNullOrEmpty(targetPath)) {
target = itarget.GetCache(targetPath);
if(!target)
target = AMUtil.GetTarget(itarget.root, targetPath);
}
}
targetPath = "";
}
}
示例7: SetTarget
public void SetTarget(AMITarget target, Transform item)
{
if(target.isMeta && item) {
_targetPath = AMUtil.GetPath(target.root, item);
target.SetCache(_targetPath, item);
SetSerializeObject(GetSerializeObject(item.gameObject));
}
else {
_targetPath = "";
SetSerializeObject(item ? GetSerializeObject(item.gameObject) : null);
}
}
示例8: maintainTrack
public virtual void maintainTrack(AMITarget itarget)
{
Object obj = null;
//fix the target info
if(itarget.isMeta) {
if(string.IsNullOrEmpty(_targetPath)) {
obj = GetSerializeObject(null);
if(obj) {
_targetPath = AMUtil.GetPath(itarget.root, obj);
itarget.SetCache(_targetPath, AMUtil.GetTransform(obj));
}
}
SetSerializeObject(null);
}
else {
obj = GetSerializeObject(null);
if(obj == null) {
if(!string.IsNullOrEmpty(_targetPath)) {
Transform tgt = itarget.GetCache(_targetPath);
if(tgt == null)
tgt = AMUtil.GetTarget(itarget.root, _targetPath);
if(tgt)
obj = GetSerializeObject(tgt.gameObject);
SetSerializeObject(obj);
}
}
_targetPath = "";
}
//maintain keys
foreach(AMKey key in keys)
key.maintainKey(itarget, obj);
}
示例9: GetTarget
/// <summary>
/// Gets the target relative to animator's hierarchy if we are referencing via AnimatorMeta
/// </summary>
public UnityEngine.Object GetTarget(AMITarget target)
{
UnityEngine.Object ret = null;
if(target.isMeta) {
Transform tgt = target.GetCache(_targetPath);
if(tgt)
ret = GetSerializeObject(tgt.gameObject);
else {
tgt = AMUtil.GetTarget(target.root, _targetPath);
target.SetCache(_targetPath, tgt);
if(tgt)
ret = GetSerializeObject(tgt.gameObject);
}
}
else
ret = GetSerializeObject(null);
return ret;
}