使用unity编辑的代码,报错了不知道怎么调整QAQ
问题相关代码如下:
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class PCA_ShouGenerator : MonoBehaviour
{
public Transform glassPanels;
public float movementSpeed;
Private Vector3 targetPosition;
Private Vector3 glassPanelOpenPosition;
Private int phase;
Private bool actionStarted;
Private bool actionCompleted;
void Start()
{
phase = 1;
actionStarted = false;
actionCompleted = false;
targetPosition = new Vector3(transform.localPosition.x, 1.5F, transform.localposition.z);
glassPanelOpenPosition = new Vector3(glassPanels.localPosition.x, -4.0F, glasspanels.localPosition.z);
}
void Update()
{
if(actionStarted && !actionCompleted)
{
if(phase == 1)
{
transform.localposition = Vector3.Lerp(transform.localPosition, targetPosition, Time.deltaTime * movementSpeed);
if(transform.localPosition.y >= targetPosition.y - 0.2)
{
phase = 2;
}
}
else if(phase == 2)
{
glassPanels.localPosition = Vector3.Lerp(glassPanels.localPosition, targetPosition,Time.deltaTime * movementSpeed);
if(transform.localPosition.y <= glassPanelOpenPosition.y - 0.2)
{
actionCompleted = true;
}
}
}
}
public override void playAction()
{
actionStarted = ture;
}
}
报错内容如下: