示例#1
0
        public static bool UnityEngineVector3MCall(object objSelf, string functionName, List <CQ_Value> param, out CQ_Value returnValue, bool mustEqual)
        {
            UnityEngine.Vector3 obj = (UnityEngine.Vector3)objSelf;
            if (param.Count == 3 && functionName == "Set" && MatchType(param, new Type[] { typeof(float), typeof(float), typeof(float) }, mustEqual))
            {
                returnValue = null;
                obj.Set((float)param[0].ConvertTo(typeof(float)), (float)param[1].ConvertTo(typeof(float)), (float)param[2].ConvertTo(typeof(float)));
                return(true);
            }
            if (param.Count == 1 && functionName == "Scale" && MatchType(param, new Type[] { typeof(UnityEngine.Vector3) }, mustEqual))
            {
                returnValue = null;
                obj.Scale((UnityEngine.Vector3)param[0].ConvertTo(typeof(UnityEngine.Vector3)));
                return(true);
            }
            if (param.Count == 0 && functionName == "GetHashCode")
            {
                returnValue       = new CQ_Value();
                returnValue.type  = typeof(int);
                returnValue.value = obj.GetHashCode();
                return(true);
            }
            if (param.Count == 1 && functionName == "Equals" && MatchType(param, new Type[] { typeof(object) }, mustEqual))
            {
                returnValue       = new CQ_Value();
                returnValue.type  = typeof(bool);
                returnValue.value = obj.Equals((object)param[0].ConvertTo(typeof(object)));
                return(true);
            }
            if (param.Count == 0 && functionName == "Normalize")
            {
                returnValue = null;
                obj.Normalize();
                return(true);
            }
            if (param.Count == 0 && functionName == "ToString")
            {
                returnValue       = new CQ_Value();
                returnValue.type  = typeof(string);
                returnValue.value = obj.ToString();
                return(true);
            }
            if (param.Count == 1 && functionName == "ToString" && MatchType(param, new Type[] { typeof(string) }, mustEqual))
            {
                returnValue       = new CQ_Value();
                returnValue.type  = typeof(string);
                returnValue.value = obj.ToString((string)param[0].ConvertTo(typeof(string)));
                return(true);
            }
            if (param.Count == 0 && functionName == "GetType")
            {
                returnValue       = new CQ_Value();
                returnValue.type  = typeof(System.Type);
                returnValue.value = obj.GetType();
                return(true);
            }

            returnValue = null;
            return(false);
        }
 public override int GetHashCode()
 {
     unchecked
     {
         var hashCode = PrefabIndex;
         hashCode = (hashCode * 397) ^ Scale.GetHashCode();
         hashCode = (hashCode * 397) ^ Position.GetHashCode();
         hashCode = (hashCode * 397) ^ BoundingBox.GetHashCode();
         hashCode = (hashCode * 397) ^ Rotation.GetHashCode();
         hashCode = (hashCode * 397) ^ ProjectedArea.GetHashCode();
         hashCode = (hashCode * 397) ^ IsOccluding.GetHashCode();
         return(hashCode);
     }
 }
 public override int GetHashCode()
 {
     unchecked
     {
         // ReSharper disable NonReadonlyMemberInGetHashCode
         var hashCode = PrefabIndex;
         hashCode = (hashCode * 397) ^ Scale.GetHashCode();
         hashCode = (hashCode * 397) ^ Position.GetHashCode();
         hashCode = (hashCode * 397) ^ BoundingBox.GetHashCode();
         hashCode = (hashCode * 397) ^ Rotation.GetHashCode();
         hashCode = (hashCode * 397) ^ ProjectedArea.GetHashCode();
         // ReSharper restore NonReadonlyMemberInGetHashCode
         return(hashCode);
     }
 }
示例#4
0
 static int GetHashCode(IntPtr L)
 {
     try
     {
         ToLua.CheckArgsCount(L, 1);
         UnityEngine.Vector3 obj = (UnityEngine.Vector3)ToLua.CheckObject(L, 1, typeof(UnityEngine.Vector3));
         int o = obj.GetHashCode();
         LuaDLL.lua_pushinteger(L, o);
         ToLua.SetBack(L, 1, obj);
         return(1);
     }
     catch (Exception e)
     {
         return(LuaDLL.toluaL_exception(L, e));
     }
 }