[ create a new paste ] login | about

Link: http://codepad.org/GLpJPJSM    [ raw code | fork ]

C, pasted on Oct 13:
using System.Collections;
using System.Collections.Generic;
using UnityEngine;

public class Bullet : MonoBehaviour
{
    public float speed;
    public Player_Controller player;

    public void Update()
        {
        transform.Translate(Vector3.right * Time.deltaTime * speed);
        }

    private void OnTriggerEnter2D (Collider2D other)
        {
        AddToPool();
        }

    void AddToPool ()
        {
        player.AddBulletToPool(this);
        }
}


Create a new paste based on this one


Comments: