任务:搭建“序章-战场”的整体流程框架

1.创建可交互电报机这个逻辑物体
*.在所有脚本首行添加说明方便查看
2.编写假电报机类,因为这个电报机没有电报机功能,而是一个类似事件的物体。
3.使假电报机可以分清场景中电话线断裂和修复的情况,并对其做出不同反应。
4.没修完电报机的反馈等待策划,修完了的等待我明天编写场景的多态系统
5.均通过了程序简单测试,请各位尽快拉取寻找问题

下班,别摸了,兄弟们
This commit is contained in:
Roman 2021-08-07 01:31:29 +08:00
parent b1dc32196a
commit 9b7dbdf941
21 changed files with 196 additions and 5 deletions

View File

@ -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: 5.9999986
m_Colors: m_Colors:
- Center: {r: -0.37561503, g: 0.2741955, b: 0, a: 0} - Center: {r: 0.20030116, g: 0.31703544, 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: []

View File

@ -989,6 +989,129 @@ SpriteRenderer:
m_WasSpriteAssigned: 1 m_WasSpriteAssigned: 1
m_MaskInteraction: 0 m_MaskInteraction: 0
m_SpriteSortPoint: 0 m_SpriteSortPoint: 0
--- !u!1 &818525950
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 818525951}
- component: {fileID: 818525953}
- component: {fileID: 818525952}
- component: {fileID: 818525954}
m_Layer: 0
m_Name: "\u7535\u62A5\u673A"
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!4 &818525951
Transform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 818525950}
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
m_LocalPosition: {x: -2.45, y: -0.55, z: 0}
m_LocalScale: {x: 7.1263, y: 7.1263, z: 7.1263}
m_Children: []
m_Father: {fileID: 1803085805}
m_RootOrder: 10
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!61 &818525952
BoxCollider2D:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 818525950}
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.049999997, y: 0.049999997, z: 0.049999997, w: 0.049999997}
pivot: {x: 0.5, y: 0.5}
oldSize: {x: 0.16, y: 0.16}
newSize: {x: 0.16, y: 0.16}
adaptiveTilingThreshold: 0.5
drawMode: 0
adaptiveTiling: 0
m_AutoTiling: 0
serializedVersion: 2
m_Size: {x: 0.16, y: 0.16}
m_EdgeRadius: 0
--- !u!212 &818525953
SpriteRenderer:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 818525950}
m_Enabled: 1
m_CastShadows: 0
m_ReceiveShadows: 0
m_DynamicOccludee: 1
m_MotionVectors: 1
m_LightProbeUsage: 1
m_ReflectionProbeUsage: 1
m_RayTracingMode: 0
m_RayTraceProcedural: 0
m_RenderingLayerMask: 1
m_RendererPriority: 0
m_Materials:
- {fileID: 2100000, guid: a97c105638bdf8b4a8650670310a4cd3, type: 2}
m_StaticBatchInfo:
firstSubMesh: 0
subMeshCount: 0
m_StaticBatchRoot: {fileID: 0}
m_ProbeAnchor: {fileID: 0}
m_LightProbeVolumeOverride: {fileID: 0}
m_ScaleInLightmap: 1
m_ReceiveGI: 1
m_PreserveUVs: 0
m_IgnoreNormalsForChartDetection: 0
m_ImportantGI: 0
m_StitchLightmapSeams: 1
m_SelectedEditorRenderState: 0
m_MinimumChartSize: 4
m_AutoUVMaxDistance: 0.5
m_AutoUVMaxAngle: 89
m_LightmapParameters: {fileID: 0}
m_SortingLayerID: 0
m_SortingLayer: 0
m_SortingOrder: 4
m_Sprite: {fileID: 10911, guid: 0000000000000000f000000000000000, type: 0}
m_Color: {r: 1, g: 0, b: 0, a: 1}
m_FlipX: 0
m_FlipY: 0
m_DrawMode: 0
m_Size: {x: 0.16, y: 0.16}
m_AdaptiveModeThreshold: 0.5
m_SpriteTileMode: 0
m_WasSpriteAssigned: 1
m_MaskInteraction: 0
m_SpriteSortPoint: 0
--- !u!114 &818525954
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 818525950}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 27090778fe68b5140902d9ef8f5d3802, type: 3}
m_Name:
m_EditorClassIdentifier:
m_interface: {fileID: 0}
--- !u!1 &927359184 --- !u!1 &927359184
GameObject: GameObject:
m_ObjectHideFlags: 0 m_ObjectHideFlags: 0
@ -1389,7 +1512,7 @@ GameObject:
- component: {fileID: 1171269131} - component: {fileID: 1171269131}
- component: {fileID: 1171269132} - component: {fileID: 1171269132}
m_Layer: 0 m_Layer: 0
m_Name: "\u7535\u62A5\u7EBF" m_Name: "\u7535\u62A5\u7EBF\u56FE\u7247"
m_TagString: Untagged m_TagString: Untagged
m_Icon: {fileID: 0} m_Icon: {fileID: 0}
m_NavMeshLayer: 0 m_NavMeshLayer: 0
@ -6845,6 +6968,7 @@ Transform:
- {fileID: 1537313304} - {fileID: 1537313304}
- {fileID: 1006989818} - {fileID: 1006989818}
- {fileID: 2116293276} - {fileID: 2116293276}
- {fileID: 818525951}
m_Father: {fileID: 0} m_Father: {fileID: 0}
m_RootOrder: 1 m_RootOrder: 1
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}

View File

@ -4,6 +4,7 @@ using UnityEngine;
public class BombingArea : MonoBehaviour public class BombingArea : MonoBehaviour
{ {
//这是轰炸区的脚本,控制轰炸区相关的所有逻辑💣
// Start is called before the first frame update // Start is called before the first frame update
private bool bombing = false;//是否正在轰炸 private bool bombing = false;//是否正在轰炸
public GameObject shell;//炮弹游戏物体 public GameObject shell;//炮弹游戏物体

View File

@ -5,6 +5,7 @@ using UnityEngine;
public class BoomShader : MonoBehaviour public class BoomShader : MonoBehaviour
{ {
//这是控制炸弹爆炸后冲击波产生的脚本,是霄酱写的🤔
public Material boomMaterial;//爆炸shader的材质 public Material boomMaterial;//爆炸shader的材质
private Vector2 boomPos;//爆炸坐标 private Vector2 boomPos;//爆炸坐标
private bool isBoom = false;//是否爆炸 private bool isBoom = false;//是否爆炸

View File

@ -6,6 +6,7 @@ using Fungus;
public class NormalInvestableItems : Interactive public class NormalInvestableItems : Interactive
{ {
// Start is called before the first frame update // Start is called before the first frame update
//普通可调查对象的类用在按F可以触发调查对话的对象上💬
public string itemName; public string itemName;
void Start() void Start()
{ {

View File

@ -5,6 +5,7 @@ using UnityEngine;
public class Sentence : MonoBehaviour public class Sentence : MonoBehaviour
{ {
// Start is called before the first frame update // Start is called before the first frame update
//句子类,其对象是电报机中的一个句子
[Tooltip("这个句子的内容是什么?")] [Tooltip("这个句子的内容是什么?")]
public string content; public string content;
[Tooltip("这个句子对应的数字序列是?")] [Tooltip("这个句子对应的数字序列是?")]

View File

@ -5,6 +5,7 @@ using UnityEngine;
public class Event : MonoBehaviour public class Event : MonoBehaviour
{ {
// Start is called before the first frame update // Start is called before the first frame update
//事件的基类
void Start() void Start()
{ {

View File

@ -5,6 +5,7 @@ using Fungus;
public class WhenFinishFathersCode : Event public class WhenFinishFathersCode : Event
{ {
// Start is called before the first frame update // Start is called before the first frame update
//具体事件:当玩家打完了父亲教的电码
void Start() void Start()
{ {

View File

@ -4,6 +4,7 @@ using UnityEngine;
public class AllLinesInfo : MonoBehaviour public class AllLinesInfo : MonoBehaviour
{ {
//总线信息类,用来存储场景中电话线断裂的总体信息,
// Start is called before the first frame update // Start is called before the first frame update
public int needCount; public int needCount;
public int OKCount = 0; public int OKCount = 0;
@ -17,4 +18,6 @@ public class AllLinesInfo : MonoBehaviour
{ {
} }
public bool AreYouOK(){return (needCount == OKCount);}//返回完成量是不是等于需求量
} }

View File

@ -4,6 +4,7 @@ using UnityEngine;
public class IndexRecoder : MonoBehaviour public class IndexRecoder : MonoBehaviour
{ {
//策划接口类储存了所有易变的数值每一项都写了toolTip谁叫我是小棉袄呢❤对了电报的字典也写在这里
// Start is called before the first frame update // Start is called before the first frame update
[Tooltip("角色普通移动速度")] [Tooltip("角色普通移动速度")]
public float playerMoveSpeed;//角色普通移动速度 public float playerMoveSpeed;//角色普通移动速度

View File

@ -0,0 +1,38 @@
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class AFakeMachine : Interactive
{
// Start is called before the first frame update
//一个假的电报机类,因为“序章-战场”中的电报机不需要实际打码功能,为了方便我这里单独写一些代码
//继承可交互物体基类
void Start()
{
}
// Update is called once per frame
void Update()
{
}
public override void OnCall()
{
//当这个假的电报机被唤醒
//1.检查总线
AllLinesInfo info = FindObjectOfType<AllLinesInfo>();
if(info.AreYouOK())
{
//若所有线路OK
//转到场景“序章-家中”,给记录员发信息,让“序章-家中”表现为正确状态
Debug.Log("转到场景“序章-家中”,给记录员发信息,让“序章-家中”表现为正确状态");
}
else
{
//若还没OK之后等策划编写新的内容
Debug.Log("还有线路没有联通");
}
}
}

View File

@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: 27090778fe68b5140902d9ef8f5d3802
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

View File

@ -6,6 +6,7 @@ using Fungus;
public class Father : NormalInvestableItems public class Father : NormalInvestableItems
{ {
// Start is called before the first frame update // Start is called before the first frame update
//父亲类,控制父亲作为可对话对象那会儿的父亲
void Start() void Start()
{ {

View File

@ -5,6 +5,7 @@ using UnityEngine.UI;
public class Machine : Interactive public class Machine : Interactive
{ {
//电报机类。控制电报机的信息和各种功能,非常关键🤖
private Text codeTextView;//电码TextView显示目前打了打码 private Text codeTextView;//电码TextView显示目前打了打码
private IndexRecoder indexRecoder;//策划数值接口 private IndexRecoder indexRecoder;//策划数值接口
private AllLinesInfo linesChecker;//路线信息 private AllLinesInfo linesChecker;//路线信息

View File

@ -4,6 +4,7 @@ using UnityEngine;
public class Mine : MonoBehaviour public class Mine : MonoBehaviour
{ {
//地雷系统的地雷类,因为系统还十分不完善,所以没有什么内容🥔
// Start is called before the first frame update // Start is called before the first frame update
void Start() void Start()
{ {

View File

@ -4,6 +4,7 @@ using UnityEngine;
public class Missile : Interactive public class Missile : Interactive
{ {
//投掷物类,控制投掷。系统还十分不完善。
// Start is called before the first frame update // Start is called before the first frame update
void Start() void Start()
{ {

View File

@ -4,6 +4,7 @@ using UnityEngine;
public class Shell : MonoBehaviour public class Shell : MonoBehaviour
{ {
//炮弹类,控制轰炸区内的炮弹和炮弹的阴影🎇
// Start is called before the first frame update // Start is called before the first frame update
public GameObject shadow;//阴影游戏物体 public GameObject shadow;//阴影游戏物体
private Transform ground;//地面的位置信息 private Transform ground;//地面的位置信息

View File

@ -5,6 +5,7 @@ using UnityEngine.UI;
public class TelephoneLine : Interactive public class TelephoneLine : Interactive
{ {
//电话线类,控制每一处断裂的电话线
// Start is called before the first frame update // Start is called before the first frame update
private float allNeedTime; private float allNeedTime;
private float hasReparedTime = 0f; private float hasReparedTime = 0f;

View File

@ -7,6 +7,7 @@ using UnityEngine;
使Cam 使Cam
*/ */
//视差类,霄酱写的🤔
public class Parallax : MonoBehaviour public class Parallax : MonoBehaviour
{ {

View File

@ -4,6 +4,7 @@ using UnityEngine;
public class ScreenShader : MonoBehaviour public class ScreenShader : MonoBehaviour
{ {
//大概是镜子的反射类?妈的这样写谁看得懂?操你妈 F U C K Y O U
public Material material; public Material material;
private void OnRenderImage(RenderTexture source,RenderTexture destination){ private void OnRenderImage(RenderTexture source,RenderTexture destination){
Graphics.Blit(source, destination, material); Graphics.Blit(source, destination, material);

View File

@ -21,10 +21,10 @@ EditorUserSettings:
value: 22424703114646680e0b0227036cdae0f290dfc7abfbfdb7f6d69be60968fbcd663fd8601ed2bad4ce4cfa320d2a18 value: 22424703114646680e0b0227036cdae0f290dfc7abfbfdb7f6d69be60968fbcd663fd8601ed2bad4ce4cfa320d2a18
flags: 0 flags: 0
RecentlyUsedScenePath-5: RecentlyUsedScenePath-5:
value: 22424703114646680e0b0227036cdacaf990d3ea61ade8e6a9f1d07df7ee3d2cfb value: 22424703114646680e0b0227036cdafade90ecf1aafdcdb8e2dc99eb0c69f6dc6a20dea7f234362820
flags: 0 flags: 0
RecentlyUsedScenePath-6: RecentlyUsedScenePath-6:
value: 22424703114646680e0b0227036cdafade90ecf1aafdcdb8e2dc99eb0c69f6dc6a20dea7f234362820 value: 22424703114646680e0b0227036cdacaf990d3ea61ade8e6a9f1d07df7ee3d2cfb
flags: 0 flags: 0
RecentlyUsedScenePath-7: RecentlyUsedScenePath-7:
value: 22424703114646680e0b0227036cdacaf990d3ea61aecec8a8d5c77df7ee3d2cfb value: 22424703114646680e0b0227036cdacaf990d3ea61aecec8a8d5c77df7ee3d2cfb