当前位置: 首页>>代码示例>>C#>>正文


C# AMITarget.SetCache方法代码示例

本文整理汇总了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;
        }
开发者ID:igrir,项目名称:MateAnimator,代码行数:24,代码来源:AMCameraSwitcherKey.cs

示例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;
        }
开发者ID:igrir,项目名称:MateAnimator,代码行数:20,代码来源:AMCameraSwitcherKey.cs

示例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;
 }
开发者ID:Ryrumeli,项目名称:MateAnimator,代码行数:16,代码来源:AMOrientationKey.cs

示例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 = "";
            }
        }
开发者ID:igrir,项目名称:MateAnimator,代码行数:43,代码来源:AMCameraSwitcherKey.cs

示例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 = "";
     }
 }
开发者ID:Ryrumeli,项目名称:MateAnimator,代码行数:12,代码来源:AMOrientationKey.cs

示例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 = "";
        }
    }
开发者ID:Ryrumeli,项目名称:MateAnimator,代码行数:24,代码来源:AMOrientationKey.cs

示例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);
     }
 }
开发者ID:Ryrumeli,项目名称:MateAnimator,代码行数:12,代码来源:AMTrack.cs

示例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);
    }
开发者ID:Ryrumeli,项目名称:MateAnimator,代码行数:34,代码来源:AMTrack.cs

示例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;
    }
开发者ID:Ryrumeli,项目名称:MateAnimator,代码行数:23,代码来源:AMTrack.cs


注:本文中的AMITarget.SetCache方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。