示例#1
0
    //creates a beam that functions as an extension of the beam that this object has collided with
    //taking in the original beams colour
    private void CreateExtendedBeam()
    {
        splineCurve            = this.gameObject.AddComponent <StraightSplineBeam>();
        splineCurve.beamColour = beamColour;
        splineCurve.beamLength = beamLength;

        AkSoundEngine.SetState("Drone_Modulator", "Reflector");
    }
示例#2
0
    //Destroys a beam that exists if one is still in use, before creating a new one that replaces it.
    //Uses the colour property that can either be a combined colour or singular one, depending on the
    //situation.
    void CreateNewLightBeam()
    {
        DestroyBeam();

        splineCurve            = this.gameObject.AddComponent <StraightSplineBeam>();
        splineCurve.beamColour = newBeamColour;
        splineCurve.beamLength = beamLength;
    }
示例#3
0
 //Sets up a lightbean object with its colour and size specified from public variables.
 //This allows for quick customised emitters to be made, using prefabs to duplicate them.
 //The length is doubled internally to make the length match the desired value, to fix
 //an issue with the bezier curve math setup halving the length.
 void Start()
 {
     lineBeam            = this.gameObject.AddComponent <StraightSplineBeam>();
     lineBeam.beamColour = colouredBeam;
     lineBeam.beamLength = beamLength;
     beamLength          = beamLength * 2;
     if (!switchedOn)
     {
         ToggleLight();
     }
     else
     {
         AkSoundEngine.PostEvent("Drone", gameObject);
     }
 }