Exemple #1
0
        public void Execute(ScriptContext context, System.Windows.Window window, ScriptEnvironment environment)
        {
            // TODO : Add here the code that is called when the script is launched from Eclipse.
            var view = new BeamView();

            view.DataContext = new BeamViewModel(context.PlanSetup);
            window.Content   = view;
            window.Height    = 600;
            window.Width     = 1000;
            window.Title     = "Patient Report";
        }
    // ----------------------------------------------------------------
    //  Initialize
    // ----------------------------------------------------------------
    public void Initialize(BeamView _myBeamView)
    {
        myBeamView = _myBeamView;

        // Parent me on my BeamSourceRenderer.
        GameUtils.ParentAndReset(this.gameObject, myBeamView.transform);

        beamLineThickness = MyBoardView.UnitSize * 0.12f;
        beamLineColor     = new Color(BeamColor.r, BeamColor.g, BeamColor.b, BeamColor.a * 0.5f);
        GameUtils.SetParticleSystemColor(ps_endSparks, BeamColor);

        lines = new Line[20];         // this is pleeenty of points to render lots of lines.

        //// Apply base visual properties.
        //UpdateColorThickness ();
    }
 override protected void OnDestroy()
 {
     // Also destroy my BeamView because it's not parented to me (and won't be destroyed automatically)!
     Destroy(beamView.gameObject);
     beamView = null;
 }