예제 #1
0
 static public int StartFadeIn(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
         EZCameraShake.CameraShakeInstance self = (EZCameraShake.CameraShakeInstance)checkSelf(l);
         System.Single a1;
         checkType(l, 2, out a1);
         self.StartFadeIn(a1);
         pushValue(l, true);
         return(1);
     }
     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
 }
예제 #2
0
        /// <summary>
        /// Start shaking the camera.
        /// </summary>
        /// <param name="magnitude">The intensity of the shake.</param>
        /// <param name="roughness">Roughness of the shake. Lower values are smoother, higher values are more jarring.</param>
        /// <param name="fadeInTime">How long to fade in the shake, in seconds.</param>
        /// <param name="posInfluence">How much this shake influences position.</param>
        /// <param name="rotInfluence">How much this shake influences rotation.</param>
        /// <returns>A CameraShakeInstance that can be used to alter the shake's properties.</returns>
        public CameraShakeInstance StartShake(float magnitude, float roughness, float fadeInTime, Vector3 posInfluence, Vector3 rotInfluence)
        {
            CameraShakeInstance shake = new CameraShakeInstance(magnitude, roughness);

            shake.PositionInfluence = posInfluence;
            shake.RotationInfluence = rotInfluence;
            shake.StartFadeIn(fadeInTime);
            cameraShakeInstances.Add(shake);
            return(shake);
        }
예제 #3
0
        /// <summary>
        /// Start shaking the camera.
        /// </summary>
        /// <param name="magnitude">The intensity of the shake.</param>
        /// <param name="roughness">Roughness of the shake. Lower values are smoother, higher values are more jarring.</param>
        /// <param name="fadeInTime">How long to fade in the shake, in seconds.</param>
        /// <returns>A CameraShakeInstance that can be used to alter the shake's properties.</returns>
        public CameraShakeInstance StartShake(float magnitude, float roughness, float fadeInTime)
        {
            CameraShakeInstance shake = new CameraShakeInstance(magnitude, roughness);

            shake.positionInfluence = defaultPosInfluence;
            shake.rotationInfluence = defaultRotInfluence;
            shake.StartFadeIn(fadeInTime);
            _cameraShakeInstances.Add(shake);
            return(shake);
        }
예제 #4
0
 /// <summary>
 /// Start shaking the camera.
 /// </summary>
 /// <param name="magnitude">The intensity of the shake.</param>
 /// <param name="roughness">Roughness of the shake. Lower values are smoother, higher values are more jarring.</param>
 /// <param name="fadeInTime">How long to fade in the shake, in seconds.</param>
 /// <param name="posInfluence">How much this shake influences position.</param>
 /// <param name="rotInfluence">How much this shake influences rotation.</param>
 /// <returns>A CameraShakeInstance that can be used to alter the shake's properties.</returns>
 public CameraShakeInstance StartShake(float magnitude, float roughness, float fadeInTime, Vector3 posInfluence, Vector3 rotInfluence)
 {
     CameraShakeInstance shake = new CameraShakeInstance(magnitude, roughness);
     shake.PositionInfluence = posInfluence;
     shake.RotationInfluence = rotInfluence;
     shake.StartFadeIn(fadeInTime);
     cameraShakeInstances.Add(shake);
     return shake;
 }