Пример #1
0
    /// <summary>
    /// Excecuted when bullet is reactivated. It will set all values to the desired valued
    /// </summary>
    public void OnActivate(float size, Vector3 startPos, float direction, float speed)
    {
        BulletGO.transform.position   = startPos;
        BulletGO.transform.rotation   = Quaternion.Euler(0, 0, direction);
        BulletGO.transform.localScale = new Vector3(size, size, size);
        _boxCollider2D.size           = new Vector2(size, size);
        _size = size;

        HasCollided = false;
        BulletGO.SetActive(true);
    }
Пример #2
0
 /// <summary>
 /// Done when bullet is deactivated. Right now only disables the object
 /// </summary>
 public void OnDisable()
 {
     BulletGO.SetActive(false);
 }