public class DoorScript : MonoBehaviour {
public Key1Trigger KeyScript;
// Use this for initialization
void Start () {
gameObject.renderer.material.color = Color.red;
Key1Trigger= GetComponent();
}
// Update is called once per frame
void Update () {
if (Key1Trigger) {
Debug.Log (“Trigger Activated”);
}
}
}
using UnityEngine;
using System.Collections;
public class DoorScript : MonoBehaviour {
public KeyScript _keyScript;
// Use this for initialization
void Start () {
gameObject.renderer.material.color = Color.red;
_keyScript = GetComponent<KeyScript>();
}
// Update is called once per frame
void Update () {
if (_keyScript.Key1Trigger) {
Debug.Log ("Trigger Activated");
}
}
}