Documentation: 2DxFX (Scripting)



  • After hours of enjoyment spent playing with the effects we got down to using some of theses. We cached the components on the scripts and then started to work on scripting interactions with the effects. Upon reviewing the documentation we noticed this, which does not work which may have been in the past? Or are we doing it wrong?

    For example: Desintegration Effect

    It advises to do this:

    public _2dxFX_DesintegrationFX_Editor FX_DesintegrationFX; 
    
    void Update() {
        FX_DesintegrationFX._Alpha =  1f;
    }
    

    Which we quickly found does not work. Instead we did the following:

    private _2dxFX_DesintegrationFX FX_DesintegrationFX; 
    
    void Start () {
        FX_DesintegrationFX = GetComponent<_2dxFX_DesintegrationFX>();
    }
    
     void Update() {
       FX_DesintegrationFX._Alpha =  1f;
      }
    

    That said, we checked the other documentation and they all show using the editor scripts instead of the actual script. It's all working the way the way we expect using the non-editor script.

    ?=> Was that the old way using the editor script or just a typo? Or are we doing it wrong?

    Side Question:

    This was in the update function of the script: _2dxFX_DesintegrationFX.cs

    if (this.gameObject.GetComponent<Image> () != null) {
    if (CanvasImage==null) {
            CanvasImage = this.gameObject.GetComponent<Image> ();
         }
    }
    

    ? => We removed it and did not notice anything different. Was there a reason for it being there?


 

Looks like your connection to Vetasoft Assets was lost, please wait while we try to reconnect.