Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Sign in / Register
Toggle navigation
T
tuseGameColor
Project
Project
Details
Activity
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
Packages
Packages
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
shujianhe
tuseGameColor
Commits
a036130f
Commit
a036130f
authored
Aug 24, 2023
by
lijin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
散弹枪逻辑优化,暂未使用
parent
8f59239f
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
214 additions
and
0 deletions
+214
-0
GameMgr.cs
Assets/GameMgr/GameMgr.cs
+12
-0
GunItemMgr.cs
Assets/GameMgr/GunItemMgr.cs
+58
-0
GunItemMgr.cs.meta
Assets/GameMgr/GunItemMgr.cs.meta
+11
-0
GameMgr.prefab
Assets/Resources/perfabs/GameMgr.prefab
+133
-0
No files found.
Assets/GameMgr/GameMgr.cs
View file @
a036130f
...
...
@@ -16,9 +16,11 @@ public class GameMgr : MonoBehaviour
public
MaskItemMgr
miMgr
;
//遮罩管理器
public
TextItemMgr
tiMgr
;
//字体管理器
public
EffectItemMgr
eiMgr
;
//特效管理器
public
GunItemMgr
giMgr
;
//枪筒管理器
public
Texture2D
gray
;
//遮罩显示图元
void
Update
()
{
Click
();
//点击事件逻辑
...
...
@@ -116,6 +118,16 @@ public class GameMgr : MonoBehaviour
public
void
UseGun
(
Vector2
v
)
{
//giMgr.Init(v);
//for (int i = 0; i < 100; i++)
//{
// Vector3 _v = giMgr.Next();
// if (OnClickPixel(_v))
// {
// return;
// }
//}
List
<
Vector2
>
list
=
new
List
<
Vector2
>();
for
(
int
i
=
0
;
i
<
gunSize
.
x
;
i
++)
{
...
...
Assets/GameMgr/GunItemMgr.cs
0 → 100644
View file @
a036130f
using
System
;
using
System.Collections.Generic
;
using
System.Linq
;
using
System.Text
;
using
System.Threading.Tasks
;
using
UnityEngine
;
public
class
GunItemMgr
:
MonoBehaviour
{
public
bool
isUse
=
false
;
public
RectTransform
rect
;
public
RectTransform
item
;
public
RectTransform
pos
;
public
Vector3
v1
=
new
Vector3
(
0
,
0
,
360
);
public
Vector3
v2
=
new
Vector3
(
0
,
1f
,
0
);
public
int
curCount
=
0
;
public
int
count
=
0
;
public
int
step
=
0
;
public
void
Init
(
Vector2
v
)
{
isUse
=
true
;
step
=
1
;
count
=
2
*
2
^
step
;
curCount
=
0
;
item
.
localPosition
=
v
;
item
.
localEulerAngles
=
Vector3
.
zero
;
pos
.
localPosition
=
Vector3
.
zero
;
}
public
Vector3
Next
()
{
if
(
isUse
)
{
isUse
=
false
;
return
GetPos
();
}
item
.
localEulerAngles
=
curCount
*
v1
/
count
;
pos
.
localPosition
=
v2
*
step
;
curCount
++;
if
(
curCount
>=
count
)
{
step
++;
count
=
2
*
2
^
step
;
curCount
=
0
;
}
return
GetPos
();
}
public
Vector3
GetPos
()
{
pos
.
SetParent
(
rect
);
Vector2
v
=
pos
.
localPosition
;
pos
.
SetParent
(
item
);
return
v
;
}
}
\ No newline at end of file
Assets/GameMgr/GunItemMgr.cs.meta
0 → 100644
View file @
a036130f
fileFormatVersion: 2
guid: 6e9df438167b31449980ed3df232db7c
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:
Assets/Resources/perfabs/GameMgr.prefab
View file @
a036130f
...
...
@@ -5449,6 +5449,8 @@ MonoBehaviour:
dynamicGroupsData
:
[]
imgpng
:
{
fileID
:
7126587409335573646
}
imgjpg
:
{
fileID
:
2338271980406512720
}
c_png
:
[]
c_map
:
[]
rect
:
{
fileID
:
136994829194703267
}
curGroupId
:
-1
---
!u!114
&5950458851555830853
...
...
@@ -5597,6 +5599,43 @@ MonoBehaviour:
life
:
0
Rect
:
{
fileID
:
3855441703257783557
}
ps
:
{
fileID
:
3772323112090822474
}
---
!u!1
&4322401236449916857
GameObject
:
m_ObjectHideFlags
:
0
m_CorrespondingSourceObject
:
{
fileID
:
0
}
m_PrefabInstance
:
{
fileID
:
0
}
m_PrefabAsset
:
{
fileID
:
0
}
serializedVersion
:
6
m_Component
:
-
component
:
{
fileID
:
8205073682845336519
}
m_Layer
:
0
m_Name
:
GunItem
m_TagString
:
Untagged
m_Icon
:
{
fileID
:
0
}
m_NavMeshLayer
:
0
m_StaticEditorFlags
:
0
m_IsActive
:
1
---
!u!224
&8205073682845336519
RectTransform
:
m_ObjectHideFlags
:
0
m_CorrespondingSourceObject
:
{
fileID
:
0
}
m_PrefabInstance
:
{
fileID
:
0
}
m_PrefabAsset
:
{
fileID
:
0
}
m_GameObject
:
{
fileID
:
4322401236449916857
}
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_ConstrainProportionsScale
:
0
m_Children
:
-
{
fileID
:
4755947299850074345
}
m_Father
:
{
fileID
:
5869988217578198578
}
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
:
0
,
y
:
0
}
m_Pivot
:
{
x
:
0.5
,
y
:
0.5
}
---
!u!1
&4437478244303412374
GameObject
:
m_ObjectHideFlags
:
0
...
...
@@ -5794,6 +5833,7 @@ RectTransform:
-
{
fileID
:
800309816225797410
}
-
{
fileID
:
8460472138427881079
}
-
{
fileID
:
4304950912892358161
}
-
{
fileID
:
5869988217578198578
}
m_Father
:
{
fileID
:
7902676659994826364
}
m_RootOrder
:
-1
m_LocalEulerAnglesHint
:
{
x
:
0
,
y
:
0
,
z
:
0
}
...
...
@@ -5895,6 +5935,7 @@ MonoBehaviour:
miMgr
:
{
fileID
:
5326343875061023361
}
tiMgr
:
{
fileID
:
1490190831900560014
}
eiMgr
:
{
fileID
:
3661810172065829162
}
giMgr
:
{
fileID
:
4904341011800289242
}
gray
:
{
fileID
:
2800000
,
guid
:
cfe63fc6a2e3edc409d653cefd205fb7
,
type
:
3
}
---
!u!114
&977886392249047969
MonoBehaviour
:
...
...
@@ -5916,6 +5957,98 @@ MonoBehaviour:
MaxScale
:
7
Min_Move
:
0.23
Max_Move
:
8
---
!u!1
&6884362798581633399
GameObject
:
m_ObjectHideFlags
:
0
m_CorrespondingSourceObject
:
{
fileID
:
0
}
m_PrefabInstance
:
{
fileID
:
0
}
m_PrefabAsset
:
{
fileID
:
0
}
serializedVersion
:
6
m_Component
:
-
component
:
{
fileID
:
5869988217578198578
}
-
component
:
{
fileID
:
4904341011800289242
}
m_Layer
:
0
m_Name
:
GunBox
m_TagString
:
Untagged
m_Icon
:
{
fileID
:
0
}
m_NavMeshLayer
:
0
m_StaticEditorFlags
:
0
m_IsActive
:
1
---
!u!224
&5869988217578198578
RectTransform
:
m_ObjectHideFlags
:
0
m_CorrespondingSourceObject
:
{
fileID
:
0
}
m_PrefabInstance
:
{
fileID
:
0
}
m_PrefabAsset
:
{
fileID
:
0
}
m_GameObject
:
{
fileID
:
6884362798581633399
}
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_ConstrainProportionsScale
:
0
m_Children
:
-
{
fileID
:
8205073682845336519
}
m_Father
:
{
fileID
:
7679003703182876708
}
m_RootOrder
:
-1
m_LocalEulerAnglesHint
:
{
x
:
0
,
y
:
0
,
z
:
0
}
m_AnchorMin
:
{
x
:
0
,
y
:
0
}
m_AnchorMax
:
{
x
:
1
,
y
:
1
}
m_AnchoredPosition
:
{
x
:
0
,
y
:
0
}
m_SizeDelta
:
{
x
:
0
,
y
:
0
}
m_Pivot
:
{
x
:
0.5
,
y
:
0.5
}
---
!u!114
&4904341011800289242
MonoBehaviour
:
m_ObjectHideFlags
:
0
m_CorrespondingSourceObject
:
{
fileID
:
0
}
m_PrefabInstance
:
{
fileID
:
0
}
m_PrefabAsset
:
{
fileID
:
0
}
m_GameObject
:
{
fileID
:
6884362798581633399
}
m_Enabled
:
1
m_EditorHideFlags
:
0
m_Script
:
{
fileID
:
11500000
,
guid
:
6e9df438167b31449980ed3df232db7c
,
type
:
3
}
m_Name
:
m_EditorClassIdentifier
:
isUse
:
0
rect
:
{
fileID
:
5869988217578198578
}
item
:
{
fileID
:
8205073682845336519
}
pos
:
{
fileID
:
4755947299850074345
}
v1
:
{
x
:
0
,
y
:
0
,
z
:
30
}
v2
:
{
x
:
0
,
y
:
5
,
z
:
0
}
---
!u!1
&8495604213876096662
GameObject
:
m_ObjectHideFlags
:
0
m_CorrespondingSourceObject
:
{
fileID
:
0
}
m_PrefabInstance
:
{
fileID
:
0
}
m_PrefabAsset
:
{
fileID
:
0
}
serializedVersion
:
6
m_Component
:
-
component
:
{
fileID
:
4755947299850074345
}
m_Layer
:
0
m_Name
:
GunPos
m_TagString
:
Untagged
m_Icon
:
{
fileID
:
0
}
m_NavMeshLayer
:
0
m_StaticEditorFlags
:
0
m_IsActive
:
1
---
!u!224
&4755947299850074345
RectTransform
:
m_ObjectHideFlags
:
0
m_CorrespondingSourceObject
:
{
fileID
:
0
}
m_PrefabInstance
:
{
fileID
:
0
}
m_PrefabAsset
:
{
fileID
:
0
}
m_GameObject
:
{
fileID
:
8495604213876096662
}
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_ConstrainProportionsScale
:
0
m_Children
:
[]
m_Father
:
{
fileID
:
8205073682845336519
}
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
:
0
,
y
:
0
}
m_Pivot
:
{
x
:
0.5
,
y
:
0.5
}
---
!u!1
&8927003478227325637
GameObject
:
m_ObjectHideFlags
:
0
...
...
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