Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
M
Magnet
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
wanqing
Magnet
Commits
39bd7d72
Commit
39bd7d72
authored
Mar 11, 2021
by
wanqing
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
修改代码
parent
8f677b61
Changes
7
Show whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
202 additions
and
4 deletions
+202
-4
.suo
Magnet/.vs/Magnet/v16/.suo
+0
-0
BattleUI.cs
Magnet/Assets/#A2_Scripts/Battle/UI/BattleUI.cs
+35
-2
CacheManager.cs
Magnet/Assets/#A2_Scripts/Pool/CacheManager.cs
+5
-2
Door1.prefab
Magnet/Assets/#A3_Prefabs/Char/Door1.prefab
+155
-0
Door1.prefab.meta
Magnet/Assets/#A3_Prefabs/Char/Door1.prefab.meta
+0
-0
Door2.prefab
Magnet/Assets/#A3_Prefabs/Char/Door2.prefab
+0
-0
Door2.prefab.meta
Magnet/Assets/#A3_Prefabs/Char/Door2.prefab.meta
+7
-0
No files found.
Magnet/.vs/Magnet/v16/.suo
View file @
39bd7d72
No preview for this file type
Magnet/Assets/#A2_Scripts/Battle/UI/BattleUI.cs
View file @
39bd7d72
...
@@ -417,6 +417,8 @@ public class BattleUI : MonoBehaviour
...
@@ -417,6 +417,8 @@ public class BattleUI : MonoBehaviour
{
{
m_bloodObj
.
transform
.
GetChild
(
i
).
gameObject
.
SetActive
(
m_curBlood
>
i
);
m_bloodObj
.
transform
.
GetChild
(
i
).
gameObject
.
SetActive
(
m_curBlood
>
i
);
}
}
ResetKey
();
ResetDoor
();
}
}
//设置状态selectUI
//设置状态selectUI
public
void
SetSelectUIState
(
bool
value
)
public
void
SetSelectUIState
(
bool
value
)
...
@@ -649,7 +651,15 @@ public class BattleUI : MonoBehaviour
...
@@ -649,7 +651,15 @@ public class BattleUI : MonoBehaviour
{
{
if
(!
m_doorObj
)
if
(!
m_doorObj
)
{
{
m_doorObj
=
PoolManager
.
Instance
.
GetObjectFromPool
(
CacheManager
.
Instance
.
doorObj
);
int
varRand
=
UnityEngine
.
Random
.
Range
(
0
,
5
);
if
(
varRand
<
2
)
{
m_doorObj
=
PoolManager
.
Instance
.
GetObjectFromPool
(
CacheManager
.
Instance
.
door1Obj
);
}
else
{
m_doorObj
=
PoolManager
.
Instance
.
GetObjectFromPool
(
CacheManager
.
Instance
.
door2Obj
);
}
m_doorObj
.
transform
.
position
=
m_doorPos
;
m_doorObj
.
transform
.
position
=
m_doorPos
;
}
}
else
else
...
@@ -722,8 +732,31 @@ public class BattleUI : MonoBehaviour
...
@@ -722,8 +732,31 @@ public class BattleUI : MonoBehaviour
public
void
SetKeyId
(
int
id
)
public
void
SetKeyId
(
int
id
)
{
{
m_keyId
=
id
;
m_keyId
=
id
;
if
(
m_keyObj
)
{
PoolManager
.
Instance
.
ReturnObjectToPool
(
m_keyObj
);
m_keyObj
=
null
;
m_keyObj
=
null
;
}
}
}
//重置钥匙状态
private
void
ResetKey
()
{
m_keyId
=
0
;
if
(
m_keyObj
)
{
PoolManager
.
Instance
.
ReturnObjectToPool
(
m_keyObj
);
m_keyObj
=
null
;
}
}
//重置门状态
private
void
ResetDoor
()
{
if
(
m_doorObj
)
{
PoolManager
.
Instance
.
ReturnObjectToPool
(
m_doorObj
);
m_doorObj
=
null
;
}
}
//设置npc对话
//设置npc对话
public
void
SetNpcDialogue
(
float
x
,
float
y
)
public
void
SetNpcDialogue
(
float
x
,
float
y
)
{
{
...
...
Magnet/Assets/#A2_Scripts/Pool/CacheManager.cs
View file @
39bd7d72
...
@@ -13,7 +13,9 @@ public class CacheManager : MonoBehaviour
...
@@ -13,7 +13,9 @@ public class CacheManager : MonoBehaviour
[
SerializeField
]
[
SerializeField
]
private
GameObject
m_triggerObj
;
//机关
private
GameObject
m_triggerObj
;
//机关
[
SerializeField
]
[
SerializeField
]
private
GameObject
m_doorObj
;
//门
private
GameObject
m_door1Obj
;
//门1
[
SerializeField
]
private
GameObject
m_door2Obj
;
//门2
[
SerializeField
]
[
SerializeField
]
private
GameObject
m_key1Obj
;
//钥匙1
private
GameObject
m_key1Obj
;
//钥匙1
[
SerializeField
]
[
SerializeField
]
...
@@ -30,7 +32,8 @@ public class CacheManager : MonoBehaviour
...
@@ -30,7 +32,8 @@ public class CacheManager : MonoBehaviour
public
GameObject
smallMagnetObj
=>
m_smallMagnetObj
;
public
GameObject
smallMagnetObj
=>
m_smallMagnetObj
;
public
GameObject
coinPropObj
=>
m_coinPropObj
;
public
GameObject
coinPropObj
=>
m_coinPropObj
;
public
GameObject
triggerObj
=>
m_triggerObj
;
public
GameObject
triggerObj
=>
m_triggerObj
;
public
GameObject
doorObj
=>
m_doorObj
;
public
GameObject
door1Obj
=>
m_door1Obj
;
public
GameObject
door2Obj
=>
m_door2Obj
;
public
GameObject
key1Obj
=>
m_key1Obj
;
public
GameObject
key1Obj
=>
m_key1Obj
;
public
GameObject
key2Obj
=>
m_key2Obj
;
public
GameObject
key2Obj
=>
m_key2Obj
;
public
GameObject
npcObj
=>
m_npcObj
;
public
GameObject
npcObj
=>
m_npcObj
;
...
...
Magnet/Assets/#A3_Prefabs/Char/Door1.prefab
0 → 100644
View file @
39bd7d72
%YAML
1.1
%TAG
!u!
tag:unity3d.com,2011:
---
!u!1
&1172303717906988032
GameObject
:
m_ObjectHideFlags
:
0
m_CorrespondingSourceObject
:
{
fileID
:
0
}
m_PrefabInstance
:
{
fileID
:
0
}
m_PrefabAsset
:
{
fileID
:
0
}
serializedVersion
:
6
m_Component
:
-
component
:
{
fileID
:
1861252925755440132
}
-
component
:
{
fileID
:
6152123456263498253
}
-
component
:
{
fileID
:
5779047695429776841
}
m_Layer
:
0
m_Name
:
trigger
m_TagString
:
Untagged
m_Icon
:
{
fileID
:
0
}
m_NavMeshLayer
:
0
m_StaticEditorFlags
:
0
m_IsActive
:
1
---
!u!4
&1861252925755440132
Transform
:
m_ObjectHideFlags
:
0
m_CorrespondingSourceObject
:
{
fileID
:
0
}
m_PrefabInstance
:
{
fileID
:
0
}
m_PrefabAsset
:
{
fileID
:
0
}
m_GameObject
:
{
fileID
:
1172303717906988032
}
m_LocalRotation
:
{
x
:
0
,
y
:
0
,
z
:
0
,
w
:
1
}
m_LocalPosition
:
{
x
:
2.51
,
y
:
1.06
,
z
:
0.05
}
m_LocalScale
:
{
x
:
2
,
y
:
2
,
z
:
0.2
}
m_Children
:
[]
m_Father
:
{
fileID
:
4539085461302232658
}
m_RootOrder
:
0
m_LocalEulerAnglesHint
:
{
x
:
0
,
y
:
0
,
z
:
0
}
---
!u!65
&6152123456263498253
BoxCollider
:
m_ObjectHideFlags
:
0
m_CorrespondingSourceObject
:
{
fileID
:
0
}
m_PrefabInstance
:
{
fileID
:
0
}
m_PrefabAsset
:
{
fileID
:
0
}
m_GameObject
:
{
fileID
:
1172303717906988032
}
m_Material
:
{
fileID
:
0
}
m_IsTrigger
:
1
m_Enabled
:
1
serializedVersion
:
2
m_Size
:
{
x
:
1
,
y
:
1
,
z
:
1
}
m_Center
:
{
x
:
0
,
y
:
0
,
z
:
0
}
---
!u!114
&5779047695429776841
MonoBehaviour
:
m_ObjectHideFlags
:
0
m_CorrespondingSourceObject
:
{
fileID
:
0
}
m_PrefabInstance
:
{
fileID
:
0
}
m_PrefabAsset
:
{
fileID
:
0
}
m_GameObject
:
{
fileID
:
1172303717906988032
}
m_Enabled
:
1
m_EditorHideFlags
:
0
m_Script
:
{
fileID
:
11500000
,
guid
:
8d4e6f170c751f54f87d493c9e28ed65
,
type
:
3
}
m_Name
:
m_EditorClassIdentifier
:
m_keyId
:
1
---
!u!1
&4533096668072911434
GameObject
:
m_ObjectHideFlags
:
0
m_CorrespondingSourceObject
:
{
fileID
:
0
}
m_PrefabInstance
:
{
fileID
:
0
}
m_PrefabAsset
:
{
fileID
:
0
}
serializedVersion
:
6
m_Component
:
-
component
:
{
fileID
:
4539085461302232658
}
-
component
:
{
fileID
:
4510703295884951896
}
-
component
:
{
fileID
:
4520517437252145440
}
-
component
:
{
fileID
:
4470681007709732228
}
m_Layer
:
0
m_Name
:
Door1
m_TagString
:
Untagged
m_Icon
:
{
fileID
:
0
}
m_NavMeshLayer
:
0
m_StaticEditorFlags
:
0
m_IsActive
:
1
---
!u!4
&4539085461302232658
Transform
:
m_ObjectHideFlags
:
0
m_CorrespondingSourceObject
:
{
fileID
:
0
}
m_PrefabInstance
:
{
fileID
:
0
}
m_PrefabAsset
:
{
fileID
:
0
}
m_GameObject
:
{
fileID
:
4533096668072911434
}
m_LocalRotation
:
{
x
:
0
,
y
:
0.7071068
,
z
:
0
,
w
:
0.7071068
}
m_LocalPosition
:
{
x
:
-10
,
y
:
0
,
z
:
2.8
}
m_LocalScale
:
{
x
:
1.5
,
y
:
2
,
z
:
1.5
}
m_Children
:
-
{
fileID
:
1861252925755440132
}
m_Father
:
{
fileID
:
0
}
m_RootOrder
:
0
m_LocalEulerAnglesHint
:
{
x
:
0
,
y
:
90
,
z
:
0
}
---
!u!33
&4510703295884951896
MeshFilter
:
m_ObjectHideFlags
:
0
m_CorrespondingSourceObject
:
{
fileID
:
0
}
m_PrefabInstance
:
{
fileID
:
0
}
m_PrefabAsset
:
{
fileID
:
0
}
m_GameObject
:
{
fileID
:
4533096668072911434
}
m_Mesh
:
{
fileID
:
4300000
,
guid
:
45ce4593ac20f634b98e0baef2fa39f5
,
type
:
3
}
---
!u!23
&4520517437252145440
MeshRenderer
:
m_ObjectHideFlags
:
0
m_CorrespondingSourceObject
:
{
fileID
:
0
}
m_PrefabInstance
:
{
fileID
:
0
}
m_PrefabAsset
:
{
fileID
:
0
}
m_GameObject
:
{
fileID
:
4533096668072911434
}
m_Enabled
:
1
m_CastShadows
:
1
m_ReceiveShadows
:
1
m_DynamicOccludee
:
1
m_MotionVectors
:
1
m_LightProbeUsage
:
1
m_ReflectionProbeUsage
:
1
m_RayTracingMode
:
2
m_RenderingLayerMask
:
1
m_RendererPriority
:
0
m_Materials
:
-
{
fileID
:
2100000
,
guid
:
4930c6ffa5b9b9f4098249a43abf8506
,
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
:
3
m_MinimumChartSize
:
4
m_AutoUVMaxDistance
:
0.5
m_AutoUVMaxAngle
:
89
m_LightmapParameters
:
{
fileID
:
0
}
m_SortingLayerID
:
0
m_SortingLayer
:
0
m_SortingOrder
:
0
---
!u!64
&4470681007709732228
MeshCollider
:
m_ObjectHideFlags
:
0
m_CorrespondingSourceObject
:
{
fileID
:
0
}
m_PrefabInstance
:
{
fileID
:
0
}
m_PrefabAsset
:
{
fileID
:
0
}
m_GameObject
:
{
fileID
:
4533096668072911434
}
m_Material
:
{
fileID
:
0
}
m_IsTrigger
:
0
m_Enabled
:
1
serializedVersion
:
4
m_Convex
:
0
m_CookingOptions
:
30
m_Mesh
:
{
fileID
:
4300000
,
guid
:
48d84bda24591244bbc6b1afcb9c31ac
,
type
:
3
}
Magnet/Assets/#A3_Prefabs/Char/Door.prefab.meta
→
Magnet/Assets/#A3_Prefabs/Char/Door
1
.prefab.meta
View file @
39bd7d72
File moved
Magnet/Assets/#A3_Prefabs/Char/Door.prefab
→
Magnet/Assets/#A3_Prefabs/Char/Door
2
.prefab
View file @
39bd7d72
File moved
Magnet/Assets/#A3_Prefabs/Char/Door2.prefab.meta
0 → 100644
View file @
39bd7d72
fileFormatVersion: 2
guid: 2ea530b5f76c5ce40a5b39e9d61b33fc
PrefabImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment