WallProjectileTrap.cs 501 Bytes
Newer Older
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
using UnityEngine;
using System.Collections;

public class WallProjectileTrap : MonoBehaviour {
    public int timeInterval = 1;
    public float force = 1;
    public Vector2 vector;
    private ShootSuff s;
    public GameObject obj;

	// Use this for initialization
	void Start () {
	
	}
	
	// Update is called once per frame
	void Update ()
    {
	    if(Time.time % timeInterval == 0)
        {
            //shoot projectile
            s.Shoot(obj, vector.normalized, force);
        }
	}
}