Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
3
3D Fruit
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
3D Fruit
Commits
20fbfe1d
Commit
20fbfe1d
authored
May 28, 2021
by
wanqing
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
场景预制体
parent
322067c6
Changes
5
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
3303 additions
and
3121 deletions
+3303
-3121
CheeseView.cs
3D Fruit/Assets/#A2_Scripts/Battle/View/CheeseView.cs
+82
-0
CheeseView.cs.meta
3D Fruit/Assets/#A2_Scripts/Battle/View/CheeseView.cs.meta
+11
-0
cheese.prefab
3D Fruit/Assets/#A3_Prefabs/cheese.prefab
+1348
-0
cheese.prefab.meta
3D Fruit/Assets/#A3_Prefabs/cheese.prefab.meta
+7
-0
Level0.prefab
3D Fruit/Assets/Res/Levels/Level0.prefab
+1855
-3121
No files found.
3D Fruit/Assets/#A2_Scripts/Battle/View/CheeseView.cs
0 → 100644
View file @
20fbfe1d
using
System.Collections
;
using
System.Collections.Generic
;
using
UnityEngine
;
public
class
CheeseView
:
MonoBehaviour
{
public
Transform
m_rotateTrans
;
public
Transform
m_rotateTarget
;
private
float
m_speed
=
200.0f
;
private
float
m_time
=
0.0f
;
private
float
m_radius
=
0.0f
;
//半径
private
float
m_angled
;
private
float
m_posX1
=
-
0.4f
;
private
float
m_posX2
=
-
0.3f
;
private
float
m_posX3
=
-
0.2f
;
private
bool
m_bControl1
=
true
;
private
bool
m_bControl2
=
true
;
private
bool
m_bFinish
=
false
;
// Start is called before the first frame update
void
Start
()
{
Vector3
varVec3
=
m_rotateTrans
.
localPosition
;
varVec3
.
x
=
m_posX1
;
m_rotateTrans
.
localPosition
=
varVec3
;
m_radius
=
0.4f
;
//Invoke("DelayPos2", 1.0f);
}
void
DelayPos2
()
{
Vector3
varVec3
=
m_rotateTrans
.
localPosition
;
varVec3
.
x
=
m_posX2
;
m_rotateTrans
.
localPosition
=
varVec3
;
m_radius
=
0.3f
;
Invoke
(
"DelayPos3"
,
1.0f
);
}
void
DelayPos3
()
{
Vector3
varVec3
=
m_rotateTrans
.
localPosition
;
varVec3
.
x
=
m_posX3
;
m_rotateTrans
.
localPosition
=
varVec3
;
m_radius
=
0.2f
;
Invoke
(
"DelayFinish"
,
1.0f
);
}
void
DelayFinish
()
{
//m_bFinish = true;
}
// Update is called once per frame
void
Update
()
{
m_angled
+=
(
m_speed
*
Time
.
deltaTime
)
%
360
;
//累加已经转过的角度
float
posX
=
m_radius
*
Mathf
.
Sin
(
m_angled
*
Mathf
.
Deg2Rad
);
//计算x位置
float
posZ
=
m_radius
*
Mathf
.
Cos
(
m_angled
*
Mathf
.
Deg2Rad
);
//计算y位置
m_rotateTrans
.
localPosition
=
new
Vector3
(
posX
,
0
,
posZ
)
+
m_rotateTarget
.
localPosition
;
//更新位置
if
(
m_rotateTrans
.
localPosition
.
x
<=
-
0.4f
&&
m_bControl1
)
{
m_bControl1
=
false
;
Debug
.
LogError
(
"aa"
);
}
//m_time += Time.deltaTime;
//if (m_time > 1.0f && m_time <= 2.0f)
//{
// if(m_bControl1)
// {
// m_bControl1 = false;
// }
//}
//else if (m_time > 2.0f && m_time <= 3.0f)
//{
//}
//if(!m_bFinish)
//{
// m_rotateTrans.RotateAround(m_rotateTarget.position, transform.up, m_speed);
//}
}
}
3D Fruit/Assets/#A2_Scripts/Battle/View/CheeseView.cs.meta
0 → 100644
View file @
20fbfe1d
fileFormatVersion: 2
guid: 2d99a7fe465cdfa4b85f5c040265762b
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:
3D Fruit/Assets/#A3_Prefabs/cheese.prefab
0 → 100644
View file @
20fbfe1d
This diff is collapsed.
Click to expand it.
3D Fruit/Assets/#A3_Prefabs/cheese.prefab.meta
0 → 100644
View file @
20fbfe1d
fileFormatVersion: 2
guid: d6d07649d17d6fa41b33735705fd6bb8
PrefabImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:
3D Fruit/Assets/Res/Levels/Level0.prefab
View file @
20fbfe1d
This diff is collapsed.
Click to expand it.
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