Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System.Collections;
- using System.Collections.Generic;
- using UnityEngine;
- public class TriggerMineScript : MonoBehaviour
- {
- public int zmienna;
- private GameObject go; //trigger explosion to load on start at places where bomb is red
- // Start is called before the first frame update
- void Awake() {
- }
- void Start()
- {
- go = GameObject.FindWithTag("ExplosionAreaMineTrigger");
- if (PlayerPrefs.GetInt(this.zmienna.ToString()) == 1) {
- this.GetComponent<Renderer>().material.SetColor("_Color", Color.red);
- Instantiate(go, transform.position, Quaternion.identity);
- }
- }
- // Update is called once per frame
- void Update()
- {
- }
- void OnTriggerEnter(Collider col) {
- if (col.transform.name.Contains("Mine")) {
- Debug.Log("NO SPRAWDZONE @@@@@@@@@@@@@@@");
- PlayerPrefs.SetInt(zmienna.ToString(), 1);
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement