protected override LightBase CreateLight() { LaserBeam laserBeam = LightPool.Create <LaserBeam>(new Ray(base.transform.position, Direction)); laserBeam.source = this; return(laserBeam); }
protected override LightBase CreateLight(Vector3 pos, Vector3 dir) { LightBeamConvex lightBeamConvex = LightPool.Create <LightBeamConvex>(pos, dir, base.transform); lightBeamConvex.focalLength = focalLength; return(lightBeamConvex); }
private void Awake() { if (_instance == null) { _instance = this; } else if (_instance != this) { UnityEngine.Object.Destroy(this); } pool = new Dictionary <Type, Stack <LightBase> >(); prefabs = new Dictionary <Type, GameObject>(); prefabs.Add(typeof(LightBeam), (GameObject)Resources.Load("LightBeam_ray")); prefabs.Add(typeof(LaserBeam), (GameObject)Resources.Load("LaserBeam")); prefabs.Add(typeof(LightBeamConvex), (GameObject)Resources.Load("LightBeam_Convex")); }
protected virtual LightBase CreateLight() { return(LightPool.Create <LightBeam>(new Ray(base.transform.position, Direction))); }
protected virtual LightBase CreateLight(Vector3 pos, Vector3 dir) { return(LightPool.Create <LightBeam>(pos, dir, base.transform)); }
private T CreateDefaultOutput <T>(T input, Vector3 point) where T : LightBase { return(LightPool.Create <T>(point, point - input.transform.position, base.transform)); }