麦甜甜圈


  • 首页

  • 分类

  • 关于

  • 过往作品

  • 一些个有意思的链接

MonoDevelop 找不到 UnityEngine 上下文的解决方法

发表于 2019-05-25 | 分类于 笔记 |

问题

使用 MonoDevelop 编辑代码时出现了错误:

Error CS01013: The name ‘UnityEngine’ does not exist in the current context.

pic

找不到 UnityEngine 类库,所有相关方法都标红显示错误,但是 Unity 编辑器可以正常编译运行。

原因

自行编辑过项目的代码格式: Project > Assembly-CSharp options > Source Code > Code Formatting,导致 Assembly-CSharp.csproj 文件被插入了配置代码:

1
2
3
4
5
6
7
8
9
10
<ProjectExtensions xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<MonoDevelop>
<Properties>
<Policies>
<TextStylePolicy inheritsSet="null" scope="text/x-csharp"/>
<CSharpFormattingPolicy NamespaceBraceStyle="EndOfLine" ClassBraceStyle="EndOfLine" InterfaceBraceStyle="EndOfLine" StructBraceStyle="EndOfLine" EnumBraceStyle="EndOfLine" MethodBraceStyle="EndOfLine" ConstructorBraceStyle="EndOfLine" DestructorBraceStyle="EndOfLine" BeforeMethodDeclarationParentheses="False" BeforeMethodCallParentheses="False" BeforeConstructorDeclarationParentheses="False" BeforeIndexerDeclarationBracket="False" BeforeDelegateDeclarationParentheses="False" AfterDelegateDeclarationParameterComma="True" NewParentheses="False" SpacesBeforeBrackets="False" inheritsSet="Mono" inheritsScope="text/x-csharp" scope="text/x-csharp"/>
</Policies>
</Properties>
</MonoDevelop>
</ProjectExtensions>

解决

删除 Assembly-CSharp.csproj 文件,重新在 Unity 编辑器中打开代码文件,生成新的项目文件。

  • 注意,修改配置需要操作的是项目根节点的配置,而不是 Assembly-CSharp 或 Assembly-CSharp-Editor 项目的配置。

wukong-robot智能音箱折腾笔记

发表于 2019-04-30 | 分类于 树莓派 |

周末尝试在自己的树莓派上安装了一下 wukong-robot智能音箱,使用起来非常简单的智能音箱项目,记录一下安装和使用时用到的工具和踩的坑,留作之后扩展编码使用。

pic

阅读全文 »

小米 MIX 一次全屏问题解决笔记

发表于 2019-04-29 | 分类于 笔记 |

问题描述

有玩家报告工地游戏在开启全面屏并隐藏虚拟键的小米 MIX 手机上无法全屏,表现为:

screen

解决方法

在 设置->全面屏->应用全屏运行设置 里给应用开启全屏模式。

下边是折腾的过程,最后才发现是这个系统设置的问题,所以没有兴趣的可以跳过。

阅读全文 »

RPG Maker XP/VX 控制台窗口

发表于 2019-04-15 | 分类于 RPG Maker |

为XP、VX增加通用控制台窗口,用于调试,发布时需要去掉
脚本:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
#==============================================================================
# ■ Kernel
#------------------------------------------------------------------------------
#  该模块中定义了可供所有类使用的方法。Object 类中包含了该模块。
#==============================================================================
module Kernel
#--------------------------------------------------------------------------
# ● 需要的 Windows API 函数
#--------------------------------------------------------------------------
GetWindowThreadProcessId = Win32API.new("user32", "GetWindowThreadProcessId", "LP", "L")
GetWindow = Win32API.new("user32", "GetWindow", "LL", "L")
GetClassName = Win32API.new("user32", "GetClassName", "LPL", "L")
GetCurrentThreadId = Win32API.new("kernel32", "GetCurrentThreadId", "V", "L")
GetForegroundWindow = Win32API.new("user32", "GetForegroundWindow", "V", "L")
#--------------------------------------------------------------------------
# ● 获取窗口句柄
#--------------------------------------------------------------------------
def get_hWnd
# 获取调用线程(RM 的主线程)的进程标识
threadID = GetCurrentThreadId.call
# 获取 Z 次序中最靠前的窗口
hWnd = GetWindow.call(GetForegroundWindow.call, 0)
# 枚举所有窗口
while hWnd != 0
# 如果创建该窗口的线程标识匹配本线程标识
if threadID == GetWindowThreadProcessId.call(hWnd, 0)
# 分配一个 11 个字节的缓冲区
className = " " * 11
# 获取该窗口的类名
GetClassName.call(hWnd, className, 12)
# 如果匹配 RGSS Player 则跳出循环
break if className == "RGSS Player"
end
# 获取下一个窗口
hWnd = GetWindow.call(hWnd, 2)
end
return hWnd
end
end
module Kernel
Console = Win32API.new('kernel32', 'AllocConsole', 'v', 'v').call
Conout = File.open("CONOUT$", "w")
def p(str)
Conout.write str.inspect
Conout.write "\n"
Conout.flush
end
#显示控制台
def show_console
_console_switch
end
#隐藏控制台
def hide_console
_console_switch(false)
end
#
def _console_switch(show = true)
Win32API.new('user32', 'ShowWindow', 'll', 'l').call(
Win32API.new('kernel32', 'GetConsoleWindow', 'v', 'l').call, show ? 5 : 0
)
end
def facus_this
hWnd = Kernel.get_hWnd
Win32API.new('user32', 'SetForegroundWindow', 'l', 'l').call(
hWnd
)
end
end
facus_this

【转载】RPG Maker通用脚本收集-打印异常堆栈

发表于 2019-04-11 | 分类于 RPG Maker |

原地址:https://rpg.blue/thread-409158-1-1.html
原作者: SailCat

用于显示异常堆栈详情。

脚本内容根据评论有修改。

VA版脚本:
用法:替换main脚本

1
2
3
4
5
6
7
8
9
10
11
begin
rgss_main { SceneManager.run }
rescue StandardError
# 加载脚本数据结构
scripts = $RGSS_SCRIPTS
# 显示出错详细信息
t = $!.backtrace.collect do |s|
s.sub(/^{([0-9]+)}/) {"#<#{scripts[$1.to_i][1]}>"}
end
msgbox [$!.class, "-" * 80, $!.message, "-" * 80, t].flatten.join("\n")
end

【转载】RPG Maker通用脚本收集-打印Eval错误调用详情

发表于 2019-04-11 | 分类于 RPG Maker |

原地址:https://rpg.blue/thread-249703-1-1.html
原作者: 叶子

用于显示eval调用发生错误时的堆栈详情。
脚本:

阅读全文 »

倒着的英文

发表于 2018-11-26 | 分类于 HTML |

生成倒映的小写英文:












源码:

阅读全文 »

Unity循环图片Shader

发表于 2018-11-06 | 分类于 Unity3D |

概述

循环图 Shader

  • 将需要的图拖到Loop贴图上,MainTex用于控制区域大小,本身不显示

效果

效果

代码

阅读全文 »

Unity擦除Tilemap上的图块后cellBounds大小未改变的解决方法

发表于 2018-09-13 | 分类于 Unity3D |

问题

试用原生 Tilemap 取地图大小时发现在地图上绘制图块后,就算擦掉图块,Grid 的 cellBounds 大小也会一直保留被擦掉的图块占用的部分。

原因

来自官方解释

The size of the Tilemap represents the largest bounds which was previously covered by the Tilemap. For performance reasons, erasing tiles does not automatically reduce the size of the Tilemap .

解决

  • 对 Tilemap 组件点击设置按钮 -> Compress Tilemap Bounds

或

  • 使用代码
1
tilemap.CompressBounds();

关闭IrfanView浏览图片抗锯齿功能

发表于 2018-08-26 | 分类于 笔记 |

IrfanView是自己经常用的一款小众图片浏览软件,安装包+简体中文语言包只有3MB。
由于自己经常浏览像素图,所以需要关闭放大时的抗锯齿功能。关闭方式如下:

  1. 菜单-查看-显示选项-关闭 使用重采样调整图像
  2. 菜单-查看-显示选项-关闭 使用重采样用于缩放
123…5
烁灵SureBrz

烁灵SureBrz

50 日志
13 分类
47 标签
邻家的小屋
  • 哈库纳玛塔塔(原23RPG)论坛
  • 橡皮擦擦
  • ShiinaYASHIRO Games
© 2013 - 2024 烁灵SureBrz |
由 Hexo 强力驱动
主题 - NexT.Mist