• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

C# AMITarget类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了C#中AMITarget的典型用法代码示例。如果您正苦于以下问题:C# AMITarget类的具体用法?C# AMITarget怎么用?C# AMITarget使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



AMITarget类属于命名空间,在下文中一共展示了AMITarget类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C#代码示例。

示例1: getDependencies

 public override List<GameObject> getDependencies(AMITarget itarget)
 {
     Transform t = GetTarget(itarget) as Transform;
     List<GameObject> ls = new List<GameObject>();
     if(t) ls.Add(t.gameObject);
     return ls;
 }
开发者ID:igrir,项目名称:MateAnimator,代码行数:7,代码来源:AMRotationTrack.cs


示例2: previewFrame

        // preview a frame in the scene view
        public override void previewFrame(AMITarget target, float frame, int frameRate, bool play, float playSpeed)
        {
            GameObject go = GetTarget(target) as GameObject;

            if(keys == null || keys.Count <= 0) {
                return;
            }
            if(!go) return;

            // if before the first frame
            if(frame < (float)keys[0].frame) {
                //go.rotation = (cache[0] as AMPropertyAction).getStartQuaternion();
                go.SetActive(startActive);
                return;
            }
            // if beyond or equal to last frame
            if(frame >= (float)(keys[keys.Count - 1] as AMGOSetActiveKey).frame) {
                go.SetActive((keys[keys.Count - 1] as AMGOSetActiveKey).setActive);
                return;
            }
            // if lies on property action
            foreach(AMGOSetActiveKey key in keys) {
                if((frame < (float)key.frame) || (key.endFrame != -1 && frame >= (float)key.endFrame)) continue;

                go.SetActive(key.setActive);
                return;
            }
        }
开发者ID:igrir,项目名称:MateAnimator,代码行数:29,代码来源:AMGOSetActiveTrack.cs


示例3: getDependencies

 public override List<GameObject> getDependencies(AMITarget target)
 {
     AudioSource src = GetTarget(target) as AudioSource;
     List<GameObject> ls = new List<GameObject>();
     if(src) ls.Add(src.gameObject);
     return ls;
 }
开发者ID:igrir,项目名称:MateAnimator,代码行数:7,代码来源:AMAudioTrack.cs


示例4: getDependencies

 public override List<GameObject> getDependencies(AMITarget target)
 {
     GameObject go = GetTarget(target) as GameObject;
     List<GameObject> ls = new List<GameObject>();
     if(go) ls.Add(go);
     return ls;
 }
开发者ID:igrir,项目名称:MateAnimator,代码行数:7,代码来源:AMAnimationTrack.cs


示例5: addKey

 // add a new key
 public void addKey(AMITarget itarget, OnAddKey addCall, int _frame, Camera camera = null,/*int? type = null, Camera camera = null, Color? color = null,*/ AMCameraSwitcherKey keyToClone = null)
 {
     foreach(AMCameraSwitcherKey key in keys) {
         // if key exists on frame, update key
         if(key.frame == _frame) {
             if(camera != null) {
                 key.setCamera(itarget, camera);
                 key.type = 0;
                 updateCache(itarget);
             }
             return;
         }
     }
     AMCameraSwitcherKey a = addCall(gameObject, typeof(AMCameraSwitcherKey)) as AMCameraSwitcherKey;
     if(keyToClone) {
         keyToClone.CopyTo(a);
     }
     else {
         a.type = 0;
         a.still = !AMTakeData.isProLicense;
         a.easeType = (int)EaseType.EaseOutSine;
     }
     a.frame = _frame;
     if(camera != null) {
         a.setCamera(itarget, camera);
         a.type = 0;
     }
     // add a new key
     keys.Add(a);
     // update cache
     updateCache(itarget);
 }
开发者ID:Ryrumeli,项目名称:MateAnimator,代码行数:33,代码来源:AMCameraSwitcherTrack.cs


示例6: updateDependencies

        public override List<GameObject> updateDependencies(AMITarget target, List<GameObject> newReferences, List<GameObject> oldReferences)
        {
            GameObject go = GetTarget(target) as GameObject;
            bool didUpdateObj = false;
            bool didUpdateParameter = false;
            if(go) {
                for(int i = 0; i < oldReferences.Count; i++) {
                    if(oldReferences[i] == go) {
                        // check if new GameObject has all the required components
                        foreach(AMEventKey key in keys) {
                            string componentName = key.getComponentName();
                            if(newReferences[i].GetComponent(componentName) == null) {
                                // missing component
                                Debug.LogWarning("Animator: Event Track component '" + componentName + "' not found on new reference for GameObject '" + obj.name + "'. Duplicate not replaced.");
                                List<GameObject> lsFlagToKeep = new List<GameObject>();
                                lsFlagToKeep.Add(oldReferences[i]);
                                return lsFlagToKeep;
                            }
                        }
                        SetTarget(target, newReferences[i].transform);
                        didUpdateObj = true;
                        break;
                    }

                }
            }
            foreach(AMEventKey key in keys) {
                if(key.updateDependencies(newReferences, oldReferences, didUpdateObj, go) && !didUpdateParameter) didUpdateParameter = true;
            }

            if(didUpdateObj || didUpdateParameter) updateCache(target);

            return new List<GameObject>();
        }
开发者ID:igrir,项目名称:MateAnimator,代码行数:34,代码来源:AMEventTrack.cs


示例7: AMSequence

    public AMSequence(AMITarget itarget, int id, AMTakeData take)
    {
        mTarget = itarget;
        mId = id;
        mTake = take;

        if(mTake.loopBackToFrame > 0 && mTake.numLoop <= 0)
            mTake.numLoop = 1;
    }
开发者ID:Ryrumeli,项目名称:MateAnimator,代码行数:9,代码来源:AMSequence.cs


示例8: getDependencies

 public override List<GameObject> getDependencies(AMITarget target)
 {
     GameObject go = GetTarget(target) as GameObject;
     List<GameObject> ls = new List<GameObject>();
     if(go) ls.Add(go);
     foreach(AMEventKey key in keys) {
         ls = ls.Union(key.getDependencies()).ToList();
     }
     return ls;
 }
开发者ID:igrir,项目名称:MateAnimator,代码行数:10,代码来源:AMEventTrack.cs


示例9: Pause

 public override void Pause(AMITarget itarget)
 {
     AudioSource src = GetTarget(itarget) as AudioSource;
     if(src && src.isPlaying) {
         pausedLoop = src.loop && src.clip && src.clip.length - src.time < 1f; //only end loop if it's short enough to do so
         if(pausedLoop)
             src.loop = false;
         else
             src.Pause();
         paused = true;
     }
 }
开发者ID:igrir,项目名称:MateAnimator,代码行数:12,代码来源:AMAudioTrack.cs


示例10: getAllCameras

 public Camera[] getAllCameras(AMITarget itarget)
 {
     List<Camera> lsCameras = new List<Camera>();
     foreach(AMCameraSwitcherKey key in keys) {
         Camera cam = key.getCamera(itarget);
         if(key.type == 0 && cam) {
             if(lsCameras.IndexOf(cam) == -1) {
                 lsCameras.Add(cam);
             }
         }
     }
     return lsCameras.ToArray();
 }
开发者ID:Ryrumeli,项目名称:MateAnimator,代码行数:13,代码来源:AMCameraSwitcherTrack.cs


示例11: drawGizmos

        // draw gizmos
        public override void drawGizmos(AMITarget itarget, float gizmo_size, bool inPlayMode, int frame)
        {
            if(!obj) return;

            // draw line to target
            bool isLineDrawn = false;
            if(!inPlayMode) {
                for(int i = 0; i < keys.Count; i++) {
                    AMOrientationKey key = keys[i] as AMOrientationKey;
                    if(key == null)
                        continue;

                    AMOrientationKey keyNext = i + 1 < keys.Count ? keys[i + 1] as AMOrientationKey : null;

                    Transform t = key.GetTarget(itarget);
                    if(t) {
                        //draw target
                        Gizmos.color = new Color(245f/255f, 107f/255f, 30f/255f, 1f);
                        Gizmos.DrawSphere(t.position, 0.2f * (AnimatorTimeline.e_gizmoSize/0.1f));

                        //draw line
                        if(!isLineDrawn) {
                            if(key.frame > frame) isLineDrawn = true;
                            if(frame >= key.frame && frame <= key.endFrame) {
                                if(!keyNext || t == keyNext.GetTarget(itarget)) {
                                    Gizmos.color = new Color(245f / 255f, 107f / 255f, 30f / 255f, 0.2f);
                                    Gizmos.DrawLine(obj.transform.position, t.position);
                                }
                                isLineDrawn = true;
                            }
                        }
                    }
                }
            }
            // draw arrow
            Gizmos.color = new Color(245f / 255f, 107f / 255f, 30f / 255f, 1f);
            Vector3 pos = obj.transform.position;
            float size = (1.2f * (gizmo_size / 0.1f));
            if(size < 0.1f) size = 0.1f;
            Vector3 direction = obj.forward * size;
            float arrowHeadAngle = 20f;
            float arrowHeadLength = 0.3f * size;

            Gizmos.DrawRay(pos, direction);

            Vector3 right = Quaternion.LookRotation(direction) * Quaternion.Euler(0, 180 + arrowHeadAngle, 0) * new Vector3(0, 0, 1);
            Vector3 left = Quaternion.LookRotation(direction) * Quaternion.Euler(0, 180 - arrowHeadAngle, 0) * new Vector3(0, 0, 1);
            Gizmos.DrawRay(pos + direction, right * arrowHeadLength);
            Gizmos.DrawRay(pos + direction, left * arrowHeadLength);
        }
开发者ID:igrir,项目名称:MateAnimator,代码行数:51,代码来源:AMOrientationTrack.cs


示例12: addKey

 // add a new key
 public void addKey(AMITarget itarget, OnAddKey addCall, int _frame)
 {
     foreach(AMEventKey key in keys) {
         // if key exists on frame, do nothing
         if(key.frame == _frame) {
             return;
         }
     }
     AMEventKey a = addCall(gameObject, typeof(AMEventKey)) as AMEventKey;
     a.frame = _frame;
     // add a new key
     keys.Add(a);
     // update cache
     updateCache(itarget);
 }
开发者ID:igrir,项目名称:MateAnimator,代码行数:16,代码来源:AMEventTrack.cs


示例13: addKey

 // add a new key
 public void addKey(AMITarget target, OnAddKey addCall, int _frame)
 {
     foreach(AMGOSetActiveKey key in keys) {
         // if key exists on frame, update
         if(key.frame == _frame) {
             key.setActive = true;
             updateCache(target);
             return;
         }
     }
     AMGOSetActiveKey a = addCall(gameObject, typeof(AMGOSetActiveKey)) as AMGOSetActiveKey;
     a.frame = _frame;
     a.setActive = true;
     // add a new key
     keys.Add(a);
     // update cache
     updateCache(target);
 }
开发者ID:igrir,项目名称:MateAnimator,代码行数:19,代码来源:AMGOSetActiveTrack.cs


示例14: 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:Ryrumeli,项目名称:MateAnimator,代码行数:20,代码来源:AMCameraSwitcherKey.cs


示例15: addKey

 // add a new key
 public void addKey(AMITarget itarget, OnAddKey addCall, int _frame, AudioClip _clip, bool _loop)
 {
     foreach(AMAudioKey key in keys) {
         // if key exists on frame, update key
         if(key.frame == _frame) {
             key.audioClip = _clip;
             key.loop = _loop;
             // update cache
             updateCache(itarget);
         }
     }
     AMAudioKey a = addCall(gameObject, typeof(AMAudioKey)) as AMAudioKey;
     a.frame = _frame;
     a.audioClip = _clip;
     a.loop = _loop;
     // add a new key
     keys.Add(a);
     // update cache
     updateCache(itarget);
 }
开发者ID:igrir,项目名称:MateAnimator,代码行数:21,代码来源:AMAudioTrack.cs


示例16: addKey

        // add a new key, default interpolation and easeType
        public void addKey(AMITarget itarget, OnAddKey addCall, int _frame, Vector3 _position)
        {
            foreach(AMTranslationKey key in keys) {
                // if key exists on frame, update key
                if(key.frame == _frame) {
                    key.position = _position;
                    // update cache
                    updateCache(itarget);
                    return;
                }
            }
            AMTranslationKey a = addCall(gameObject, typeof(AMTranslationKey)) as AMTranslationKey;
            a.frame = _frame;
            a.position = _position;

            // add a new key
            keys.Add(a);
            // update cache
            updateCache(itarget);
        }
开发者ID:igrir,项目名称:MateAnimator,代码行数:21,代码来源:AMTranslationTrack.cs


示例17: addKey

 // add a new key
 public void addKey(AMITarget itarget, OnAddKey addCall, int _frame, Transform target)
 {
     foreach(AMOrientationKey key in keys) {
         // if key exists on frame, update key
         if(key.frame == _frame) {
             key.SetTarget(itarget, target);
             // update cache
             updateCache(itarget);
             return;
         }
     }
     AMOrientationKey a = addCall(gameObject, typeof(AMOrientationKey)) as AMOrientationKey;
     a.frame = _frame;
     a.SetTarget(itarget, target);
     // set default ease type to linear
     a.easeType = (int)0;// AMTween.EaseType.linear;
     // add a new key
     keys.Add(a);
     // update cache
     updateCache(itarget);
 }
开发者ID:igrir,项目名称:MateAnimator,代码行数:22,代码来源:AMOrientationTrack.cs


示例18: addKey

 // add a new key
 public void addKey(AMITarget itarget, OnAddKey addCall, int _frame, AnimationClip _clip, WrapMode _wrapMode)
 {
     foreach(AMAnimationKey key in keys) {
         // if key exists on frame, update key
         if(key.frame == _frame) {
             key.amClip = _clip;
             key.wrapMode = _wrapMode;
             // update cache
             updateCache(itarget);
             return;
         }
     }
     AMAnimationKey a = addCall(gameObject, typeof(AMAnimationKey)) as AMAnimationKey;
     a.frame = _frame;
     a.amClip = _clip;
     a.wrapMode = _wrapMode;
     // add a new key
     keys.Add(a);
     // update cache
     updateCache(itarget);
 }
开发者ID:igrir,项目名称:MateAnimator,代码行数:22,代码来源:AMAnimationTrack.cs


示例19: getCameraFadeTupleForFrame

    public cfTuple getCameraFadeTupleForFrame(AMITarget itarget, int frame)
    {
        if(keys == null || keys.Count <= 0) {
            return new cfTuple(0, 0, 0, null, null, false);
        }
        for(int i=0; i<keys.Count; i++) {
            AMCameraSwitcherKey key = keys[i] as AMCameraSwitcherKey;
            // compact
            if(frame < key.frame) {
                break;
            }
            else if(frame < key.endFrame) {
                if(!key.still || key.cameraFadeType == (int)AMCameraSwitcherKey.Fade.None || key.targetsAreEqual(itarget)) break;
                bool isReversed = key.isReversed();

                if(isReversed) return new cfTuple(key.endFrame, key.typeEnd, key.type, key.getCameraEnd(itarget), key.getCamera(itarget), isReversed);
                else return new cfTuple(key.frame, key.type, key.typeEnd, key.getCamera(itarget), key.getCameraEnd(itarget), isReversed);
                //return new cfTuple((isReversed ? (cache[i] as AMCameraSwitcherAction).endFrame : (cache[i] as AMCameraSwitcherAction).startFrame),(cache[i] as AMCameraSwitcherAction).startCamera,(cache[i] as AMCameraSwitcherAction).endCamera,isReversed);
            }
        }
        return new cfTuple(0, 0, 0, null, null, false);
    }
开发者ID:Ryrumeli,项目名称:MateAnimator,代码行数:22,代码来源:AMCameraSwitcherTrack.cs


示例20: addKey

        // add a new key
        public void addKey(AMITarget target, OnAddKey addCall, int _frame, Quaternion _rotation)
        {
            foreach(AMRotationKey key in keys) {
                // if key exists on frame, update key
                if(key.frame == _frame) {
                    key.rotation = _rotation;
                    // update cache
                    updateCache(target);
                    return;
                }
            }
            AMRotationKey a = addCall(gameObject, typeof(AMRotationKey)) as AMRotationKey;
            a.frame = _frame;
            a.rotation = _rotation;
            // set default ease type to linear
            a.easeType = (int)EaseType.Linear;

            // add a new key
            keys.Add(a);
            // update cache
            updateCache(target);
        }
开发者ID:igrir,项目名称:MateAnimator,代码行数:23,代码来源:AMRotationTrack.cs



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C# AP类代码示例发布时间:2022-05-24
下一篇:
C# AMFWriter类代码示例发布时间:2022-05-24
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap