static StackObject *set_bounceCombine_9(ILIntepreter __intp, StackObject *__esp, IList <object> __mStack, CLRMethod __method, bool isNewObj)
        {
            CSHotFix.Runtime.Enviorment.AppDomain __domain = __intp.AppDomain;
            StackObject *ptr_of_this_method;
            StackObject *__ret = ILIntepreter.Minus(__esp, 2);

            ptr_of_this_method = ILIntepreter.Minus(__esp, 1);
            UnityEngine.PhysicMaterialCombine value = (UnityEngine.PhysicMaterialCombine) typeof(UnityEngine.PhysicMaterialCombine).CheckCLRTypes(StackObject.ToObject(ptr_of_this_method, __domain, __mStack));
            __intp.Free(ptr_of_this_method);
            ptr_of_this_method = ILIntepreter.Minus(__esp, 2);
            UnityEngine.PhysicMaterial instance_of_this_method;
            instance_of_this_method = (UnityEngine.PhysicMaterial) typeof(UnityEngine.PhysicMaterial).CheckCLRTypes(StackObject.ToObject(ptr_of_this_method, __domain, __mStack));
            __intp.Free(ptr_of_this_method);

            instance_of_this_method.bounceCombine = value;

            return(__ret);
        }
Example #2
0
        /// <summary>
        /// Calculates a value from two given values based on the desired calculation method.
        /// </summary>
        /// <param name="lhs">The first value.</param>
        /// <param name="rhs">The second value.</param>
        /// <param name="calculation">How the final value should be calculated.</param>
        public static float Calculate(float lhs, float rhs, PhysicsMaterialCombine calculation)
        {
            switch (calculation)
            {
            case PhysicsMaterialCombine.Average:
                return((lhs + rhs) / 2f);

            case PhysicsMaterialCombine.Multiply:
                return(lhs * rhs);

            case PhysicsMaterialCombine.Maximum:
                return(Mathf.Max(lhs, rhs));

            case PhysicsMaterialCombine.Minimum:
                return(Mathf.Min(lhs, rhs));

            default:
                throw new System.NotImplementedException();
            }
        }