Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
gadig
four
Commits
f7172a18
Commit
f7172a18
authored
Nov 20, 2016
by
Luke A Smith
Browse files
Merge branch 'ShootScript' into 'master'
Wrote shootStuff Shoots stuff See merge request
!33
parents
fcf4c784
d57b5c78
Changes
1
Hide whitespace changes
Inline
Side-by-side
Assets/Scripts/ShootSuff.cs
0 → 100644
View file @
f7172a18
using
UnityEngine
;
using
System.Collections
;
public
class
ShootSuff
:
MonoBehaviour
{
public
void
Shoot
(
GameObject
bul
,
Vector2
dir
,
float
force
=
1
)
{
GameObject
go
=
Instantiate
(
bul
,
transform
.
position
,
transform
.
rotation
)
as
GameObject
;
Rigidbody2D
rb2d
=
go
.
GetComponent
<
Rigidbody2D
>();
rb2d
.
AddForce
(
dir
*
force
);
}
}
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