示例#1
0
 public void Call(Logic.Character.EnemyPlayerEntity param0)
 {
     func.BeginPCall();
     func.Push(param0);
     func.PCall();
     func.EndPCall();
 }
    static int set_petEntity(IntPtr L)
    {
        object o = null;

        try
        {
            o = ToLua.ToObject(L, 1);
            Logic.Character.EnemyPlayerEntity obj  = (Logic.Character.EnemyPlayerEntity)o;
            Logic.Character.PetEntity         arg0 = (Logic.Character.PetEntity)ToLua.CheckUnityObject(L, 2, typeof(Logic.Character.PetEntity));
            obj.petEntity = arg0;
            return(0);
        }
        catch (Exception e)
        {
            return(LuaDLL.toluaL_exception(L, e, o == null ? "attempt to index petEntity on a nil value" : e.Message));
        }
    }
    static int get_petEntity(IntPtr L)
    {
        object o = null;

        try
        {
            o = ToLua.ToObject(L, 1);
            Logic.Character.EnemyPlayerEntity obj = (Logic.Character.EnemyPlayerEntity)o;
            Logic.Character.PetEntity         ret = obj.petEntity;
            ToLua.Push(L, ret);
            return(1);
        }
        catch (Exception e)
        {
            return(LuaDLL.toluaL_exception(L, e, o == null ? "attempt to index petEntity on a nil value" : e.Message));
        }
    }
示例#4
0
        public void Despawn(string poolName, Logic.Character.CharacterEntity character)
        {
            SpawnPool spawnPool = Pool.Controller.PoolController.instance.GetPool(poolName);

            if (spawnPool)
            {
                if (character is Logic.Character.PlayerEntity)
                {
                    Logic.Character.PlayerEntity playerEntity = character as Logic.Character.PlayerEntity;
                    if (playerEntity.petEntity != null)
                    {
                        LockTransform lockTransform = playerEntity.petEntity.gameObject.GetComponent <LockTransform>();
                        if (lockTransform)
                        {
                            lockTransform.trans = null;
                        }
                        Despawn(playerEntity.petEntity.name, playerEntity.petEntity.transform);
                    }
                    playerEntity.petEntity = null;
                }
                else if (character is Logic.Character.EnemyPlayerEntity)
                {
                    Logic.Character.EnemyPlayerEntity enemyPlayerEntity = character as Logic.Character.EnemyPlayerEntity;
                    if (enemyPlayerEntity.petEntity != null)
                    {
                        LockTransform lockTransform = enemyPlayerEntity.petEntity.gameObject.GetComponent <LockTransform>();
                        if (lockTransform)
                        {
                            lockTransform.trans = null;
                        }
                        Despawn(enemyPlayerEntity.petEntity.name, enemyPlayerEntity.petEntity.transform);
                    }
                    enemyPlayerEntity.petEntity = null;
                }
                character.transform.SetParent(spawnPool.transform, false);
                spawnPool.Despawn(character.transform);
            }
        }