[Question] How to use Inky and Ink in unity as variables to get pictures to shift when thw rods do.
- Dominant language
- C#
- Stars
- 4.9k
- Forks
- 540
- PR merge metrics
- No merged PRs in 30d
Description
The issue is that the temp.sm and various pieces of code that work with the text piece from unity aren't able to figure out that the text piece is equal to surf monkeys even though the debug.log displays the string value for the temp.sm is equal to surf monkeys.

Our Code:
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using Ink.Runtime;
using UnityEngine.UI;
public class Image : MonoBehaviour {
private SpriteRenderer myImage;
private Text Title;
private string tempSM;
private string QQ = "Surf Monkeys";
// Use this for initialization
void Start () {
myImage = GetComponent();
myImage.enabled = false;
}
// Update is called once per frame
void Update () {
if (GameObject.Find("Text(Clone)") == null)
{
Debug.Log("returning");
return;
}
else
{
Title = GameObject.Find("Text(Clone)").GetComponent();
Debug.Log("Found Text");
}
tempSM = Title.text;
Debug.Log("tempSM: " + tempSM);
if (tempSM.Equals(QQ))
{
ImageStatus();
Debug.Log("calling enable imagestat");
}else
{
Debug.Log("not calling enable imagestat");
return;
}
}
public void ImageStatus()
{
var testTempStr = tempSM;
Debug.Log("var test "+ testTempStr);
if ( testTempStr.Equals(QQ))
{
myImage.enabled = true;
Debug.Log("tempSM2: " + tempSM);
}
else
{
myImage.enabled = false;
Debug.Log("tempSM3: " + tempSM);
}
}
}
Contributor guide
No contributing guide indexed for this repository
Research direction
Start with the provided Image MonoBehaviour and inspect how Unity's Text component supplies Title.text and how the SpriteRenderer is enabled. Reproduce the comparison in Unity using the shown code; the issue is done when the intended matching text reliably enables the image and the nonmatching text leaves it disabled.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- csharp, unity
- Domain
- game-dev
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100