Example #1
0
    public void ResetToSetup()
    {
        beam.GetComponent <ResetPhysics>().Reset();
        pointStart.GetComponent <ResetPhysics>().Reset();
        pointEnd.GetComponent <ResetPhysics>().Reset();

        // Destroy all joints created on SetToPlay()
        if (startJoint)
        {
            Destroy(startJoint);
        }
        if (endJoint)
        {
            Destroy(endJoint);
        }
        Destroy(beamStartJoint);
        Destroy(beamEndJoint);
        Destroy(beam.GetComponent <CapsuleCollider>());

        beam.rigidbody.isKinematic       = true;
        pointStart.rigidbody.isKinematic = true;
        pointEnd.rigidbody.isKinematic   = true;

        PositionBeam();

        beam.renderer.enabled       = true;
        pointStart.renderer.enabled = true;
        pointEnd.renderer.enabled   = true;

        BeamAppereanceState = eBeamAppereanceState.NormalMode;
        BeamState           = eBeamState.BuiltMode;
    }
Example #2
0
	public void ResetToSetup() {
		
		beam.GetComponent<ResetPhysics>().Reset();
		pointStart.GetComponent<ResetPhysics>().Reset();
		pointEnd.GetComponent<ResetPhysics>().Reset();

		// Destroy all joints created on SetToPlay()
		if (startJoint) {
			Destroy (startJoint);
		}
		if (endJoint) {
			Destroy (endJoint);
		}
		Destroy (beamStartJoint);
		Destroy (beamEndJoint);
		Destroy(beam.GetComponent<CapsuleCollider>());

		beam.rigidbody.isKinematic = true;
		pointStart.rigidbody.isKinematic = true;
		pointEnd.rigidbody.isKinematic = true;

		PositionBeam();

		beam.renderer.enabled = true;
		pointStart.renderer.enabled = true;
		pointEnd.renderer.enabled = true;

		BeamAppereanceState = eBeamAppereanceState.NormalMode;
		BeamState = eBeamState.BuiltMode;
	}