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 @@ ...@@ -1168,7 +1168,7 @@
"__id__": 31 "__id__": 31
}, },
"debugMaterial": null, "debugMaterial": null,
"_id": "0170hzm29NjqN8GPRvbRKp" "_id": "9d+RdU59dPA41uxbCiVcAe"
}, },
{ {
"__type__": "CinestationBlendDefinition", "__type__": "CinestationBlendDefinition",
...@@ -3040,6 +3040,9 @@ ...@@ -3040,6 +3040,9 @@
"player": { "player": {
"__id__": 54 "__id__": 54
}, },
"camera": {
"__id__": 28
},
"initWall": { "initWall": {
"__id__": 33 "__id__": 33
}, },
......
...@@ -2,20 +2,22 @@ import { ...@@ -2,20 +2,22 @@ import {
_decorator, _decorator,
Collider, Collider,
Color, Color,
easing, EPhysicsDrawFlags, game, easing,
ICollisionEvent, ICollisionEvent,
Input, Input,
input, input,
instantiate, instantiate,
ITriggerEvent, ITriggerEvent,
Label, lerp, Label,
Light, MeshRenderer, lerp,
Light,
MeshRenderer,
Node, Node,
ParticleSystem, ParticleSystemComponent, ParticleSystem,
PhysicsSystem, PhysicsSystem,
PointToPointConstraint, PointToPointConstraint,
Prefab, Prefab,
RigidBody, Texture2D, RigidBody,
Tween, Tween,
tween, tween,
v3, v3,
...@@ -28,7 +30,7 @@ import GameMgr from "../../GameMgr"; ...@@ -28,7 +30,7 @@ import GameMgr from "../../GameMgr";
import { AudioMgr } from "../../../core_tgx/base/AudioMgr"; import { AudioMgr } from "../../../core_tgx/base/AudioMgr";
import { BgAndColor } from "./BgAndColor"; import { BgAndColor } from "./BgAndColor";
const {ccclass, property} = _decorator; const { ccclass, property } = _decorator;
@ccclass("MainGame") @ccclass("MainGame")
...@@ -44,7 +46,6 @@ export class MainGame extends Scene { ...@@ -44,7 +46,6 @@ export class MainGame extends Scene {
playerBody: RigidBody = null; playerBody: RigidBody = null;
playerConstraint: PointToPointConstraint = null; playerConstraint: PointToPointConstraint = null;
@property(Node) initWall: Node = null; @property(Node) initWall: Node = null;
@property(Prefab) wallPrefab: Prefab = null; @property(Prefab) wallPrefab: Prefab = null;
...@@ -54,11 +55,11 @@ export class MainGame extends Scene { ...@@ -54,11 +55,11 @@ export class MainGame extends Scene {
@property(Light) light: Light = null; @property(Light) light: Light = null;
@property({type: Label, group: "UI"}) scoreLabel: Label = null; @property({ type: Label, group: "UI" }) scoreLabel: Label = null;
@property({type: Node, group: "UI"}) hitTip: Node = null; @property({ type: Node, group: "UI" }) hitTip: Node = null;
@property({type: Node}) bg: Node = null; @property({ type: Node }) bg: Node = null;
@property({type: [BgAndColor], visible: true, displayName: `背景和颜色`}) @property({ type: [BgAndColor], visible: true, displayName: `背景和颜色` })
private bgAndColor: BgAndColor[] = []; private bgAndColor: BgAndColor[] = [];
private _score: number = 0; private _score: number = 0;
...@@ -151,7 +152,7 @@ export class MainGame extends Scene { ...@@ -151,7 +152,7 @@ export class MainGame extends Scene {
} }
onTriggerEnter(event: ITriggerEvent) { onTriggerEnter(event: ITriggerEvent) {
const {otherCollider, selfCollider} = event; const { otherCollider, selfCollider } = event;
const otherName = otherCollider.node.name; const otherName = otherCollider.node.name;
...@@ -164,9 +165,9 @@ export class MainGame extends Scene { ...@@ -164,9 +165,9 @@ export class MainGame extends Scene {
this.unschedule(this.scoreRadioFunc); this.unschedule(this.scoreRadioFunc);
this.scheduleOnce(this.scoreRadioFunc, 5); this.scheduleOnce(this.scoreRadioFunc, 5);
tween(this.hitTip) tween(this.hitTip)
.set({active: true}) .set({ active: true })
.delay(2) .delay(2)
.set({active: false}) .set({ active: false })
.start(); .start();
const crushNode = instantiate(this.crushPrefab); const crushNode = instantiate(this.crushPrefab);
...@@ -183,7 +184,7 @@ export class MainGame extends Scene { ...@@ -183,7 +184,7 @@ export class MainGame extends Scene {
onPlayerCollision(event: ICollisionEvent) { onPlayerCollision(event: ICollisionEvent) {
if (this.isOver) return; if (this.isOver) return;
const {otherCollider, selfCollider} = event; const { otherCollider, selfCollider } = event;
const otherGroup = otherCollider.getGroup(); const otherGroup = otherCollider.getGroup();
...@@ -211,12 +212,12 @@ export class MainGame extends Scene { ...@@ -211,12 +212,12 @@ export class MainGame extends Scene {
changeMainColor() { changeMainColor() {
this.randomMainColor(); this.randomMainColor();
const {bg, color} = this.mainColor; const { bg, color } = this.mainColor;
this.bg.getComponent(MeshRenderer).material.setProperty("mainTexture", bg); this.bg.getComponent(MeshRenderer).material.setProperty("mainTexture", bg);
this.lightTween?.removeSelf(); this.lightTween?.removeSelf();
this.lightTween = tween({radio: 0}) this.lightTween = tween({ radio: 0 })
.to(1, {radio: 1}, { .to(1, { radio: 1 }, {
easing: easing.quadInOut, easing: easing.quadInOut,
onUpdate: (target, ratio) => { onUpdate: (target, ratio) => {
this.lightColor.lerp(color, ratio); this.lightColor.lerp(color, ratio);
...@@ -310,7 +311,7 @@ export class MainGame extends Scene { ...@@ -310,7 +311,7 @@ export class MainGame extends Scene {
const propLen = this.propCFG.length; const propLen = this.propCFG.length;
let create = false; let create = false;
for (let i = 0; i < propLen; i++) { for (let i = 0; i < propLen; i++) {
const {lastZ, interval} = this.propCFG[i]; const { lastZ, interval } = this.propCFG[i];
const dz = lastZ - pz; const dz = lastZ - pz;
if (create) { if (create) {
this.propCFG[i].lastZ = pz; this.propCFG[i].lastZ = pz;
...@@ -331,7 +332,7 @@ export class MainGame extends Scene { ...@@ -331,7 +332,7 @@ export class MainGame extends Scene {
wallTs.reset(); wallTs.reset();
for (let i = 0; i < propLen; i++) { for (let i = 0; i < propLen; i++) {
const {funcName, create} = this.propCFG[i]; const { funcName, create } = this.propCFG[i];
if (create) { if (create) {
this.propCFG[i].create = false; this.propCFG[i].create = false;
wallTs[funcName](); 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 { CinestationBlendDefinition, CinestationBlendFunc } from './CinestationBlendDefinition';
import { cinestation } from './CinestationData'; import { cinestation } from './CinestationData';
import { Nullable } from './Common/Types'; import { Nullable } from './Common/Types';
...@@ -8,6 +8,9 @@ const { ccclass, property, executionOrder, executeInEditMode } = _decorator; ...@@ -8,6 +8,9 @@ const { ccclass, property, executionOrder, executeInEditMode } = _decorator;
let __point = new Vec2(); let __point = new Vec2();
const tempCameraPos = new Vec3();
const tempCameraRot = new Quat();
@ccclass('CinestationBrain') @ccclass('CinestationBrain')
@executeInEditMode @executeInEditMode
@executionOrder(-1) @executionOrder(-1)
...@@ -85,9 +88,14 @@ export class CinestationBrain extends Visualization { ...@@ -85,9 +88,14 @@ export class CinestationBrain extends Visualization {
if (CC_EDITOR) return; if (CC_EDITOR) return;
if (!cinestation.mainCamera) return; if (!cinestation.mainCamera) return;
let from = cinestation.mainCamera, to = vcam; const 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); 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.fov = lerp(from.fov, to.lens.fov, t);
from.near = lerp(from.near, to.lens.near, t); from.near = lerp(from.near, to.lens.near, t);
from.far = lerp(from.far, to.lens.far, 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