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 float walkSpeed = 7.0f; //歩く速度 | |
| public float gravity = 10.0f;//重力加速度 | |
| private Vector3 velocity;//現在の速度 | |
| void Update () { | |
| //CharacterControllerを取得 | |
| CharacterController controller = GetComponent<CharacterController>(); | |
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 UnityEngine; | |
| using System.Collections; | |
| using UnityEngine.EventSystems; | |
| using System; | |
| /* | |
| * Author:LuShang | |
| * 对游戏项目中需要交互的UI事件的监听进行封装即UI监听器 | |
| * 事件:点击,按下,长按,抬起,停留在UI上方,移出UI上方,拖拽UI等等 | |
| */ | |
| public class UGUIListener : UnityEngine.EventSystems.EventTrigger |
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.UI; | |
| /* | |
| * Author:LuShang | |
| * 播放图集UI帧动画 | |
| */ | |
| public class UIAnimation : 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 LayerBlur = cc.Layer.extend({ | |
| ctor: function (blurRadius, maskColor) { | |
| this._super(); | |
| // create shader program | |
| var program = cc.GLProgram.create(res.blur_vsh, res.blur_fsh); | |
| program.addAttribute(cc.ATTRIBUTE_NAME_POSITION, cc.VERTEX_ATTRIB_POSITION); | |
| program.addAttribute(cc.ATTRIBUTE_NAME_COLOR, cc.VERTEX_ATTRIB_COLOR); | |
| program.addAttribute(cc.ATTRIBUTE_NAME_TEX_COORD, cc.VERTEX_ATTRIB_TEX_COORDS); | |
| program.link(); |
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
| from PIL import Image | |
| import glob, os | |
| for infile in glob.glob( "*.png" ): | |
| file, ext = os.path.splitext( infile ) | |
| im = Image.open( infile ) | |
| im.load() | |
| r, g, b, a = im.split() |
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
| #pragma once | |
| template <typename T> | |
| class ObjectKeeper | |
| { | |
| public: | |
| ObjectKeeper(T *ptr = nullptr) | |
| : m_ptr(ptr) | |
| { | |
| SafeRetain(); |
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
| #!/bin/sh | |
| convert_img(){ | |
| for file in `ls -a $1` | |
| do | |
| if [ x"$file" != x"." -a x"$file" != x".." ];then | |
| str="$1/$file" | |
| length=${#str} | |
| sufLength=$(($length - 4)) | |
| strSuf=${str:$sufLength:$length} |
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
| bool ZipUtils::ccCompressPvrToCCZFile(unsigned char *inBuffer,unsigned long inLength, const char *pszFileName)// inBuffer是pvr数据,inLength是pvr数据的长度 | |
| { | |
| bool bRet = false; | |
| do | |
| { | |
| if (NULL == pszFileName) { | |
| CCLOG("cocos2d: Error pszFileName NULL!"); | |
| } | |
| if(NULL == inBuffer || 0 == inLength) |
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; | |
| using UnityEditor; | |
| [InitializeOnLoad] | |
| public class ExecutionOrderManager : Editor | |
| { | |
| static ExecutionOrderManager() | |
| { | |
| foreach (MonoScript monoScript in MonoImporter.GetAllRuntimeMonoScripts()) | |
| { |
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 UnityEngine; | |
| using System.Collections; | |
| public class QuadTreeTest : MonoBehaviour { | |
| public class TestObject : IQuadTreeObject{ | |
| private Vector3 m_vPosition; | |
| public TestObject(Vector3 position){ | |
| m_vPosition = position; | |
| } | |
| public Vector2 GetPosition(){ |
NewerOlder