我有 2个宏。
Macro1 (完全呼叫 Macro2 )时。
Macro2有一个输入框,我必须在其中放置一个值。 (此值的值并不重要)。
我想避免在通过自动向Macro2中的变量赋值从Macro1调用时在输入框中放置值(跳过手动步骤)。
在我的脑海中,我在想类似Call Macro2(inputbox = 1
)
我显然错过了一些东西,但是我不确定自己到底要搜索什么,而且我所有的搜索似乎都无法回答这个问题。
任何帮助将不胜感激。
答案 0 :(得分:0)
这很简单。可能在第一章如何使用VBA进行编码。
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class camMouseLook : MonoBehaviour {
protected Transform XForm_camera;
protected Transform XForm_Parent;
protected Vector3 LocalRotation;
protected float CameraDistance = 10f;
public float MouseSensitivity = 4f;
public float ScrollSensitivity = 2f;
public float OrbitSpeed = 10f;
public float ScrollSpeed = 6f;
public bool CameraDisabled = false;
void Start () {
this.XForm_camera = this.transform;
this.XForm_Parent = this.transform.parent;
}
// Update is called once per frame
void LateUpdate () {
if (Input.GetKeyDown(KeyCode.LeftShift))
{
CameraDisabled = !CameraDisabled;
}
if (!CameraDisabled)
{
if(Input.GetAxis("Mouse X") != 0 || Input.GetAxis("Mouse Y") != 0)
{
LocalRotation.x += Input.GetAxis("Mouse X") * MouseSensitivity;
LocalRotation.y -= Input.GetAxis("Mouse Y") * MouseSensitivity;
LocalRotation.y = Mathf.Clamp(LocalRotation.y, 0f, 90f);
}
if(Input.GetAxis("Mouse ScrollWheel") != 0f)
{
float ScrollAmount = Input.GetAxis("Mouse ScrollWheel") *
ScrollSensitivity;
ScrollAmount *= (this.CameraDistance * 0.3f);
this.CameraDistance += ScrollAmount * -1f;
this.CameraDistance = Mathf.Clamp(this.CameraDistance, 1.5f, 100f);
}
}
Quaternion QT = Quaternion.Euler(LocalRotation.y, LocalRotation.x, 0);
this.XForm_Parent.rotation = Quaternion.Lerp(this.XForm_Parent.rotation, QT, Time.deltaTime * OrbitSpeed);
if (this.XForm_camera.localPosition.z != this.CameraDistance * -1f)
{
this.XForm_camera.localPosition = new Vector3(0f, 0f, Mathf.Lerp(this.XForm_camera.localPosition.z, this.CameraDistance * -1f, Time.deltaTime * ScrollSpeed));
}
}