Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
S
StockRunning
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
czy
StockRunning
Commits
df4cd1e4
Commit
df4cd1e4
authored
Apr 21, 2021
by
czy
Browse files
Options
Browse Files
Download
Plain Diff
配置管理1.0
parents
31b8f212
43be5c23
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
113 additions
and
6 deletions
+113
-6
DemoScenes.unity
StockRunning/Assets/#A1_Scenes/DemoScenes.unity
+48
-1
ConfigurationFile.cs
StockRunning/Assets/My/Scripts/ConfigurationFile.cs
+35
-0
ConfigurationFile.cs.meta
StockRunning/Assets/My/Scripts/ConfigurationFile.cs.meta
+11
-0
PlayerMove.cs
StockRunning/Assets/My/Scripts/Player/PlayerMove.cs
+19
-5
No files found.
StockRunning/Assets/#A1_Scenes/DemoScenes.unity
View file @
df4cd1e4
...
...
@@ -435,7 +435,7 @@ Transform:
-
{
fileID
:
1959561188
}
-
{
fileID
:
1392949506
}
m_Father
:
{
fileID
:
0
}
m_RootOrder
:
4
m_RootOrder
:
5
m_LocalEulerAnglesHint
:
{
x
:
0
,
y
:
0
,
z
:
0
}
---
!u!1
&1338506704
GameObject
:
...
...
@@ -617,6 +617,53 @@ Transform:
type
:
3
}
m_PrefabInstance
:
{
fileID
:
594899301
}
m_PrefabAsset
:
{
fileID
:
0
}
---
!u!1
&1960597216
GameObject
:
m_ObjectHideFlags
:
0
m_CorrespondingSourceObject
:
{
fileID
:
0
}
m_PrefabInstance
:
{
fileID
:
0
}
m_PrefabAsset
:
{
fileID
:
0
}
serializedVersion
:
6
m_Component
:
-
component
:
{
fileID
:
1960597218
}
-
component
:
{
fileID
:
1960597217
}
m_Layer
:
0
m_Name
:
ConfigurationFfile
m_TagString
:
Untagged
m_Icon
:
{
fileID
:
0
}
m_NavMeshLayer
:
0
m_StaticEditorFlags
:
0
m_IsActive
:
1
---
!u!114
&1960597217
MonoBehaviour
:
m_ObjectHideFlags
:
0
m_CorrespondingSourceObject
:
{
fileID
:
0
}
m_PrefabInstance
:
{
fileID
:
0
}
m_PrefabAsset
:
{
fileID
:
0
}
m_GameObject
:
{
fileID
:
1960597216
}
m_Enabled
:
1
m_EditorHideFlags
:
0
m_Script
:
{
fileID
:
11500000
,
guid
:
36730f682241d5c45a06bc01fc344b12
,
type
:
3
}
m_Name
:
m_EditorClassIdentifier
:
VSpeed
:
52.53
SpeedLevel
:
1
AddSpeed
:
10
HSpeed
:
10
---
!u!4
&1960597218
Transform
:
m_ObjectHideFlags
:
0
m_CorrespondingSourceObject
:
{
fileID
:
0
}
m_PrefabInstance
:
{
fileID
:
0
}
m_PrefabAsset
:
{
fileID
:
0
}
m_GameObject
:
{
fileID
:
1960597216
}
m_LocalRotation
:
{
x
:
0
,
y
:
0
,
z
:
0
,
w
:
1
}
m_LocalPosition
:
{
x
:
-2.6968515
,
y
:
4.3138065
,
z
:
-495.98093
}
m_LocalScale
:
{
x
:
1
,
y
:
1
,
z
:
1
}
m_Children
:
[]
m_Father
:
{
fileID
:
0
}
m_RootOrder
:
4
m_LocalEulerAnglesHint
:
{
x
:
0
,
y
:
0
,
z
:
0
}
---
!u!114
&2347244091251205803
stripped
MonoBehaviour
:
m_CorrespondingSourceObject
:
{
fileID
:
6064464676810081129
,
guid
:
919382978f5e2684ba83e6daf6491458
,
...
...
StockRunning/Assets/My/Scripts/ConfigurationFile.cs
0 → 100644
View file @
df4cd1e4
using
System.Collections
;
using
System.Collections.Generic
;
using
UnityEngine
;
public
class
ConfigurationFile
:
MonoBehaviour
{
[
Header
(
"AI和主角"
)]
[
Tooltip
(
"控制向前的速度。"
)]
public
float
VSpeed
=
20.0f
;
public
int
SpeedLevel
=
1
;
[
Tooltip
(
"没升一级增加的速度"
)]
public
float
AddSpeed
=
10.0f
;
[
Tooltip
(
"控制左右移动的速度。"
)]
public
float
HSpeed
=
10.0f
;
public
static
ConfigurationFile
instance
;
private
void
Awake
()
{
instance
=
this
;
}
void
Start
()
{
}
void
Update
()
{
}
}
StockRunning/Assets/My/Scripts/ConfigurationFile.cs.meta
0 → 100644
View file @
df4cd1e4
fileFormatVersion: 2
guid: 36730f682241d5c45a06bc01fc344b12
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:
StockRunning/Assets/My/Scripts/Player/PlayerMove.cs
View file @
df4cd1e4
...
...
@@ -13,12 +13,14 @@ public class PlayerMove : MonoBehaviour
{
[
Header
(
"控制移动"
)]
[
Tooltip
(
"控制向前的速度。"
)]
p
ublic
float
VSpeed
=
4
0.0f
;
p
ublic
int
SpeedLevel
=
1
;
p
rivate
float
VSpeed
=
2
0.0f
;
p
rivate
int
SpeedLevel
=
1
;
[
Tooltip
(
"没升一级增加的速度"
)]
p
ublic
float
AddSpeed
=
10.0f
;
p
rivate
float
AddSpeed
=
10.0f
;
[
Tooltip
(
"控制左右移动的速度。"
)]
public
float
HSpeed
=
10.0f
;
private
float
HSpeed
=
10.0f
;
[
Tooltip
(
"主角移动方式"
)]
public
MoveType
moveType
=
MoveType
.
MoveType3
;
...
...
@@ -54,6 +56,10 @@ public class PlayerMove : MonoBehaviour
// Start is called before the first frame update
void
Start
()
{
//委托注册方法
BattleCtrl
.
instance
.
turnDir
+=
TurnDir
;
...
...
@@ -161,6 +167,14 @@ public class PlayerMove : MonoBehaviour
//print("游戏是否开始:"+ BattleCtrl.instance.isStartBattle);
//print("游戏是否结束:"+ BattleCtrl.instance.isEndBattle);
//从配置文件ConfigurationFile中获取数据
VSpeed
=
ConfigurationFile
.
instance
.
VSpeed
;
SpeedLevel
=
ConfigurationFile
.
instance
.
SpeedLevel
;
AddSpeed
=
ConfigurationFile
.
instance
.
AddSpeed
;
HSpeed
=
ConfigurationFile
.
instance
.
HSpeed
;
if
(!
BattleCtrl
.
instance
.
isStartBattle
)
{
isAddSpeed
=
true
;
...
...
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