mirror of
https://github.com/evgen-app/steampunk-quest.git
synced 2025-02-07 09:50:32 +03:00
29 lines
754 B
C#
29 lines
754 B
C#
using System.Collections;
|
|
using System.Collections.Generic;
|
|
using UnityEngine;
|
|
|
|
public class chestController : MonoBehaviour
|
|
{
|
|
// Start is called before the first frame update
|
|
void Start()
|
|
{
|
|
|
|
}
|
|
|
|
// Update is called once per frame
|
|
void Update()
|
|
{
|
|
if (PlayerPrefs.GetInt(gameObject.name) == 1)
|
|
{
|
|
Debug.Log(gameObject.transform.GetChild(0).gameObject.name);
|
|
PlayerPrefs.SetInt(gameObject.name, 2);
|
|
gameObject.transform.GetChild(0).gameObject.GetComponent<MeshRenderer>().material.color = Color.red;
|
|
if (gameObject.name == "chest4")
|
|
{
|
|
gameObject.transform.Find("lamp").gameObject.SetActive(true);
|
|
}
|
|
}
|
|
|
|
}
|
|
}
|