static object PerformMemberwiseClone(ref object o)
        {
            var ins = new UnityEngine.AI.NavMeshLinkInstance();

            ins = (UnityEngine.AI.NavMeshLinkInstance)o;
            return(ins);
        }
        static StackObject *RemoveLink_17(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, 1);

            ptr_of_this_method = ILIntepreter.Minus(__esp, 1);
            UnityEngine.AI.NavMeshLinkInstance handle = (UnityEngine.AI.NavMeshLinkInstance) typeof(UnityEngine.AI.NavMeshLinkInstance).CheckCLRTypes(StackObject.ToObject(ptr_of_this_method, __domain, __mStack));
            __intp.Free(ptr_of_this_method);

            UnityEngine.AI.NavMesh.RemoveLink(handle);

            return(__ret);
        }
 /// <summary>
 /// Read the data using the reader.
 /// </summary>
 /// <param name="reader">Reader.</param>
 public override object Read(ISaveGameReader reader)
 {
     UnityEngine.AI.NavMeshLinkInstance navMeshLinkInstance = new UnityEngine.AI.NavMeshLinkInstance();
     foreach (string property in reader.Properties)
     {
         switch (property)
         {
         case "owner":
             Type ownerType = Type.GetType(reader.ReadProperty <System.String> ());
             navMeshLinkInstance.owner = (UnityEngine.Object)reader.ReadProperty(ownerType);
             break;
         }
     }
     return(navMeshLinkInstance);
 }
        static void WriteBackInstance(CSHotFix.Runtime.Enviorment.AppDomain __domain, StackObject *ptr_of_this_method, IList <object> __mStack, ref UnityEngine.AI.NavMeshLinkInstance instance_of_this_method)
        {
            ptr_of_this_method = ILIntepreter.GetObjectAndResolveReference(ptr_of_this_method);
            switch (ptr_of_this_method->ObjectType)
            {
            case ObjectTypes.Object:
            {
                __mStack[ptr_of_this_method->Value] = instance_of_this_method;
            }
            break;

            case ObjectTypes.FieldReference:
            {
                var ___obj = __mStack[ptr_of_this_method->Value];
                if (___obj is ILTypeInstance)
                {
                    ((ILTypeInstance)___obj)[ptr_of_this_method->ValueLow] = instance_of_this_method;
                }
                else
                {
                    var t = __domain.GetType(___obj.GetType()) as CLRType;
                    t.SetFieldValue(ptr_of_this_method->ValueLow, ref ___obj, instance_of_this_method);
                }
            }
            break;

            case ObjectTypes.StaticFieldReference:
            {
                var t = __domain.GetType(ptr_of_this_method->Value);
                if (t is ILType)
                {
                    ((ILType)t).StaticInstance[ptr_of_this_method->ValueLow] = instance_of_this_method;
                }
                else
                {
                    ((CLRType)t).SetStaticFieldValue(ptr_of_this_method->ValueLow, instance_of_this_method);
                }
            }
            break;

            case ObjectTypes.ArrayReference:
            {
                var instance_of_arrayReference = __mStack[ptr_of_this_method->Value] as UnityEngine.AI.NavMeshLinkInstance[];
                instance_of_arrayReference[ptr_of_this_method->ValueLow] = instance_of_this_method;
            }
            break;
            }
        }
Esempio n. 5
0
        static int _m_AddLink_xlua_st_(RealStatePtr L)
        {
            ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L);



            int __gen_param_count = LuaAPI.lua_gettop(L);

            try {
                if (__gen_param_count == 1 && translator.Assignable <UnityEngine.AI.NavMeshLinkData>(L, 1))
                {
                    UnityEngine.AI.NavMeshLinkData link; translator.Get(L, 1, out link);

                    UnityEngine.AI.NavMeshLinkInstance __cl_gen_ret = UnityEngine.AI.NavMesh.AddLink(link);
                    translator.Push(L, __cl_gen_ret);



                    return(1);
                }
                if (__gen_param_count == 3 && translator.Assignable <UnityEngine.AI.NavMeshLinkData>(L, 1) && translator.Assignable <UnityEngine.Vector3>(L, 2) && translator.Assignable <UnityEngine.Quaternion>(L, 3))
                {
                    UnityEngine.AI.NavMeshLinkData link; translator.Get(L, 1, out link);
                    UnityEngine.Vector3            position; translator.Get(L, 2, out position);
                    UnityEngine.Quaternion         rotation; translator.Get(L, 3, out rotation);

                    UnityEngine.AI.NavMeshLinkInstance __cl_gen_ret = UnityEngine.AI.NavMesh.AddLink(link, position, rotation);
                    translator.Push(L, __cl_gen_ret);



                    return(1);
                }
            } catch (System.Exception __gen_e) {
                return(LuaAPI.luaL_error(L, "c# exception:" + __gen_e));
            }

            return(LuaAPI.luaL_error(L, "invalid arguments to UnityEngine.AI.NavMesh.AddLink!"));
        }
 /// <summary>
 /// Write the specified value using the writer.
 /// </summary>
 /// <param name="value">Value.</param>
 /// <param name="writer">Writer.</param>
 public override void Write(object value, ISaveGameWriter writer)
 {
     UnityEngine.AI.NavMeshLinkInstance navMeshLinkInstance = (UnityEngine.AI.NavMeshLinkInstance)value;
     writer.WriteProperty("ownerType", navMeshLinkInstance.owner.GetType().AssemblyQualifiedName);
     writer.WriteProperty("owner", navMeshLinkInstance.owner);
 }