public void ClearBehaviour() { _behaviour.OnEndBullet(); _behaviour = null; MeshRenderer.enabled = false; }
public void Remove(ThousandBulletBehaviour bulletBehaviour) { var node = _dictionary[bulletBehaviour]; _controllers.Remove(node); _recycle.Remove(node.Value); _dictionary.Remove(bulletBehaviour); }
public void SerBehaviour(ThousandBulletBehaviour behaviour) { _behaviour = behaviour; Initialize(); _behaviour.SetPrefab(this); _behaviour.OnStartBullet(); MeshRenderer.enabled = true; }
public void AddBullet(ThousandBulletBehaviour bulletBehaviour, Vector3 position, Quaternion rotation) { var controller = new BulletRecycleController(bulletBehaviour); var obj = _recycle.Instanciate(controller, DefaultPrefab, position, rotation); obj.transform.parent = transform; var node = _controllers.AddLast(controller); _dictionary.Add(bulletBehaviour, node); }
public BulletRecycleController(ThousandBulletBehaviour behaviour) { BulletBehaviour = behaviour; }