RemoveClip() публичный Метод

public RemoveClip ( AnimationClip clip ) : void
clip AnimationClip
Результат void
    static int RemoveClip(IntPtr L)
    {
        try
        {
            int count = LuaDLL.lua_gettop(L);

            if (count == 2 && TypeChecker.CheckTypes <UnityEngine.AnimationClip>(L, 2))
            {
                UnityEngine.Animation     obj  = (UnityEngine.Animation)ToLua.CheckObject(L, 1, typeof(UnityEngine.Animation));
                UnityEngine.AnimationClip arg0 = (UnityEngine.AnimationClip)ToLua.ToObject(L, 2);
                obj.RemoveClip(arg0);
                return(0);
            }
            else if (count == 2 && TypeChecker.CheckTypes <string>(L, 2))
            {
                UnityEngine.Animation obj = (UnityEngine.Animation)ToLua.CheckObject(L, 1, typeof(UnityEngine.Animation));
                string arg0 = ToLua.ToString(L, 2);
                obj.RemoveClip(arg0);
                return(0);
            }
            else
            {
                return(LuaDLL.luaL_throw(L, "invalid arguments to method: UnityEngine.Animation.RemoveClip"));
            }
        }
        catch (Exception e)
        {
            return(LuaDLL.toluaL_exception(L, e));
        }
    }
 static public int RemoveClip(IntPtr l)
 {
     try{
         if (matchType(l, 2, typeof(UnityEngine.AnimationClip)))
         {
             UnityEngine.Animation     self = (UnityEngine.Animation)checkSelf(l);
             UnityEngine.AnimationClip a1;
             checkType(l, 2, out a1);
             self.RemoveClip(a1);
             return(0);
         }
         else if (matchType(l, 2, typeof(string)))
         {
             UnityEngine.Animation self = (UnityEngine.Animation)checkSelf(l);
             System.String         a1;
             checkType(l, 2, out a1);
             self.RemoveClip(a1);
             return(0);
         }
         LuaDLL.luaL_error(l, "No matched override function to call");
         return(0);
     }
     catch (Exception e) {
         LuaDLL.luaL_error(l, e.ToString());
         return(0);
     }
 }
Пример #3
0
 static public int RemoveClip(IntPtr l)
 {
     try {
         int argc = LuaDLL.lua_gettop(l);
         if (matchType(l, "RemoveClip__AnimationClip", argc, 2, typeof(UnityEngine.AnimationClip)))
         {
             UnityEngine.Animation     self = (UnityEngine.Animation)checkSelf(l);
             UnityEngine.AnimationClip a1;
             checkType(l, 3, out a1);
             self.RemoveClip(a1);
             pushValue(l, true);
             return(1);
         }
         else if (matchType(l, "RemoveClip__String", argc, 2, typeof(string)))
         {
             UnityEngine.Animation self = (UnityEngine.Animation)checkSelf(l);
             System.String         a1;
             checkType(l, 3, out a1);
             self.RemoveClip(a1);
             pushValue(l, true);
             return(1);
         }
         pushValue(l, false);
         LuaDLL.lua_pushstring(l, "No matched override function to call");
         return(2);
     }
     catch (Exception e) {
         return(error(l, e));
     }
 }
 static int QPYX_RemoveClip_YXQP(IntPtr L_YXQP)
 {
     try
     {
         int QPYX_count_YXQP = LuaDLL.lua_gettop(L_YXQP);
         if (QPYX_count_YXQP == 2 && TypeChecker.CheckTypes <string>(L_YXQP, 2))
         {
             UnityEngine.Animation QPYX_obj_YXQP = (UnityEngine.Animation)ToLua.CheckObject(L_YXQP, 1, typeof(UnityEngine.Animation));
             string QPYX_arg0_YXQP = ToLua.ToString(L_YXQP, 2);
             QPYX_obj_YXQP.RemoveClip(QPYX_arg0_YXQP);
             return(0);
         }
         else if (QPYX_count_YXQP == 2 && TypeChecker.CheckTypes <UnityEngine.AnimationClip>(L_YXQP, 2))
         {
             UnityEngine.Animation     QPYX_obj_YXQP  = (UnityEngine.Animation)ToLua.CheckObject(L_YXQP, 1, typeof(UnityEngine.Animation));
             UnityEngine.AnimationClip QPYX_arg0_YXQP = (UnityEngine.AnimationClip)ToLua.ToObject(L_YXQP, 2);
             QPYX_obj_YXQP.RemoveClip(QPYX_arg0_YXQP);
             return(0);
         }
         else
         {
             return(LuaDLL.luaL_throw(L_YXQP, "invalid arguments to method: UnityEngine.Animation.RemoveClip"));
         }
     }
     catch (Exception e_YXQP)                {
         return(LuaDLL.toluaL_exception(L_YXQP, e_YXQP));
     }
 }
Пример #5
0
	public static AnimationClip SetAnimation(Animation tarAnimation, int tarIndex, AnimationClip srcClip)
	{
		int nCount = 0;
		AnimationClip[]	backClip = new AnimationClip[tarAnimation.GetClipCount() - tarIndex + 1];

		foreach (AnimationState clip in tarAnimation)
		{
			if (tarIndex == nCount)
				tarAnimation.RemoveClip(clip.clip);
			if (tarIndex < nCount)
			{
				backClip[nCount - tarIndex - 1] = clip.clip;
				tarAnimation.RemoveClip(clip.clip);
			}
		}

		tarAnimation.AddClip(srcClip, srcClip.name);
		for (int n = 0; n < backClip.Length; n++)
			tarAnimation.AddClip(backClip[n], backClip[n].name);
		return srcClip;
	}
Пример #6
0
 static public int RemoveClip__String(IntPtr l)
 {
     try {
         UnityEngine.Animation self = (UnityEngine.Animation)checkSelf(l);
         System.String         a1;
         checkType(l, 2, out a1);
         self.RemoveClip(a1);
         pushValue(l, true);
         return(1);
     }
     catch (Exception e) {
         return(error(l, e));
     }
 }
Пример #7
0
 public static int RemoveClip1_wrap(long L)
 {
     try
     {
         long nThisPtr             = FCLibHelper.fc_get_inport_obj_ptr(L);
         UnityEngine.Animation obj = get_obj(nThisPtr);
         string arg0 = FCLibHelper.fc_get_string_a(L, 0);
         obj.RemoveClip(arg0);
     }
     catch (Exception e)
     {
         Debug.LogException(e);
     }
     return(0);
 }
Пример #8
0
 public static int RemoveClip_wrap(long L)
 {
     try
     {
         long nThisPtr = FCLibHelper.fc_get_inport_obj_ptr(L);
         UnityEngine.Animation     obj  = get_obj(nThisPtr);
         UnityEngine.AnimationClip arg0 = FCGetObj.GetObj <UnityEngine.AnimationClip>(FCLibHelper.fc_get_wrap_objptr(L, 0));
         obj.RemoveClip(arg0);
     }
     catch (Exception e)
     {
         Debug.LogException(e);
     }
     return(0);
 }
 static public int RemoveClip(IntPtr l)
 {
     try {
                     #if DEBUG
         var    method     = System.Reflection.MethodBase.GetCurrentMethod();
         string methodName = GetMethodName(method);
                     #if UNITY_5_5_OR_NEWER
         UnityEngine.Profiling.Profiler.BeginSample(methodName);
                     #else
         Profiler.BeginSample(methodName);
                     #endif
                     #endif
         int argc = LuaDLL.lua_gettop(l);
         if (matchType(l, argc, 2, typeof(UnityEngine.AnimationClip)))
         {
             UnityEngine.Animation     self = (UnityEngine.Animation)checkSelf(l);
             UnityEngine.AnimationClip a1;
             checkType(l, 2, out a1);
             self.RemoveClip(a1);
             pushValue(l, true);
             return(1);
         }
         else if (matchType(l, argc, 2, typeof(string)))
         {
             UnityEngine.Animation self = (UnityEngine.Animation)checkSelf(l);
             System.String         a1;
             checkType(l, 2, out a1);
             self.RemoveClip(a1);
             pushValue(l, true);
             return(1);
         }
         pushValue(l, false);
         LuaDLL.lua_pushstring(l, "No matched override function RemoveClip to call");
         return(2);
     }
     catch (Exception e) {
         return(error(l, e));
     }
             #if DEBUG
     finally {
                     #if UNITY_5_5_OR_NEWER
         UnityEngine.Profiling.Profiler.EndSample();
                     #else
         Profiler.EndSample();
                     #endif
     }
             #endif
 }
Пример #10
0
        private void PlayAnimation(AnimationClip clip)
        {
            graphicRaycaster.enabled = false;
            if (animator.isPlaying)
            {
                animator.Stop();
            }
            animator.RemoveClip(animator.clip);
            animator.clip = clip;
            animator.AddClip(clip, clip.name);
            animator.Play();
            Debug.Log("Playing " + clip.name, clip);

            StopAnimationEndAwaiter();
            _animationWaitCoroutine = StartCoroutine(WaitForAnimationEnd(clip));
        }
    static int RemoveClip(IntPtr L)
    {
        int count = LuaDLL.lua_gettop(L);

        if (count == 2 && ToLua.CheckTypes(L, 1, typeof(UnityEngine.Animation), typeof(string)))
        {
            UnityEngine.Animation obj = (UnityEngine.Animation)ToLua.ToObject(L, 1);
            string arg0 = ToLua.ToString(L, 2);

            try
            {
                obj.RemoveClip(arg0);
            }
            catch (Exception e)
            {
                return(LuaDLL.toluaL_exception(L, e));
            }

            return(0);
        }
        else if (count == 2 && ToLua.CheckTypes(L, 1, typeof(UnityEngine.Animation), typeof(UnityEngine.AnimationClip)))
        {
            UnityEngine.Animation     obj  = (UnityEngine.Animation)ToLua.ToObject(L, 1);
            UnityEngine.AnimationClip arg0 = (UnityEngine.AnimationClip)ToLua.ToObject(L, 2);

            try
            {
                obj.RemoveClip(arg0);
            }
            catch (Exception e)
            {
                return(LuaDLL.toluaL_exception(L, e));
            }

            return(0);
        }
        else
        {
            LuaDLL.luaL_error(L, "invalid arguments to method: UnityEngine.Animation.RemoveClip");
        }

        return(0);
    }
Пример #12
0
        /**
         * <summary>Cleans the supplied Animation component of any clips not being played.</summary>
         * <param name = "_animation">The Animation component to clean</param>
         */
        public static void CleanUnusedClips(Animation _animation)
        {
            // Remove any non-playing animations
            List <string> removeClips = new List <string>();

            foreach (AnimationState state in _animation)
            {
                if (!_animation [state.name].enabled)
                {
                    // Queued animations get " - Queued Clone" appended to it, so remove

                    int queueIndex = state.name.IndexOf (" - Queued Clone");

                    if (queueIndex > 0)
                    {
                        removeClips.Add (state.name.Substring (0, queueIndex));
                    }
                    else
                    {
                        removeClips.Add (state.name);
                    }
                }
            }

            foreach (string _clip in removeClips)
            {
                _animation.RemoveClip (_clip);
            }
        }
 protected void Initialize(Animation animation, Transform transform, string newName = null)
 {
     if (clip == null)
     {
         Debug.LogError ("clip is null. Cannot initialize animation " + (name == null ? "NULL" : name));
         return;
     }
     animation.RemoveClip (Name);
     if (newName != null)
         name = newName;
     animation.AddClip (clip, Name);
     animation [Name].layer = Layer;
     foreach(var mt in MixingTransforms)
     {
         if (AnimationNames.ContainsKey(mt) && transform.Find (AnimationNames [mt]) != null && transform != null)
             animation [Name].AddMixingTransform (transform.Find (AnimationNames [mt]));
         else
             Debug.LogError ("[assembly: " + Assembly.GetExecutingAssembly ().GetName().Name + "]: animation mixing transform " + mt + " from animation " + Name + " does not exist, or could not be found.");
     }
 }
Пример #14
0
 public static int metcrossfadetransitionanimation(Transform varpcharacter, string varpdestinationanimname, float varptransitiontime, Transform varpcontroller = null, string varpstateanimationname = "", bool varpgokinematic = true, string varpnewanimname = "transition", Animation varpanimationsystem = null, SkinnedMeshRenderer varprenderer = null, clsurganimationstatesmanager varpstatesmanager = null)
 {
     if (varpcharacter == null)
     {
         return -1;
     }
     if (varptransitiontime == 0f)
     {
         return -2;
     }
     if (varpanimationsystem == null)
     {
         varpanimationsystem = varpcharacter.root.GetComponentInChildren<Animation>();
         if (varpanimationsystem == null)
         {
             return -3;
         }
         varpanimationsystem.Stop();
     }
     if (varprenderer == null)
     {
         varprenderer = varpcharacter.root.GetComponentInChildren<SkinnedMeshRenderer>();
         if (varprenderer == null)
         {
             return -4;
         }
     }
     if (varpgokinematic)
     {
         clsurgutils.metgodriven(varpcharacter, true);
     }
     Vector3 localPosition = default(Vector3);
     if (varpcontroller != null)
     {
         Vector3 position = varpcharacter.position;
         varpcontroller.position = position;
         varpcharacter.localPosition = localPosition;
     }
     AnimationClip animationClip = clsurgutils.metcreatetransitionanimation(varpcharacter, varpdestinationanimname, varptransitiontime, varpnewanimname, ref localPosition, varpstatesmanager, false);
     if (animationClip != null)
     {
         varpanimationsystem.Stop();
         AnimationState animationState = varpanimationsystem[varpdestinationanimname];
         if (animationState != null && animationState.name != varpdestinationanimname)
         {
             varpanimationsystem.RemoveClip(varpnewanimname);
         }
         varpanimationsystem.AddClip(animationClip, varpnewanimname);
         if (varpstateanimationname != string.Empty)
         {
             varpanimationsystem[varpnewanimname].wrapMode = WrapMode.Once;
             varpanimationsystem.CrossFade(varpnewanimname);
             varpanimationsystem.CrossFadeQueued(varpstateanimationname);
         }
         else
         {
             varpanimationsystem.CrossFade(varpnewanimname);
         }
         return 1;
     }
     Debug.LogError("Could not create transition");
     return -5;
 }