Commit 52a37745 authored by haiyoucuv's avatar haiyoucuv

init

parent d5dfa462
# 免费登录页-正式
# https://activity.m.duiba.com.cn/customShare/share?id=Did1NTc3NTE
### 免费登录页-测试
### https://activity.m.duiba.com.cn/customShare/share?id=Did1NTc1OTk
......@@ -1168,7 +1168,7 @@
"__id__": 31
},
"debugMaterial": null,
"_id": "0170hzm29NjqN8GPRvbRKp"
"_id": "9d+RdU59dPA41uxbCiVcAe"
},
{
"__type__": "CinestationBlendDefinition",
......@@ -3040,6 +3040,9 @@
"player": {
"__id__": 54
},
"camera": {
"__id__": 28
},
"initWall": {
"__id__": 33
},
......
......@@ -2,20 +2,22 @@ import {
_decorator,
Collider,
Color,
easing, EPhysicsDrawFlags, game,
easing,
ICollisionEvent,
Input,
input,
instantiate,
ITriggerEvent,
Label, lerp,
Light, MeshRenderer,
Label,
lerp,
Light,
MeshRenderer,
Node,
ParticleSystem, ParticleSystemComponent,
ParticleSystem,
PhysicsSystem,
PointToPointConstraint,
Prefab,
RigidBody, Texture2D,
RigidBody,
Tween,
tween,
v3,
......@@ -28,7 +30,7 @@ import GameMgr from "../../GameMgr";
import { AudioMgr } from "../../../core_tgx/base/AudioMgr";
import { BgAndColor } from "./BgAndColor";
const {ccclass, property} = _decorator;
const { ccclass, property } = _decorator;
@ccclass("MainGame")
......@@ -44,7 +46,6 @@ export class MainGame extends Scene {
playerBody: RigidBody = null;
playerConstraint: PointToPointConstraint = null;
@property(Node) initWall: Node = null;
@property(Prefab) wallPrefab: Prefab = null;
......@@ -54,11 +55,11 @@ export class MainGame extends Scene {
@property(Light) light: Light = null;
@property({type: Label, group: "UI"}) scoreLabel: Label = null;
@property({type: Node, group: "UI"}) hitTip: Node = null;
@property({ type: Label, group: "UI" }) scoreLabel: Label = null;
@property({ type: Node, group: "UI" }) hitTip: Node = null;
@property({type: Node}) bg: Node = null;
@property({type: [BgAndColor], visible: true, displayName: `背景和颜色`})
@property({ type: Node }) bg: Node = null;
@property({ type: [BgAndColor], visible: true, displayName: `背景和颜色` })
private bgAndColor: BgAndColor[] = [];
private _score: number = 0;
......@@ -151,7 +152,7 @@ export class MainGame extends Scene {
}
onTriggerEnter(event: ITriggerEvent) {
const {otherCollider, selfCollider} = event;
const { otherCollider, selfCollider } = event;
const otherName = otherCollider.node.name;
......@@ -164,9 +165,9 @@ export class MainGame extends Scene {
this.unschedule(this.scoreRadioFunc);
this.scheduleOnce(this.scoreRadioFunc, 5);
tween(this.hitTip)
.set({active: true})
.set({ active: true })
.delay(2)
.set({active: false})
.set({ active: false })
.start();
const crushNode = instantiate(this.crushPrefab);
......@@ -183,7 +184,7 @@ export class MainGame extends Scene {
onPlayerCollision(event: ICollisionEvent) {
if (this.isOver) return;
const {otherCollider, selfCollider} = event;
const { otherCollider, selfCollider } = event;
const otherGroup = otherCollider.getGroup();
......@@ -211,12 +212,12 @@ export class MainGame extends Scene {
changeMainColor() {
this.randomMainColor();
const {bg, color} = this.mainColor;
const { bg, color } = this.mainColor;
this.bg.getComponent(MeshRenderer).material.setProperty("mainTexture", bg);
this.lightTween?.removeSelf();
this.lightTween = tween({radio: 0})
.to(1, {radio: 1}, {
this.lightTween = tween({ radio: 0 })
.to(1, { radio: 1 }, {
easing: easing.quadInOut,
onUpdate: (target, ratio) => {
this.lightColor.lerp(color, ratio);
......@@ -310,7 +311,7 @@ export class MainGame extends Scene {
const propLen = this.propCFG.length;
let create = false;
for (let i = 0; i < propLen; i++) {
const {lastZ, interval} = this.propCFG[i];
const { lastZ, interval } = this.propCFG[i];
const dz = lastZ - pz;
if (create) {
this.propCFG[i].lastZ = pz;
......@@ -331,7 +332,7 @@ export class MainGame extends Scene {
wallTs.reset();
for (let i = 0; i < propLen; i++) {
const {funcName, create} = this.propCFG[i];
const { funcName, create } = this.propCFG[i];
if (create) {
this.propCFG[i].create = false;
wallTs[funcName]();
......
import { _decorator, Camera, lerp, clamp01, primitives, utils, Mesh, Material, Vec2, Vec3, Tween } from 'cc';
import { _decorator, Camera, lerp, clamp01, primitives, utils, Quat, Mesh, Material, Vec2, Vec3, Tween } from 'cc';
import { CinestationBlendDefinition, CinestationBlendFunc } from './CinestationBlendDefinition';
import { cinestation } from './CinestationData';
import { Nullable } from './Common/Types';
......@@ -8,6 +8,9 @@ const { ccclass, property, executionOrder, executeInEditMode } = _decorator;
let __point = new Vec2();
const tempCameraPos = new Vec3();
const tempCameraRot = new Quat();
@ccclass('CinestationBrain')
@executeInEditMode
@executionOrder(-1)
......@@ -85,9 +88,14 @@ export class CinestationBrain extends Visualization {
if (CC_EDITOR) return;
if (!cinestation.mainCamera) return;
let from = cinestation.mainCamera, to = vcam;
from.node.worldPosition = from.node.worldPosition.lerp(to.finalPosition, t);
from.node.worldRotation = from.node.worldRotation.lerp(to.finalRotation, t);
const from = cinestation.mainCamera, to = vcam;
from.node.getWorldPosition(tempCameraPos);
from.node.getWorldRotation(tempCameraRot);
from.node.setWorldPosition(tempCameraPos.lerp(to.finalPosition, t));
from.node.setWorldRotation(tempCameraRot.lerp(to.finalRotation, t));
from.fov = lerp(from.fov, to.lens.fov, t);
from.near = lerp(from.near, to.lens.near, t);
from.far = lerp(from.far, to.lens.far, t);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment