示例#1
0
        protected override LightBase CreateLight()
        {
            LaserBeam laserBeam = LightPool.Create <LaserBeam>(new Ray(base.transform.position, Direction));

            laserBeam.source = this;
            return(laserBeam);
        }
示例#2
0
        protected override LightBase CreateLight(Vector3 pos, Vector3 dir)
        {
            LightBeamConvex lightBeamConvex = LightPool.Create <LightBeamConvex>(pos, dir, base.transform);

            lightBeamConvex.focalLength = focalLength;
            return(lightBeamConvex);
        }
示例#3
0
 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"));
 }
示例#4
0
 protected virtual LightBase CreateLight()
 {
     return(LightPool.Create <LightBeam>(new Ray(base.transform.position, Direction)));
 }
示例#5
0
 protected virtual LightBase CreateLight(Vector3 pos, Vector3 dir)
 {
     return(LightPool.Create <LightBeam>(pos, dir, base.transform));
 }
示例#6
0
 private T CreateDefaultOutput <T>(T input, Vector3 point) where T : LightBase
 {
     return(LightPool.Create <T>(point, point - input.transform.position, base.transform));
 }