Player Input Default Control Scheme#
Input / Player Input / Player Input Default Control Scheme
Can Read
Can Write
Description#
The Default Control Scheme property of the Player Input component
Code#
// <auto-generated>
// This script was automatically generated using the Visual Script Transpiler.
// Do not modify. Changes to this file will be lost when updating the package.
// </auto-generated>
using System;
using UnityEngine;
using VisualScript.Icons;
using UnityEngine.InputSystem;
namespace VisualScript.Runtime
{
[Get]
[Set]
[Title("Player Input Default Control Scheme")]
[Category("Input/Player Input/Default Control Scheme")]
[Description("The Default Control Scheme property of the Player Input component")]
[Image(typeof(IconBoltOutline), ColorTheme.Type.Blue)]
[Keywords("Input, Player, Controls, Local, Multiplayer, Co-op")]
[Serializable]
public class GenTypeString_PlayerInput_DefaultControlScheme : TypeString
{
[SerializeField] private GetGameObject m_PlayerInput = new GetGameObject(
new GenTypeGameObject_PlayerInput()
);
public override string GetPreview(GameObject source)
{
GameObject instance = this.m_PlayerInput.GetPreview(source);
if (instance == null) return default;
PlayerInput component = instance.GetComponent<PlayerInput>();
return component != null ? component.defaultControlScheme : default;
}
public override string Get(Args args)
{
PlayerInput instance = this.m_PlayerInput.Get<PlayerInput>(args);
return instance != null
? instance.defaultControlScheme
: default;
}
public override void Set(string value, Args args)
{
PlayerInput component = this.m_PlayerInput.Get<PlayerInput>(args);
if (component != null) component.defaultControlScheme = (string) value;
}
public override string ToString()
{
return $"{this.m_PlayerInput} Default Control Scheme";
}
protected override SubscriptionMode Subscription => SubscriptionMode.OnChange;
}
}