This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# 获取第一个参数 | |
ARG1="$1" | |
ROOT_FOLDER="" | |
SCRIPT_NAME="$0" | |
SCRIPT_VERSION="1.2.3" | |
VERSION="" | |
WEB_FOLDER="" | |
ORG_INDEX_FILE="index.original.html" | |
INDEX_FILE="index.html" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// JavaScript 根据需要动态加载脚本并设置参数 | |
// refer to https://xmanyou.com/javascript-dynamically-load-script-and-set-parameters/ | |
async function loadJsAsync(src:string, async:boolean=false, options?:any) { | |
return new Promise<void>((resolve, reject) => { | |
const script = document.createElement('script'); | |
script.src = src; | |
script.async = async; | |
if(options) { | |
for(const key in options) { | |
// script[key] = options[key]; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// TypeScript/JavaScript 异步等待方法的实现 | |
// refer to https://xmanyou.com/javascript-wait-until-condition-meet-or-timeout/ | |
function waitUntil(condition:()=>boolean, timeout?:number, interval?:number) { | |
if (timeout === void 0) { timeout = 0; } // if not set, wait forever | |
if (interval === void 0) { interval = 50; } // default interval = 50ms | |
let waitHandler; | |
let timeoutHandler; | |
return new Promise<void>(function (resolve, reject) { | |
var waitFn = function () { | |
if (condition()) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function tryCreateShortcutAsync(){ | |
if(!FBInstant){ | |
console.info("FBInstant Not Available"); | |
return; | |
} | |
console.info("Try Create shortcut"); | |
FBInstant.canCreateShortcutAsync() | |
.then(function(canCreateShortcut) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
defaultConfig { | |
applicationId "com.xmanyou.my.game" | |
minSdkVersion 21 | |
targetSdkVersion 30 | |
versionCode 28 | |
versionName "1.2.5" | |
def gitCommit = "git rev-parse --short HEAD".execute().text.trim() | |
archivesBaseName = "${defaultConfig.applicationId}-${defaultConfig.versionName}v${defaultConfig.versionCode}-${gitCommit}" | |
println 'outputFileName: after = ' + archivesBaseName |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
module SdkHelper{ | |
export class IronSourceHelper{ | |
public static ironsource:Laya.IPlatformClass; | |
public static init(){ | |
if(!this.ironsource){ | |
this.ironsource = Laya.PlatformClass.createClass("sdkhelper.IronSourceHelper"); | |
} | |
let js1 = `window["IronSourceHelper"].onInterstitialReadyChange(%s)`; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// https://xmanyou.com | |
// in app gradle file | |
android { | |
// ... | |
compileOptions { | |
sourceCompatibility JavaVersion.VERSION_1_8 | |
targetCompatibility JavaVersion.VERSION_1_8 | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package sdkhelper; | |
import android.content.Context; | |
import android.util.Log; | |
import com.adjust.sdk.Adjust; | |
import org.json.JSONObject; | |
import java.util.ArrayList; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 影子工作室为你提供详细步骤 https://xmanyou.com/cocos-creator-open-file-box/ | |
const {ccclass, property} = cc._decorator; | |
@ccclass | |
export default class FileBox extends cc.Component { | |
// LIFE-CYCLE CALLBACKS: | |
@property | |
containerId = "_filebox_container_"; | |
@property |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// https://xmanyou.com/cocos-creator-jie-tu-gong-neng-dai-ma/ | |
// 截图组件 (如果没有提前添加Camera组件,则会自动添加一个默认参数的Camera) | |
// 语言:Typescript | |
// Cocos Creator 版本: 2.0.5 | |
// 使用方法: | |
// 1. 在场景里添加一个Node, 把这个组件拖进去 | |
// 2. 在需要截图的地方,import, 然后调用:ScreenShotNode.take() | |
// Screenshot component | |
// typescript |