CS1061:'Transform' 不包含 'LocalScale' 的定义

CS1061: 'Transform' does not contain a definition for 'LocalScale'

我正在学习做一些游戏开发,而且我对 C 系列总体来说是新手,所以我不知道它要求什么。谢谢大家的帮助!我也试过在发布之前研究这个问题,但我找不到任何解决方案。

错误如下: Assets\Scripts\Player.cs(12,21):错误 CS1061:'Transform' 不包含 'LocalScale' 的定义并且没有可访问的扩展方法 'LocalScale' 接受类型为 [= 的第一个参数21=] 可以找到(您是否缺少 using 指令或程序集引用?)

代码如下:

    using System.Collections;
    using System.Collections.Generic;
    using UnityEngine;

    public class Player : MonoBehaviour {

    Transform GFX;
    float flipX;

      void Start() {
        GFX = GetComponentInChildren<SpriteRenderer>().transform;
        flipX = GFX.LocalScale.x;
    }

    void Update() {
        float horz = System.Math.Sign(Input.GetAxisRaw("Horizontal"));
        if(Mathf.Abs(horz) > 0)
        {
            GFX.LocalScale = new Vector2(flipX * horz, GFX.LocalScale.y);
        }
    }
}

P.S。我尝试将 brackticks 用于代码,结果很奇怪,它不会包含代码。所以我省略了它们。抱歉:D

https://docs.unity3d.com/ScriptReference/Transform-localScale.html

只是大小写错误。是 localScale 而不是 LocalScale