playMaker

Author Topic: Using Linker Wizard for using Get/Set Property during build  (Read 7682 times)

Diamond

  • Playmaker Newbie
  • *
  • Posts: 1
Hi, I've been running into an issue with Linker Wizard when running builds that has made me reconsider whether or not I should be using it as my solution for Get/Set property. I've specifically been running into the issue of getting and setting the main camera FOV during a build. I have a couple questions about Linker Wizard as well as some issues I have come across.

1. Should I be using Linker Wizard as a solution for Get/Set Property when running a build for Windows?

2. Should the scripting backend be set to IL2CPP instead of Mono when using Linker Wizard? I am building this game specifically for Windows/PC.

3. Linker Wizard does not work at all for my builds even though the link.xml file does detect it during editor runtime and I have updated them when they were detected.

When I installed Linker Wizard and attempted to install actions, it could not find the correct file path. However, I still managed to successfully install these actions through the intended file path by installing them through LinkerWizardActions.unitypackage. Could that possibly be having an effect on this issue?


mrphilipjoel

  • Junior Playmaker
  • **
  • Posts: 57
Re: Using Linker Wizard for using Get/Set Property during build
« Reply #1 on: July 17, 2024, 12:36:33 PM »
Nowadays, there really is no reason to use Get/Set Property. If there is no action created to do the specific thing you want, you can ask ChatGPT to spin one up for you in less than a minute.

Here is an example that it made for setting Camera FOV:

Code: [Select]
using UnityEngine;
using HutongGames.PlayMaker;

namespace CustomActions
{
    [ActionCategory(ActionCategory.Camera)]
    [Tooltip("Sets the Field of View (FOV) of the camera.")]
    public class SetCameraFOVAction : FsmStateAction
    {
        [RequiredField]
        [CheckForComponent(typeof(Camera))]
        [Tooltip("The GameObject with the Camera component.")]
        public FsmOwnerDefault gameObject;

        [RequiredField]
        [Tooltip("The new Field of View value.")]
        public FsmFloat fieldOfView;

        [Tooltip("Repeat every frame. Useful if the value is animated.")]
        public bool everyFrame;

        private Camera camera;

        public override void Reset()
        {
            gameObject = null;
            fieldOfView = 60f;
            everyFrame = false;
        }

        public override void OnEnter()
        {
            DoSetFOV();

            if (!everyFrame)
            {
                Finish();
            }
        }

        public override void OnUpdate()
        {
            DoSetFOV();
        }

        private void DoSetFOV()
        {
            var go = Fsm.GetOwnerDefaultTarget(gameObject);
            if (go == null)
            {
                return;
            }

            camera = go.GetComponent<Camera>();
            if (camera == null)
            {
                LogError("Missing Camera component");
                return;
            }

            camera.fieldOfView = fieldOfView.Value;
        }
    }
}

jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 15620
  • Official Playmaker Support
Re: Using Linker Wizard for using Get/Set Property during build
« Reply #2 on: August 31, 2024, 02:47:53 PM »
Hi,

1: only if your get set property actions are accessing classes that are not added to the build by default.

2: the scripting back end doesn't affect whether or not a class is added to the build. it only process it differently.

3: What do you mean it doesn't work?  Maybe you haven't gone through the actual logic that was using a particular class of function? can you give more details?

If you know exactly what class is missing, can you add it manually and see if your build works? and get back to me if it does, maybe the linker wizard is missing something in your particular case.

Bye,

Jean

sarausa

  • Playmaker Newbie
  • *
  • Posts: 1
    • Suika game
Re: Using Linker Wizard for using Get/Set Property during build
« Reply #3 on: March 14, 2025, 10:15:58 PM »
If the installation is successful via LinkerWizardActions.unitypackage, what is the different behavior before and after the installation?

danielmese76

  • Playmaker Newbie
  • *
  • Posts: 1
    • drive mad
Re: Using Linker Wizard for using Get/Set Property during build
« Reply #4 on: March 25, 2025, 04:15:17 AM »
Unity supports both IL2CPP and Mono scripting backends for Windows builds. IL2CPP converts your C# code into C++ before compiling it, which can lead to performance improvements and increased security. Mono, on the other hand, uses Just-In-Time (JIT) compilation, which can result in faster build times during development. The choice between them depends on your project's needs. For final builds, IL2CPP is often recommended due to its performance benefits. However, be aware that IL2CPP may require additional configuration to handle code stripping appropriately.

jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 15620
  • Official Playmaker Support
Re: Using Linker Wizard for using Get/Set Property during build
« Reply #5 on: April 03, 2025, 05:21:59 AM »
If the installation is successful via LinkerWizardActions.unitypackage, what is the different behavior before and after the installation?

No difference, it's an editor tool that gathers classes usages accessed via reflections  to then form a linker file, so that unity include these classes. This is a convenient tool to help you do what otherwise would have to be done manually.

Bye,

Jean

amora

  • Playmaker Newbie
  • *
  • Posts: 1
    • incredibox
Re: Using Linker Wizard for using Get/Set Property during build
« Reply #6 on: April 20, 2025, 11:04:33 PM »
Unity supports both IL2CPP and Mono scripting backends for Windows builds. IL2CPP converts your C# code into C++ before compiling it, which can lead to performance improvements and increased security. Mono, on the other hand, uses Just-In-Time (JIT) compilation, which can result in faster build times during development. The choice between them depends on your project's needs. For final builds, IL2CPP is often recommended due to its performance benefits. However, be aware that IL2CPP may require additional configuration to handle code stripping appropriately.
Will IL2CPP become more difficult to configure if my project has a lot of code that uses incompatible external libraries, or does Unity have a simple way to solve this problem?
« Last Edit: April 20, 2025, 11:06:18 PM by amora »

jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 15620
  • Official Playmaker Support
Re: Using Linker Wizard for using Get/Set Property during build
« Reply #7 on: April 21, 2025, 02:49:59 AM »
Hi,

 incompatible libraries will produce errors inside Unity editor to being with or unity won't see them at all. It has nothing to do with IL2CPP

Bye,

Jean