2018年10月

Ubuntu 18.04 截图工具 flameshot 

sudo apt-get install flameshot

快捷键 setting->device->keyboard   cmd "flameshot cut"

Gif录频软件 https://www.screentogif.com/

LayaAir 2.0.0 beta4

  LayaAir IDE 1.x 更新日志: https://ldc.layabox.com/layadownload/?type=layaairide-LayaAir%20IDE%201.4.0

  LayaAir IDE 2.x 更新日志: https://ldc2.layabox.com/layadownload/?type=layaairide-LayaAir%20IDE%202.0.0%20beta1

  bin里的文件有时候需要删除后重新生成

  constructor 先于 onAwake 执行

  vscode 关闭右侧预览功能 editor.minimap.enabled:false

  ./laya/chrome 文件夹  是在 调试时生成的

  git 忽略文件列表

    /.laya/chrome,/.laya/pubset.json,/bin/js,/bin/.rec,/bin/res,/bin/unpack.json,/src/ui/layaUI.max.all.ts

  svn 忽略文件列表

    .laya/chrome,bin/js,release,src/ui/layaUI.max.all.ts

   修改sprite大小不会修改附带的collider 的大小和位置 需要自己修改

  Laya.stage 默认原点 (0,0) 为左上角

  Laya.stage.transform.translate 后会改变默认原点位置 

  bin/js 通过代码模式里的 F8 生成

  bin/libs 删除后需要自己手动拷贝

  bin下其余文件夹里的内容由编辑模式的 ctrl+f12 生成

  bin/fileconfig.json

  bin/game.js

  bin/game.json

  bin/index.html

  bin/index.js

  bin/project.config.json

  bin/unpack.json

  bin/version.json

  bin/weapp-adapter.js

  collider: static 不能修改位置,kinematic 和 dynamic 可以修改位置 .

  旋转场景 不会旋转场景内 附带 kinematic 或 dynamic collider的物体.需要同时旋转这些物体

    // // 检查碰撞等级
    // // 0:未碰撞
    // // 1:前
    // // 2:中
    // // 3:后
    // public RectCheckHitBallLevel():number {
    //     // 英雄相对于自身中心点的旋转角度
    //     let heroAngleBaseOnPivot:number = this.container.rotation;
    //     heroAngleBaseOnPivot *= -1;
    //     let heroRadBaseOnPivot = Utils.AngleToRadian(heroAngleBaseOnPivot);

    //     // 球的中心点
    //     let circleCenterX = this.gameManager.BallPos.x;
    //     let circleCenterY = this.gameManager.BallPos.y;

    //     // 英雄世界坐标中心点
    //     let globalHeroCenter = this.container.localToGlobal(new Laya.Point(this.container.pivotX,this.container.pivotY));

    //     // 计算英雄未旋转时球的中心点
    //     let unrotatedCircleCenterX = Math.cos(heroRadBaseOnPivot) * (circleCenterX - globalHeroCenter.x) - Math.sin(heroRadBaseOnPivot) * (circleCenterY - globalHeroCenter.y) + globalHeroCenter.x;
    //     let unrotatedCircleCenterY = Math.sin(heroRadBaseOnPivot) * (circleCenterX - globalHeroCenter.x) + Math.cos(heroRadBaseOnPivot) * (circleCenterY - globalHeroCenter.y) + globalHeroCenter.y;

    //     // 未旋转时英雄的碰撞范围
    //     let leftTop:Laya.Point = new Laya.Point(globalHeroCenter.x - this.collider.width / 2,globalHeroCenter.y - this.collider.height / 2);
    //     let rightBottom:Laya.Point = new Laya.Point(globalHeroCenter.x + this.collider.width / 2,globalHeroCenter.y + this.collider.height / 2);

    //     //this.container.graphics.clear();
    //     //this.DrawCollider();

    //     // this.gameManager.Background.graphics.clear();
    //     // this.gameManager.Background.graphics.drawRect(leftTop.x,leftTop.y,this.collider.width,this.collider.height,null,"#FF0000",3);

    //     // this.gameManager.container.graphics.clear();
    //     // this.gameManager.container.graphics.drawRect(leftTop.x,leftTop.y,this.collider.width,this.collider.height,null,"#00FFFF",3);
        
    //     if(unrotatedCircleCenterX + this.gameManager.BallSize.x / 2 >= leftTop.x && unrotatedCircleCenterX - this.gameManager.BallSize.x / 2 <= rightBottom.x 
    //         && unrotatedCircleCenterY + this.gameManager.BallSize.y / 2 >= leftTop.y && unrotatedCircleCenterY - this.gameManager.BallSize.y / 2 <= rightBottom.y) {
    //         if(unrotatedCircleCenterY < leftTop.y + this.collider.height / 3) {
    //             return 1;
    //         } else if(unrotatedCircleCenterY < leftTop.y + this.collider.height / 3 * 2) {
    //             return 2;
    //         } else {
    //             return 3;
    //         }
    //     } else {
    //         return 0;
    //     }
    //     return 0;
    // }
View Code

旷哥  2018 10 18 [Artificial Intelligence for Games]

原文地址:https://www.cnblogs.com/revoid/p/9752384.html