This commit is contained in:
2025-05-10 18:06:44 +08:00
parent e010759358
commit dea9a4f58e
47 changed files with 421 additions and 359 deletions

View File

@@ -126,7 +126,7 @@ namespace Rewired.Demos {
void Awake() {
pointer = (GameObject)Instantiate(pointerPrefab);
pointer = (GameObject)GameObject.Instantiate(pointerPrefab);
pointer.transform.localScale = new Vector3(spriteScale, spriteScale, spriteScale);
#if UNITY_5_PLUS
@@ -190,11 +190,11 @@ namespace Rewired.Demos {
}
void CreateClickEffect(Color color) {
GameObject go = (GameObject)Instantiate(clickEffectPrefab);
GameObject go = (GameObject)GameObject.Instantiate(clickEffectPrefab);
go.transform.localScale = new Vector3(spriteScale, spriteScale, spriteScale);
go.transform.position = Camera.main.ScreenToWorldPoint(new Vector3(mouse.screenPosition.x, mouse.screenPosition.y, distanceFromCamera));
go.GetComponentInChildren<SpriteRenderer>().color = color;
Destroy(go, 0.5f);
Object.Destroy(go, 0.5f);
}
// Callback when the screen position changes