分类

链接

2025 年 4 月
 123456
78910111213
14151617181920
21222324252627
282930  

近期文章

热门标签

新人福利,免费薅羊毛

unity 让物体上下来回移动

float speed = 1; //物体的速度int DirectionY = 1; //物体Y轴移动的方向,值是-1跟1void Update () {//物体的移动transform.Translate(new Vector3(0,DirectionY * speed * Time.deltaTime,0));//判断是不是超出范围,如果是就转方向if (transform.position.y >= 4) {DirectionY = -1;}if (transform.position.y <= -4) {DirectionY = 1;}}

Unity3D 暂无评论 阅读(366)

Unity2D 平台类游戏 人物移动

通常使用刚体与碰撞体共同构成人物移动的物理系统。有这么几点需要注意:1、动态刚体一旦与一个没有弹性的碰撞体碰撞了后,那么其速度立刻变为0,并且不会反弹回来,没有其他操作,其速度一直为0,并且只有动态刚体才能与其他的碰撞体发生反应,调用OnColliderEnter和OnTriggerEnter。2、动态刚体使用AddForce,它真的应用了物理模拟。也就是说,F*S=0.5*m*V^2。只要你一直给它加力,那么这个动态刚体就会一直获得动能,它的速度就会一直加快。如果没有设置线性阻尼,没有与groud的摩擦力,那么这个物体就会一...

Unity3D 暂无评论 阅读(161)

unity3D导出模块给android使用

集成unity项目到android studio原生工程(非原生工程集成到unity),实现android和unity交互1. 将Unity工程已android studio形式导出2. Android studio已module引用方式引入导出的unity工程3, 修改unity工程gradle文件4. 修改unity工程AndroidManifest.xml文件5.原生项目以module引用unity项目6.修改主AndroidManifest.xml,添加activity节点,用于显示unity页面用于显示unity的activity(本例ChirstmasARActivity)节点,需要添加process属性,否则将由于主线程超时造成程序闪退Android和Unity交互:...

Android, Unity3D 暂无评论 阅读(283)

microk8s和k3s

MicroK8s与K3s都是基于Kubernetes的轻量级发行版,主要面向工作站、边缘计算、物联网等应用场景,但二者也有比较大的区别。主要区别MicroK8s主要将一些扩展件集成到系统中,而K3s却将很多扩展件独立出来。虽然MicroK8s与K3s都能支持ARM体系的低功耗计算,但是MicroK8s主打使用方便性,也更适合开发团队使用,而K3s主打轻量化,更适合低功耗的小型化无人值守的自动化系统使用。MicroK8s的集群管理内核与Kubernetes标准版的容器镜像是完全一样的,而K3s的内核进行了一些修改,部分模块可能由于兼容性问题无法运...

k8s 暂无评论 阅读(179)

关于JS中this的指向,这里有讲得比较清楚的,收藏一下

JS中this关键字很常见,但是它似乎变幻莫测,让人抓狂。这篇文章就来揭示其中的奥秘。借助阮一峰老师的话:它代表函数运行时,自动生成的一个内部对象,只能在函数内部使用。这句话看似平常,可是要非常注意三个字:“运行时”,这说明this关键字只与函数的执行环境有关,而与声明环境没有关系。也就是这个this到底代表的是什么对象要等到函数运行时才知道,有点类似函数定义时的参数列表只在函数调用时才传入真正的对象。理解了这一点对后面this关键字规律的掌握有很大帮助。this关键字虽然会根据环境变化,但是...

前端 暂无评论 阅读(211)

python常用(1)

# encoding: utf-8from openpyxl.reader.excel import load_workbook  # FOR xlsximport osimport openpyxlfrom decimal import Decimalimport shutilimport zipfile  path = os.getcwd() testplan = path + "\\testplan.xlsx" mapping_path = os.path.join(path, "MUT_Product_Mapping.xlsx")#print(mapping_path)workbook = load_workbook(mapping_path)worksheet = workbook.worksheets[0] mapping = {} for index, item in enumerate(worksheet.rows):        # START with  age row...

Python 暂无评论 阅读(214)

k8s之Service

kind: ServiceapiVersion: v1metadata:  name: mysql-svc  namespace: default  labels:    name: mysql-svcspec:  ports:    - name: http      protocol: TCP      port: 3306      targetPort: 3306      nodePort: 33306  selector:    name: mysql-pod  type: NodePort

k8s 暂无评论 阅读(203)

k8s之PersistentVolume&PersistentVolumeClaim

kind:PersistentVolumeapiVersion: v1metadata:  name: mysql-pvspec:  capacity:    storage:1Gi  hostPath:    path:/home/work/share/mysql    type:''  accessModes:-ReadWriteOnce  claimRef:    kind:PersistentVolumeClaimnamespace:default    name: mysql-pvc  persistentVolumeReclaimPolicy:Retain  volumeMode:Filesystem kind: PersistentVolumeClaimapiVersion: v1metadata:  name: mysql-pvc  namespace: default  labels:    app: mysql-pvcspec:  accessM...

k8s 暂无评论 阅读(187)

k8s之ReplicationController

kind: ReplicationControllerapiVersion: v1metadata:  name: mysql-rc  namespace: default  uid: 946f2c6a-f7ac-4412-b3c9-3741fe668717  resourceVersion: '1299573'  generation: 3  creationTimestamp: '2021-05-17T09:16:19Z'  labels:    name: mysql-rcspec:  replicas: 1  selector:    name: mysql-pod  template:    metadata:      labels:        name: mysql-pod    spec:      volumes:        - name: mysql-storage          persistentVolumeClaim:            claimN...

k8s, MySQL 暂无评论 阅读(203)

k8s deployment with persistentVolume

kind: DeploymentapiVersion: apps/v1metadata:  name: mut-deployment  namespace: default  labels:    app: mutspec:  replicas: 1  selector:    matchLabels:      app: mut  template:    metadata:      labels:        app: mut    spec:      volumes:        - name: testcase-storage          persistentVolumeClaim:            claimName: mut-pvc      containers:        - name: mut          image: 'mut:20210531'          ports:            - containerPort: 80...

k8s 暂无评论 阅读(199)