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 = ""; } }
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); }
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 = ""; } }
public string GetTargetPath(AMITarget target) { if (target.isMeta) { return(_targetPath); } else { return(AMUtil.GetPath(target.root, GetSerializeObject(null))); } }
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); } }
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 = ""; } }
void AMITarget.MaintainTargetCache(AMTrack track) { if ((this as AMITarget).isMeta && mCache.ContainsKey(track.targetPath)) { UnityEngine.Object obj = track.GetTarget(this); if (obj) { string objPath = AMUtil.GetPath(transform, obj); if (objPath != track.targetPath) { mCache.Remove(track.targetPath); } } } }
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); } }