任务:推进游戏的流程化
场景:【序章-家中】
1.创建脚本【Door】,用来编写门相关
2.创建CG【暂用-战友】
3.优化脚本【CG管理员】,使其可以自动寻找CG,不用再手动拖入
4.优化脚本【ACG】,使其可以应付没有结束事件的CG
5.创建多态【准备出发】
6.创建事件【当播完开门演出】
7.优化一个很重要的基类【一般可交互物体】,使其可以对付排布密集的可交互的情况
下班。至此,完成了序章的流程框架,还有很多细节需要后面扣。明天一定会开始搭建第一关,因为游戏系统之前已经写了大概,应该不会很困难。加油吧。🙏
This commit is contained in:
parent
3496329067
commit
14816a8f30
@ -42,8 +42,8 @@ Material:
|
|||||||
- WaveCount: 50
|
- WaveCount: 50
|
||||||
- WaveIntensity_1: 0.02
|
- WaveIntensity_1: 0.02
|
||||||
- WaveIntensity_2: 1
|
- WaveIntensity_2: 1
|
||||||
- WaveSpread_Value: 0
|
- WaveSpread_Value: 8.799996
|
||||||
m_Colors:
|
m_Colors:
|
||||||
- Center: {r: 0.40723228, g: 0.31920582, b: 0, a: 0}
|
- Center: {r: -0.5440749, g: 0.31395268, b: 0, a: 0}
|
||||||
- Vector2_d2d098295fc146f08b921b231b2e5199: {r: 1.6, g: 0.9, b: 0, a: 0}
|
- Vector2_d2d098295fc146f08b921b231b2e5199: {r: 1.6, g: 0.9, b: 0, a: 0}
|
||||||
m_BuildTextureStacks: []
|
m_BuildTextureStacks: []
|
||||||
|
@ -133,6 +133,8 @@ GameObject:
|
|||||||
m_Component:
|
m_Component:
|
||||||
- component: {fileID: 9289701}
|
- component: {fileID: 9289701}
|
||||||
- component: {fileID: 9289702}
|
- component: {fileID: 9289702}
|
||||||
|
- component: {fileID: 9289704}
|
||||||
|
- component: {fileID: 9289703}
|
||||||
m_Layer: 0
|
m_Layer: 0
|
||||||
m_Name: "\u95E8"
|
m_Name: "\u95E8"
|
||||||
m_TagString: Untagged
|
m_TagString: Untagged
|
||||||
@ -205,6 +207,45 @@ SpriteRenderer:
|
|||||||
m_WasSpriteAssigned: 1
|
m_WasSpriteAssigned: 1
|
||||||
m_MaskInteraction: 0
|
m_MaskInteraction: 0
|
||||||
m_SpriteSortPoint: 0
|
m_SpriteSortPoint: 0
|
||||||
|
--- !u!61 &9289703
|
||||||
|
BoxCollider2D:
|
||||||
|
m_ObjectHideFlags: 0
|
||||||
|
m_CorrespondingSourceObject: {fileID: 0}
|
||||||
|
m_PrefabInstance: {fileID: 0}
|
||||||
|
m_PrefabAsset: {fileID: 0}
|
||||||
|
m_GameObject: {fileID: 9289700}
|
||||||
|
m_Enabled: 1
|
||||||
|
m_Density: 1
|
||||||
|
m_Material: {fileID: 0}
|
||||||
|
m_IsTrigger: 1
|
||||||
|
m_UsedByEffector: 0
|
||||||
|
m_UsedByComposite: 0
|
||||||
|
m_Offset: {x: 0, y: 0}
|
||||||
|
m_SpriteTilingProperty:
|
||||||
|
border: {x: 0, y: 0, z: 0, w: 0}
|
||||||
|
pivot: {x: 0.5, y: 0.5}
|
||||||
|
oldSize: {x: 2.78, y: 5.34}
|
||||||
|
newSize: {x: 2.78, y: 5.34}
|
||||||
|
adaptiveTilingThreshold: 0.5
|
||||||
|
drawMode: 0
|
||||||
|
adaptiveTiling: 0
|
||||||
|
m_AutoTiling: 0
|
||||||
|
serializedVersion: 2
|
||||||
|
m_Size: {x: 2.78, y: 5.34}
|
||||||
|
m_EdgeRadius: 0
|
||||||
|
--- !u!114 &9289704
|
||||||
|
MonoBehaviour:
|
||||||
|
m_ObjectHideFlags: 0
|
||||||
|
m_CorrespondingSourceObject: {fileID: 0}
|
||||||
|
m_PrefabInstance: {fileID: 0}
|
||||||
|
m_PrefabAsset: {fileID: 0}
|
||||||
|
m_GameObject: {fileID: 9289700}
|
||||||
|
m_Enabled: 1
|
||||||
|
m_EditorHideFlags: 0
|
||||||
|
m_Script: {fileID: 11500000, guid: c22dbfeb515db0d4983a3b28db96360a, type: 3}
|
||||||
|
m_Name:
|
||||||
|
m_EditorClassIdentifier:
|
||||||
|
m_interface: {fileID: 0}
|
||||||
--- !u!1 &21934455
|
--- !u!1 &21934455
|
||||||
GameObject:
|
GameObject:
|
||||||
m_ObjectHideFlags: 0
|
m_ObjectHideFlags: 0
|
||||||
@ -326,7 +367,7 @@ Transform:
|
|||||||
m_PrefabAsset: {fileID: 0}
|
m_PrefabAsset: {fileID: 0}
|
||||||
m_GameObject: {fileID: 37275488}
|
m_GameObject: {fileID: 37275488}
|
||||||
m_LocalRotation: {x: -0, y: -0, z: -0, w: 1}
|
m_LocalRotation: {x: -0, y: -0, z: -0, w: 1}
|
||||||
m_LocalPosition: {x: 0.08999999, y: -1.97, z: 0}
|
m_LocalPosition: {x: 0.01, y: -0.46, z: 0}
|
||||||
m_LocalScale: {x: 1, y: 1, z: 1}
|
m_LocalScale: {x: 1, y: 1, z: 1}
|
||||||
m_Children: []
|
m_Children: []
|
||||||
m_Father: {fileID: 1170258148}
|
m_Father: {fileID: 1170258148}
|
||||||
@ -356,7 +397,7 @@ BoxCollider2D:
|
|||||||
adaptiveTiling: 0
|
adaptiveTiling: 0
|
||||||
m_AutoTiling: 0
|
m_AutoTiling: 0
|
||||||
serializedVersion: 2
|
serializedVersion: 2
|
||||||
m_Size: {x: 1, y: 1}
|
m_Size: {x: 1.34, y: 1}
|
||||||
m_EdgeRadius: 0
|
m_EdgeRadius: 0
|
||||||
--- !u!114 &37275492
|
--- !u!114 &37275492
|
||||||
MonoBehaviour:
|
MonoBehaviour:
|
||||||
@ -405,6 +446,8 @@ Transform:
|
|||||||
- {fileID: 21934456}
|
- {fileID: 21934456}
|
||||||
- {fileID: 1918217528}
|
- {fileID: 1918217528}
|
||||||
- {fileID: 1156593139}
|
- {fileID: 1156593139}
|
||||||
|
- {fileID: 2065287233}
|
||||||
|
- {fileID: 728085631}
|
||||||
m_Father: {fileID: 1860666399}
|
m_Father: {fileID: 1860666399}
|
||||||
m_RootOrder: 3
|
m_RootOrder: 3
|
||||||
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
|
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
|
||||||
@ -906,10 +949,12 @@ MonoBehaviour:
|
|||||||
- "\u5E8F\u7AE0-\u5BB6\u4E2D-\u672A\u6253\u7801"
|
- "\u5E8F\u7AE0-\u5BB6\u4E2D-\u672A\u6253\u7801"
|
||||||
- "\u5E8F\u7AE0-\u5BB6\u4E2D-\u5DF2\u6253\u7801"
|
- "\u5E8F\u7AE0-\u5BB6\u4E2D-\u5DF2\u6253\u7801"
|
||||||
- "\u5F00\u95E8\u6F14\u51FA"
|
- "\u5F00\u95E8\u6F14\u51FA"
|
||||||
|
- "\u51C6\u5907\u51FA\u53D1"
|
||||||
statesEvents:
|
statesEvents:
|
||||||
- {fileID: 0}
|
- {fileID: 0}
|
||||||
- {fileID: 1282872330}
|
- {fileID: 1282872330}
|
||||||
- {fileID: 1156593140}
|
- {fileID: 1156593140}
|
||||||
|
- {fileID: 2065287234}
|
||||||
--- !u!1 &439525097
|
--- !u!1 &439525097
|
||||||
GameObject:
|
GameObject:
|
||||||
m_ObjectHideFlags: 0
|
m_ObjectHideFlags: 0
|
||||||
@ -1627,11 +1672,106 @@ Transform:
|
|||||||
m_Father: {fileID: 0}
|
m_Father: {fileID: 0}
|
||||||
m_RootOrder: 0
|
m_RootOrder: 0
|
||||||
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
|
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
|
||||||
|
--- !u!1 &728085630
|
||||||
|
GameObject:
|
||||||
|
m_ObjectHideFlags: 0
|
||||||
|
m_CorrespondingSourceObject: {fileID: 0}
|
||||||
|
m_PrefabInstance: {fileID: 0}
|
||||||
|
m_PrefabAsset: {fileID: 0}
|
||||||
|
serializedVersion: 6
|
||||||
|
m_Component:
|
||||||
|
- component: {fileID: 728085631}
|
||||||
|
- component: {fileID: 728085632}
|
||||||
|
m_Layer: 0
|
||||||
|
m_Name: "\u5F53\u5F00\u95E8CG\u7ED3\u675F\u540E"
|
||||||
|
m_TagString: Untagged
|
||||||
|
m_Icon: {fileID: 0}
|
||||||
|
m_NavMeshLayer: 0
|
||||||
|
m_StaticEditorFlags: 0
|
||||||
|
m_IsActive: 1
|
||||||
|
--- !u!4 &728085631
|
||||||
|
Transform:
|
||||||
|
m_ObjectHideFlags: 0
|
||||||
|
m_CorrespondingSourceObject: {fileID: 0}
|
||||||
|
m_PrefabInstance: {fileID: 0}
|
||||||
|
m_PrefabAsset: {fileID: 0}
|
||||||
|
m_GameObject: {fileID: 728085630}
|
||||||
|
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
|
||||||
|
m_LocalPosition: {x: 0, y: 0, z: 0}
|
||||||
|
m_LocalScale: {x: 1, y: 1, z: 1}
|
||||||
|
m_Children: []
|
||||||
|
m_Father: {fileID: 71136650}
|
||||||
|
m_RootOrder: 7
|
||||||
|
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
|
||||||
|
--- !u!114 &728085632
|
||||||
|
MonoBehaviour:
|
||||||
|
m_ObjectHideFlags: 0
|
||||||
|
m_CorrespondingSourceObject: {fileID: 0}
|
||||||
|
m_PrefabInstance: {fileID: 0}
|
||||||
|
m_PrefabAsset: {fileID: 0}
|
||||||
|
m_GameObject: {fileID: 728085630}
|
||||||
|
m_Enabled: 1
|
||||||
|
m_EditorHideFlags: 0
|
||||||
|
m_Script: {fileID: 11500000, guid: 4b074b5d370b3324faa79c0a3dd76762, type: 3}
|
||||||
|
m_Name:
|
||||||
|
m_EditorClassIdentifier:
|
||||||
--- !u!1 &742864119 stripped
|
--- !u!1 &742864119 stripped
|
||||||
GameObject:
|
GameObject:
|
||||||
m_CorrespondingSourceObject: {fileID: 6148935033436152201, guid: b034a6d27e737a9438c2164815880846, type: 3}
|
m_CorrespondingSourceObject: {fileID: 6148935033436152201, guid: b034a6d27e737a9438c2164815880846, type: 3}
|
||||||
m_PrefabInstance: {fileID: 6148935033767695742}
|
m_PrefabInstance: {fileID: 6148935033767695742}
|
||||||
m_PrefabAsset: {fileID: 0}
|
m_PrefabAsset: {fileID: 0}
|
||||||
|
--- !u!1 &744467541
|
||||||
|
GameObject:
|
||||||
|
m_ObjectHideFlags: 0
|
||||||
|
m_CorrespondingSourceObject: {fileID: 0}
|
||||||
|
m_PrefabInstance: {fileID: 0}
|
||||||
|
m_PrefabAsset: {fileID: 0}
|
||||||
|
serializedVersion: 6
|
||||||
|
m_Component:
|
||||||
|
- component: {fileID: 744467542}
|
||||||
|
- component: {fileID: 744467543}
|
||||||
|
m_Layer: 5
|
||||||
|
m_Name: "CG\uFF1A\u6682\u7528-\u6218\u53CB"
|
||||||
|
m_TagString: Untagged
|
||||||
|
m_Icon: {fileID: 0}
|
||||||
|
m_NavMeshLayer: 0
|
||||||
|
m_StaticEditorFlags: 0
|
||||||
|
m_IsActive: 1
|
||||||
|
--- !u!224 &744467542
|
||||||
|
RectTransform:
|
||||||
|
m_ObjectHideFlags: 0
|
||||||
|
m_CorrespondingSourceObject: {fileID: 0}
|
||||||
|
m_PrefabInstance: {fileID: 0}
|
||||||
|
m_PrefabAsset: {fileID: 0}
|
||||||
|
m_GameObject: {fileID: 744467541}
|
||||||
|
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
|
||||||
|
m_LocalPosition: {x: 0, y: 0, z: 0}
|
||||||
|
m_LocalScale: {x: 1, y: 1, z: 1}
|
||||||
|
m_Children: []
|
||||||
|
m_Father: {fileID: 1771706914}
|
||||||
|
m_RootOrder: 1
|
||||||
|
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
|
||||||
|
m_AnchorMin: {x: 0.5, y: 0.5}
|
||||||
|
m_AnchorMax: {x: 0.5, y: 0.5}
|
||||||
|
m_AnchoredPosition: {x: 0, y: 0}
|
||||||
|
m_SizeDelta: {x: 100, y: 100}
|
||||||
|
m_Pivot: {x: 0.5, y: 0.5}
|
||||||
|
--- !u!114 &744467543
|
||||||
|
MonoBehaviour:
|
||||||
|
m_ObjectHideFlags: 0
|
||||||
|
m_CorrespondingSourceObject: {fileID: 0}
|
||||||
|
m_PrefabInstance: {fileID: 0}
|
||||||
|
m_PrefabAsset: {fileID: 0}
|
||||||
|
m_GameObject: {fileID: 744467541}
|
||||||
|
m_Enabled: 1
|
||||||
|
m_EditorHideFlags: 0
|
||||||
|
m_Script: {fileID: 11500000, guid: ab6d265b5e187da4bbc927caf02b681e, type: 3}
|
||||||
|
m_Name:
|
||||||
|
m_EditorClassIdentifier:
|
||||||
|
CGName: "\u6682\u7528-\u6218\u53CB"
|
||||||
|
texture: {fileID: 2800000, guid: cef0e0ab272206648a43e294c577aa2c, type: 3}
|
||||||
|
time: 3
|
||||||
|
onEnded: {fileID: 728085632}
|
||||||
--- !u!1 &751638227
|
--- !u!1 &751638227
|
||||||
GameObject:
|
GameObject:
|
||||||
m_ObjectHideFlags: 0
|
m_ObjectHideFlags: 0
|
||||||
@ -4927,6 +5067,7 @@ RectTransform:
|
|||||||
m_LocalScale: {x: 1, y: 1, z: 1}
|
m_LocalScale: {x: 1, y: 1, z: 1}
|
||||||
m_Children:
|
m_Children:
|
||||||
- {fileID: 2125100632}
|
- {fileID: 2125100632}
|
||||||
|
- {fileID: 744467542}
|
||||||
m_Father: {fileID: 2052706945}
|
m_Father: {fileID: 2052706945}
|
||||||
m_RootOrder: 0
|
m_RootOrder: 0
|
||||||
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
|
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
|
||||||
@ -4982,8 +5123,7 @@ MonoBehaviour:
|
|||||||
m_Script: {fileID: 11500000, guid: fbae1877cad284d4d82f60cbb5878baa, type: 3}
|
m_Script: {fileID: 11500000, guid: fbae1877cad284d4d82f60cbb5878baa, type: 3}
|
||||||
m_Name:
|
m_Name:
|
||||||
m_EditorClassIdentifier:
|
m_EditorClassIdentifier:
|
||||||
CGs:
|
CGs: []
|
||||||
- {fileID: 2125100633}
|
|
||||||
--- !u!1 &1773029877
|
--- !u!1 &1773029877
|
||||||
GameObject:
|
GameObject:
|
||||||
m_ObjectHideFlags: 0
|
m_ObjectHideFlags: 0
|
||||||
@ -5422,7 +5562,7 @@ Transform:
|
|||||||
m_PrefabAsset: {fileID: 0}
|
m_PrefabAsset: {fileID: 0}
|
||||||
m_GameObject: {fileID: 1861856986}
|
m_GameObject: {fileID: 1861856986}
|
||||||
m_LocalRotation: {x: -0, y: -0, z: -0, w: 1}
|
m_LocalRotation: {x: -0, y: -0, z: -0, w: 1}
|
||||||
m_LocalPosition: {x: -10.217708, y: 0.083872736, z: -10}
|
m_LocalPosition: {x: -11.039029, y: 0.08661765, z: -10}
|
||||||
m_LocalScale: {x: 1, y: 1, z: 1}
|
m_LocalScale: {x: 1, y: 1, z: 1}
|
||||||
m_Children: []
|
m_Children: []
|
||||||
m_Father: {fileID: 716192431}
|
m_Father: {fileID: 716192431}
|
||||||
@ -6032,6 +6172,49 @@ MonoBehaviour:
|
|||||||
- {x: 0.5, y: -0.5, z: 0}
|
- {x: 0.5, y: -0.5, z: 0}
|
||||||
- {x: 0.5, y: 0.5, z: 0}
|
- {x: 0.5, y: 0.5, z: 0}
|
||||||
- {x: -0.5, y: 0.5, z: 0}
|
- {x: -0.5, y: 0.5, z: 0}
|
||||||
|
--- !u!1 &2065287232
|
||||||
|
GameObject:
|
||||||
|
m_ObjectHideFlags: 0
|
||||||
|
m_CorrespondingSourceObject: {fileID: 0}
|
||||||
|
m_PrefabInstance: {fileID: 0}
|
||||||
|
m_PrefabAsset: {fileID: 0}
|
||||||
|
serializedVersion: 6
|
||||||
|
m_Component:
|
||||||
|
- component: {fileID: 2065287233}
|
||||||
|
- component: {fileID: 2065287234}
|
||||||
|
m_Layer: 0
|
||||||
|
m_Name: "\u591A\u6001\uFF1A\u51C6\u5907\u51FA\u53D1"
|
||||||
|
m_TagString: Untagged
|
||||||
|
m_Icon: {fileID: 0}
|
||||||
|
m_NavMeshLayer: 0
|
||||||
|
m_StaticEditorFlags: 0
|
||||||
|
m_IsActive: 1
|
||||||
|
--- !u!4 &2065287233
|
||||||
|
Transform:
|
||||||
|
m_ObjectHideFlags: 0
|
||||||
|
m_CorrespondingSourceObject: {fileID: 0}
|
||||||
|
m_PrefabInstance: {fileID: 0}
|
||||||
|
m_PrefabAsset: {fileID: 0}
|
||||||
|
m_GameObject: {fileID: 2065287232}
|
||||||
|
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
|
||||||
|
m_LocalPosition: {x: 0, y: 0, z: 0}
|
||||||
|
m_LocalScale: {x: 1, y: 1, z: 1}
|
||||||
|
m_Children: []
|
||||||
|
m_Father: {fileID: 71136650}
|
||||||
|
m_RootOrder: 6
|
||||||
|
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
|
||||||
|
--- !u!114 &2065287234
|
||||||
|
MonoBehaviour:
|
||||||
|
m_ObjectHideFlags: 0
|
||||||
|
m_CorrespondingSourceObject: {fileID: 0}
|
||||||
|
m_PrefabInstance: {fileID: 0}
|
||||||
|
m_PrefabAsset: {fileID: 0}
|
||||||
|
m_GameObject: {fileID: 2065287232}
|
||||||
|
m_Enabled: 1
|
||||||
|
m_EditorHideFlags: 0
|
||||||
|
m_Script: {fileID: 11500000, guid: 9b701ea64b20ba046b1c99013b049034, type: 3}
|
||||||
|
m_Name:
|
||||||
|
m_EditorClassIdentifier:
|
||||||
--- !u!1 &2083069443
|
--- !u!1 &2083069443
|
||||||
GameObject:
|
GameObject:
|
||||||
m_ObjectHideFlags: 0
|
m_ObjectHideFlags: 0
|
||||||
@ -6275,7 +6458,7 @@ PrefabInstance:
|
|||||||
objectReference: {fileID: 0}
|
objectReference: {fileID: 0}
|
||||||
- target: {fileID: 4912081361035269481, guid: 2ff4d949bf0f2f343893d8c570bf9f51, type: 3}
|
- target: {fileID: 4912081361035269481, guid: 2ff4d949bf0f2f343893d8c570bf9f51, type: 3}
|
||||||
propertyPath: m_LocalPosition.x
|
propertyPath: m_LocalPosition.x
|
||||||
value: 11.28
|
value: 10.67
|
||||||
objectReference: {fileID: 0}
|
objectReference: {fileID: 0}
|
||||||
- target: {fileID: 4912081361035269481, guid: 2ff4d949bf0f2f343893d8c570bf9f51, type: 3}
|
- target: {fileID: 4912081361035269481, guid: 2ff4d949bf0f2f343893d8c570bf9f51, type: 3}
|
||||||
propertyPath: m_LocalPosition.y
|
propertyPath: m_LocalPosition.y
|
||||||
|
18
Assets/Scripts/事件/AfterOpenDoorCG.cs
Normal file
18
Assets/Scripts/事件/AfterOpenDoorCG.cs
Normal file
@ -0,0 +1,18 @@
|
|||||||
|
using System.Collections;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using UnityEngine;
|
||||||
|
using UnityEngine.SceneManagement;
|
||||||
|
|
||||||
|
public class AfterOpenDoorCG : Event
|
||||||
|
{
|
||||||
|
//事件:当开门的CG播完
|
||||||
|
public override void OnCall()
|
||||||
|
{
|
||||||
|
//找到信息记录者,改变演出名为【准备出发】,为呈现多态作准备
|
||||||
|
IndexRecoder indexRecoder = FindObjectOfType<IndexRecoder>();
|
||||||
|
indexRecoder.ChangeStageName("准备出发");
|
||||||
|
|
||||||
|
//再次切换场景到【序章-家中】
|
||||||
|
SceneManager.LoadScene("序章-家中");
|
||||||
|
}
|
||||||
|
}
|
11
Assets/Scripts/事件/AfterOpenDoorCG.cs.meta
Normal file
11
Assets/Scripts/事件/AfterOpenDoorCG.cs.meta
Normal file
@ -0,0 +1,11 @@
|
|||||||
|
fileFormatVersion: 2
|
||||||
|
guid: 4b074b5d370b3324faa79c0a3dd76762
|
||||||
|
MonoImporter:
|
||||||
|
externalObjects: {}
|
||||||
|
serializedVersion: 2
|
||||||
|
defaultReferences: []
|
||||||
|
executionOrder: 0
|
||||||
|
icon: {instanceID: 0}
|
||||||
|
userData:
|
||||||
|
assetBundleName:
|
||||||
|
assetBundleVariant:
|
26
Assets/Scripts/事件/ReadyToGoStage.cs
Normal file
26
Assets/Scripts/事件/ReadyToGoStage.cs
Normal file
@ -0,0 +1,26 @@
|
|||||||
|
using System.Collections;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using UnityEngine;
|
||||||
|
using UnityEngine.SceneManagement;
|
||||||
|
|
||||||
|
public class ReadyToGoStage : Event
|
||||||
|
{
|
||||||
|
//多态:玩家准备触发前往第一关时候的多态
|
||||||
|
public override void OnCall()
|
||||||
|
{
|
||||||
|
Debug.Log("正在启动多态【准备出发】");
|
||||||
|
|
||||||
|
M_Player player = FindObjectOfType<M_Player>();//找到玩家
|
||||||
|
player.transform.position = new Vector3(10.1999998f,0.936617672f,0);//改变玩家位置
|
||||||
|
|
||||||
|
player.transform.localScale = new Vector3(
|
||||||
|
Mathf.Abs(transform.localScale.x)*-1,
|
||||||
|
transform.localScale.y,
|
||||||
|
transform.localScale.z);//修改玩家面部朝向为左
|
||||||
|
|
||||||
|
Destroy(FindObjectOfType<Father>().gameObject);//摧毁父亲这个游戏物体
|
||||||
|
|
||||||
|
Debug.Log("此多态下不明确的东西太多,之后再细做");
|
||||||
|
//已知与门互动将直接出发到第一关,第一关还没布置,这里的衔接之后再写
|
||||||
|
}
|
||||||
|
}
|
11
Assets/Scripts/事件/ReadyToGoStage.cs.meta
Normal file
11
Assets/Scripts/事件/ReadyToGoStage.cs.meta
Normal file
@ -0,0 +1,11 @@
|
|||||||
|
fileFormatVersion: 2
|
||||||
|
guid: 9b701ea64b20ba046b1c99013b049034
|
||||||
|
MonoImporter:
|
||||||
|
externalObjects: {}
|
||||||
|
serializedVersion: 2
|
||||||
|
defaultReferences: []
|
||||||
|
executionOrder: 0
|
||||||
|
icon: {instanceID: 0}
|
||||||
|
userData:
|
||||||
|
assetBundleName:
|
||||||
|
assetBundleVariant:
|
14
Assets/Scripts/具象物体/Door.cs
Normal file
14
Assets/Scripts/具象物体/Door.cs
Normal file
@ -0,0 +1,14 @@
|
|||||||
|
using System.Collections;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using UnityEngine;
|
||||||
|
|
||||||
|
public class Door : Interactive
|
||||||
|
{
|
||||||
|
//可交互对象:门的控制类
|
||||||
|
public override void OnCall()
|
||||||
|
{
|
||||||
|
//当门被唤醒,显示CG
|
||||||
|
CGAdministrator administrator = FindObjectOfType<CGAdministrator>();
|
||||||
|
administrator.CallACG("暂用-战友");
|
||||||
|
}
|
||||||
|
}
|
11
Assets/Scripts/具象物体/Door.cs.meta
Normal file
11
Assets/Scripts/具象物体/Door.cs.meta
Normal file
@ -0,0 +1,11 @@
|
|||||||
|
fileFormatVersion: 2
|
||||||
|
guid: c22dbfeb515db0d4983a3b28db96360a
|
||||||
|
MonoImporter:
|
||||||
|
externalObjects: {}
|
||||||
|
serializedVersion: 2
|
||||||
|
defaultReferences: []
|
||||||
|
executionOrder: 0
|
||||||
|
icon: {instanceID: 0}
|
||||||
|
userData:
|
||||||
|
assetBundleName:
|
||||||
|
assetBundleVariant:
|
@ -14,6 +14,17 @@ using UnityEngine;
|
|||||||
[Tooltip("CG播放结束时要触发什么事件?")]
|
[Tooltip("CG播放结束时要触发什么事件?")]
|
||||||
public Event onEnded;
|
public Event onEnded;
|
||||||
|
|
||||||
public void OnEnded(){onEnded.OnCall();}//触发结束事件,不同CG事件不一样,所以用public自己拖
|
public void OnEnded()
|
||||||
|
{
|
||||||
|
try
|
||||||
|
{
|
||||||
|
onEnded.OnCall();//触发结束事件,不同CG事件不一样,所以用public自己拖
|
||||||
|
}
|
||||||
|
catch(System.Exception e)
|
||||||
|
{
|
||||||
|
Debug.Log("要么是这个CG没有结束事件,要么是你这个结束事件里面出错了。什么错?我咋知道(摆烂\n" +
|
||||||
|
e.ToString());
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -10,8 +10,8 @@ public class CGAdministrator : MonoBehaviour
|
|||||||
//CG管理员相关代码
|
//CG管理员相关代码
|
||||||
|
|
||||||
private RawImage rawImage;
|
private RawImage rawImage;
|
||||||
[Tooltip("记录这个场景中的所有CG,要加的话直接扩容数组,并往新的CG里面加内容")]
|
[Tooltip("记录这个场景中的所有CG,要加的话直接扩容数组,并往新的CG里面加内容")][SerializeField][ReadOnly]
|
||||||
public ACG[] CGs;
|
private ACG[] CGs;
|
||||||
private IndexRecoder indexRecoder;
|
private IndexRecoder indexRecoder;
|
||||||
private ACG playingCG;//正在播放的CG,因为invoke无法传参而存在
|
private ACG playingCG;//正在播放的CG,因为invoke无法传参而存在
|
||||||
void Start()
|
void Start()
|
||||||
@ -19,6 +19,14 @@ public class CGAdministrator : MonoBehaviour
|
|||||||
rawImage = GetComponent<RawImage>();
|
rawImage = GetComponent<RawImage>();
|
||||||
indexRecoder = FindObjectOfType<IndexRecoder>();
|
indexRecoder = FindObjectOfType<IndexRecoder>();
|
||||||
rawImage.CrossFadeAlpha(0,0,true);//为了淡入显示,必须先把它的阿尔法值降到0,对吧?
|
rawImage.CrossFadeAlpha(0,0,true);//为了淡入显示,必须先把它的阿尔法值降到0,对吧?
|
||||||
|
|
||||||
|
//好像可以让它自己找到所有CG
|
||||||
|
CGs = new ACG[transform.childCount];
|
||||||
|
for(int i = 0; i < transform.childCount; i++)
|
||||||
|
{
|
||||||
|
CGs[i] = transform.GetChild(i).GetComponent<ACG>();
|
||||||
|
}
|
||||||
|
//
|
||||||
}
|
}
|
||||||
|
|
||||||
// Update is called once per frame
|
// Update is called once per frame
|
||||||
|
@ -21,7 +21,9 @@ public class Interactive : MonoBehaviour
|
|||||||
{
|
{
|
||||||
if(other.tag == "Player")
|
if(other.tag == "Player")
|
||||||
{
|
{
|
||||||
other.GetComponent<M_Player>().catched = null;
|
//如果目前退出当前交互区域的时候,玩家的捕捉物体是自己,才把玩家的捕捉清空。否则说明玩家在推出前就捕捉到了新的
|
||||||
|
//对象。这样是用来解决排布密集的可交互物体的问题
|
||||||
|
if(other.GetComponent<M_Player>().catched == this) other.GetComponent<M_Player>().catched = null;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
//
|
//
|
||||||
|
BIN
Assets/Sprites/暂用-战友.jpg
Normal file
BIN
Assets/Sprites/暂用-战友.jpg
Normal file
Binary file not shown.
After Width: | Height: | Size: 89 KiB |
96
Assets/Sprites/暂用-战友.jpg.meta
Normal file
96
Assets/Sprites/暂用-战友.jpg.meta
Normal file
@ -0,0 +1,96 @@
|
|||||||
|
fileFormatVersion: 2
|
||||||
|
guid: cef0e0ab272206648a43e294c577aa2c
|
||||||
|
TextureImporter:
|
||||||
|
internalIDToNameTable: []
|
||||||
|
externalObjects: {}
|
||||||
|
serializedVersion: 11
|
||||||
|
mipmaps:
|
||||||
|
mipMapMode: 0
|
||||||
|
enableMipMap: 0
|
||||||
|
sRGBTexture: 1
|
||||||
|
linearTexture: 0
|
||||||
|
fadeOut: 0
|
||||||
|
borderMipMap: 0
|
||||||
|
mipMapsPreserveCoverage: 0
|
||||||
|
alphaTestReferenceValue: 0.5
|
||||||
|
mipMapFadeDistanceStart: 1
|
||||||
|
mipMapFadeDistanceEnd: 3
|
||||||
|
bumpmap:
|
||||||
|
convertToNormalMap: 0
|
||||||
|
externalNormalMap: 0
|
||||||
|
heightScale: 0.25
|
||||||
|
normalMapFilter: 0
|
||||||
|
isReadable: 0
|
||||||
|
streamingMipmaps: 0
|
||||||
|
streamingMipmapsPriority: 0
|
||||||
|
vTOnly: 0
|
||||||
|
grayScaleToAlpha: 0
|
||||||
|
generateCubemap: 6
|
||||||
|
cubemapConvolution: 0
|
||||||
|
seamlessCubemap: 0
|
||||||
|
textureFormat: 1
|
||||||
|
maxTextureSize: 2048
|
||||||
|
textureSettings:
|
||||||
|
serializedVersion: 2
|
||||||
|
filterMode: -1
|
||||||
|
aniso: -1
|
||||||
|
mipBias: -100
|
||||||
|
wrapU: 1
|
||||||
|
wrapV: 1
|
||||||
|
wrapW: 1
|
||||||
|
nPOTScale: 0
|
||||||
|
lightmap: 0
|
||||||
|
compressionQuality: 50
|
||||||
|
spriteMode: 1
|
||||||
|
spriteExtrude: 1
|
||||||
|
spriteMeshType: 1
|
||||||
|
alignment: 0
|
||||||
|
spritePivot: {x: 0.5, y: 0.5}
|
||||||
|
spritePixelsToUnits: 100
|
||||||
|
spriteBorder: {x: 0, y: 0, z: 0, w: 0}
|
||||||
|
spriteGenerateFallbackPhysicsShape: 1
|
||||||
|
alphaUsage: 1
|
||||||
|
alphaIsTransparency: 1
|
||||||
|
spriteTessellationDetail: -1
|
||||||
|
textureType: 8
|
||||||
|
textureShape: 1
|
||||||
|
singleChannelComponent: 0
|
||||||
|
flipbookRows: 1
|
||||||
|
flipbookColumns: 1
|
||||||
|
maxTextureSizeSet: 0
|
||||||
|
compressionQualitySet: 0
|
||||||
|
textureFormatSet: 0
|
||||||
|
ignorePngGamma: 0
|
||||||
|
applyGammaDecoding: 0
|
||||||
|
platformSettings:
|
||||||
|
- serializedVersion: 3
|
||||||
|
buildTarget: DefaultTexturePlatform
|
||||||
|
maxTextureSize: 2048
|
||||||
|
resizeAlgorithm: 0
|
||||||
|
textureFormat: -1
|
||||||
|
textureCompression: 1
|
||||||
|
compressionQuality: 50
|
||||||
|
crunchedCompression: 0
|
||||||
|
allowsAlphaSplitting: 0
|
||||||
|
overridden: 0
|
||||||
|
androidETC2FallbackOverride: 0
|
||||||
|
forceMaximumCompressionQuality_BC6H_BC7: 0
|
||||||
|
spriteSheet:
|
||||||
|
serializedVersion: 2
|
||||||
|
sprites: []
|
||||||
|
outline: []
|
||||||
|
physicsShape: []
|
||||||
|
bones: []
|
||||||
|
spriteID: 5e97eb03825dee720800000000000000
|
||||||
|
internalID: 0
|
||||||
|
vertices: []
|
||||||
|
indices:
|
||||||
|
edges: []
|
||||||
|
weights: []
|
||||||
|
secondaryTextures: []
|
||||||
|
spritePackingTag:
|
||||||
|
pSDRemoveMatte: 0
|
||||||
|
pSDShowRemoveMatteOption: 0
|
||||||
|
userData:
|
||||||
|
assetBundleName:
|
||||||
|
assetBundleVariant:
|
7
Assets/图/动画包2.unitypackage.meta
Normal file
7
Assets/图/动画包2.unitypackage.meta
Normal file
@ -0,0 +1,7 @@
|
|||||||
|
fileFormatVersion: 2
|
||||||
|
guid: 044ff6b1ad550174f889a7d6c83247e1
|
||||||
|
DefaultImporter:
|
||||||
|
externalObjects: {}
|
||||||
|
userData:
|
||||||
|
assetBundleName:
|
||||||
|
assetBundleVariant:
|
@ -24,12 +24,12 @@ EditorUserSettings:
|
|||||||
value: 22424703114646680e0b0227036cdae0f290dfc7abfbfdb7f6d69be60968fbcd663fd8601ed2bad4ce4cfa320d2a18
|
value: 22424703114646680e0b0227036cdae0f290dfc7abfbfdb7f6d69be60968fbcd663fd8601ed2bad4ce4cfa320d2a18
|
||||||
flags: 0
|
flags: 0
|
||||||
RecentlyUsedScenePath-6:
|
RecentlyUsedScenePath-6:
|
||||||
value: 22424703114646680e0b0227036cdacaf990d3ea61aecec8a8d5c77df7ee3d2cfb
|
|
||||||
flags: 0
|
|
||||||
RecentlyUsedScenePath-7:
|
|
||||||
value: 22424703114646680e0b0227036cdafade90ecf1aafdcdb8e2dc99eb0c69f6dc6a20dea7f234362820
|
value: 22424703114646680e0b0227036cdafade90ecf1aafdcdb8e2dc99eb0c69f6dc6a20dea7f234362820
|
||||||
flags: 0
|
flags: 0
|
||||||
RecentlyUsedScenePath-2:
|
RecentlyUsedScenePath-7:
|
||||||
|
value: 22424703114646680e0b0227036cdacaf990d3ea61aecec8a8d5c77df7ee3d2cfb
|
||||||
|
flags: 0
|
||||||
|
RecentlyUsedScenePath-8:
|
||||||
value: 22424703114646680e0b0227036cdacaf990d3ea61ade8e6a9f1d07df7ee3d2cfb
|
value: 22424703114646680e0b0227036cdacaf990d3ea61ade8e6a9f1d07df7ee3d2cfb
|
||||||
flags: 0
|
flags: 0
|
||||||
UnityEditor.ShaderGraph.Blackboard:
|
UnityEditor.ShaderGraph.Blackboard:
|
||||||
|
Loading…
x
Reference in New Issue
Block a user