You have to edit the PlatformerCharacter2D script. Either make the variable public from
private bool m_FacingRight;
to
public bool m_FacingRight;
-
or create a property for it
private bool m_FacingRight;
public bool FacingRight
{
get { return m_FacingRight; }
}
-
In order to access the variable, you need a reference to the PlatformerCharacter2D script.
private PlatformerCharacter2D platformChar2D;
platformChar2D = player.GetComponent()
-
Now you can access the variable from the script using the two methods posted above. If you change it to a public variable
platformChar2D.m_FacingRight
or use the property method
platformChar2D.FacingRight
↧