This file contains hidden or 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
using System.Collections; | |
using System.Collections.Generic; | |
using UnityEngine; | |
using UnityEngine.Playables; | |
using UnityEngine.Animations; | |
public class LayerAnimation : MonoBehaviour { | |
PlayableGraph graph; | |
AnimationMixerPlayable mixer; |
This file contains hidden or 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
using System.Collections; | |
using System.Collections.Generic; | |
using UnityEngine; | |
using UnityEngine.Playables; | |
using UnityEngine.Animations; | |
using UnityEngine.Timeline; | |
[RequireComponent(typeof(Animator))] | |
[DisallowMultipleComponent] | |
public class SimpleAnimator : MonoBehaviour |
This file contains hidden or 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
//父进程 | |
var cp = require('child_process'); | |
var forkChildProcess = function(sendData){ | |
return function(cb){ | |
var child = cp.fork('./server/childProcess.js'); | |
child.on('message', function(msg){ | |
cb(null, msg); | |
}); | |
child.send(sendData); | |
} |
This file contains hidden or 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
//发送短信 | |
public void sendSMS(String tel, String msg){ | |
PendingIntent paIntent = PendingIntent.getBroadcast(this, 0, new Intent(), 0); | |
SmsManager sms = SmsManager.getDefault(); | |
sms.sendTextMessage(tel, null, msg, paIntent, null); | |
} | |
//UUID | |
public String getMyUUID(){ | |
TelephonyManager tm = (TelephonyManager)getBaseContext().getSystemService("phone"); |
This file contains hidden or 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 org.cocos2dx.cpp; | |
import org.cocos2dx.lib.Cocos2dxActivity; | |
import org.cocos2dx.lib.Cocos2dxGLSurfaceView; | |
import android.content.Context; | |
import android.content.Intent; | |
import android.os.Bundle; | |
import android.os.Handler; | |
import android.os.Message; |
This file contains hidden or 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
import android.net.ConnectivityManager; | |
import android.net.NetworkInfo; | |
public static int isNetworkAvailable(){ | |
ConnectivityManager mConnMgr = (ConnectivityManager) appActivity.getSystemService(Context.CONNECTIVITY_SERVICE); | |
NetworkInfo mWifi = mConnMgr.getNetworkInfo(ConnectivityManager.TYPE_WIFI); | |
NetworkInfo mMobile = mConnMgr.getNetworkInfo(ConnectivityManager.TYPE_MOBILE); | |
if(mWifi != null && mWifi.isAvailable() && mWifi.isConnected()){ | |
return 1; |
This file contains hidden or 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
if(!cc.GLProgram.createWithByteArrays){ | |
cc.GLProgram.createWithByteArrays = function(vert, frag){ | |
var shader = cc.GLProgram.create(); | |
shader.initWithVertexShaderByteArray(vert, frag); | |
shader.link(); | |
shader.updateUniforms(); | |
setTimeout(function(){ | |
shader.link(); | |
shader.updateUniforms(); | |
}, 0); |
This file contains hidden or 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
outline: none; | |
-webkit-tap-highlight-color: rgba(255, 255, 255, 0); | |
-webkit-focus-ring-color: rgba(0, 0, 0, 0); |
This file contains hidden or 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
HttpPost request = new HttpPost(url); | |
// 先封装一个 JSON 对象 | |
JSONObject param = new JSONObject(); | |
param.put("name", "rarnu"); | |
param.put("password", "123456"); | |
// 绑定到请求 Entry | |
StringEntity se = new StringEntity(param.toString()); | |
request.setEntity(se); | |
// 发送请求 | |
HttpResponse httpResponse = new DefaultHttpClient().execute(request); |
This file contains hidden or 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
import urllib2,os,hashlib; h = '7183a2d3e96f11eeadd761d777e62404' + 'e330c659d4bb41d3bdf022e94cab3cd0'; pf = 'Package Control.sublime-package'; ipp = sublime.installed_packages_path(); os.makedirs( ipp ) if not os.path.exists(ipp) else None; urllib2.install_opener( urllib2.build_opener( urllib2.ProxyHandler()) ); by = urllib2.urlopen( 'http://sublime.wbond.net/' + pf.replace(' ', '%20')).read(); dh = hashlib.sha256(by).hexdigest(); open( os.path.join( ipp, pf), 'wb' ).write(by) if dh == h else None; print('Error validating download (got %s instead of %s), please try manual install' % (dh, h) if dh != h else 'Please restart Sublime Text to finish installation') |
NewerOlder