2022年8月25日 星期四

[Discord]機器人的的login與接收訊息/反應(discord.js:14.3)

 最近又開始寫起Discord機器人, 用的discord.js是14.3的版本, 跟上次寫的時候用的12.3版有一些差異, 於此記錄一下


Login

12.3的login:
const { Client } = require('discord.js'); const client = new Client({ partials: [/*需要的partial字串, ex:'CHANNEL'*/] }); client.login(/*機器人的token*/);

14.3的login:
const { Client, GatewayIntentBits, Partials } = require('discord.js'); const client = new Client({ intents: [/*需要的GatewayIntentBits列舉, ex:GatewayIntentBits.Guilds*/], partials: [/*需要的Partials列舉, ex: Partials.Channel*/] }); client.login(/*機器人的token*/);

2021年3月15日 星期一

[Unity]Game Window的Aspect ratio與Fixed Resolution

Game Window是Unity編輯器中用來顯示玩家視角的視窗,常用來在編輯器中檢視run time時玩家的視角。

其左上有一欄位為調整該視窗顯示用的解析度或長寬比,預設是Free Aspect(不固定比例),意即

2020年10月4日 星期日

[Unity]In-App Purchasing使用教學-Android@Google 篇

In-App Purchasing是Unity提供的跨平台IAP服務

本篇將介紹如何使用In-App Purchasing設定到Google Play Developer Console的商品

本篇教學軟體環境如下:

2017年10月8日 星期日

[Unity]Resources.Load效能測試

儘管官方自己都說不建議使用Resources資料夾, 但是在能取代其便利性的資源載入方案出現前, Resources資料夾仍是我們有快速開發需求時的好朋友

我們使用Resources資料夾內資源, 常用步驟為:

2017年9月9日 星期六

[Unity]物件 顯示/隱藏 之簡易效能評比

我們要在Unity控制物件於畫面中的顯示/隱藏時, 主要方法有:
  • 使用GameObject.SetActive直接開關整個GameObject
  • 開關GameObject上的Render
  • 將GameObject移進/移出畫面

2017年6月4日 星期日

[Unity]Remote Settings 簡介與實作

這篇的Remote Settings不是那個裝置與Unity Editor連線測試的Unity Remote呦, 他是 Unity Analytics Service 底下的一個功能😄

Remote Settings提供開發者一個方便更新數值的管道, 可以不必跟新輸出檔、不必自己架server, 即可實現遊戲數值的熱跟新, 而且目前是免費的

2017年4月27日 星期四

[Unity]AssetBundleManager & AssetBundleGraphTool 之整合使用

AssetBundle Manager是官方提供的bundle管理器, 能夠方便的讀取, 以及模擬測試bundle, 可從Asset Store免費下載(https://www.assetstore.unity3d.com/en/#!/content/45836)


AssetBundleGraphTool 則是Unity日本開發的圖形化打包工具, 能夠很輕鬆的設計自動化打包流程, 也是開源免費(https://bitbucket.org/Unity-Technologies/assetbundlegraphtool)


AssetBundle Manager有附帶快速打包的工具, 但我們必須為要打包的物件設定包名(甚至variants)