// Start is called before the first frame update void Start() { myGameManager = FindObjectOfType <GameManager>(); myPictureCamera = FindObjectOfType <PictureCamera>(); myCursorSnap = GetComponent <CursorSnap>(); paintingImage = GetComponentInChildren <Image>(); myQuestItem = GetComponent <QuestItem>(); }
public void GetReferences() { // Get MeshRenderer if (GetComponent <MeshRenderer>()) { myMeshRender = GetComponent <MeshRenderer>(); myOriginalMaterial = myMeshRender.sharedMaterial; } else { // Debug.LogWarning($"Missing MeshRenderer on {gameObject.transform.name}, check Activate.cs."); } // Get PictureCamera if (GetComponentInChildren <PictureCamera>()) { myPictureCamera = GetComponentInChildren <PictureCamera>(); } // Get QuestItem if (GetComponent <QuestItem>()) { myQuestItem = GetComponent <QuestItem>(); } else { Debug.LogWarning($"Missing QuestItem on {gameObject.transform.name}, check Activate.cs."); } // Get Game Manager if (FindObjectOfType <GameManager>()) { myGameManager = FindObjectOfType <GameManager>(); } else { Debug.LogWarning($"Missing GameManager on {gameObject.transform.name}, check Activate.cs."); } if (FindObjectOfType <PaintingManager>()) { myPaintingManager = FindObjectOfType <PaintingManager>(); } // get AudioManager if (FindObjectOfType <AudioManager>()) { myAudioManager = FindObjectOfType <AudioManager>(); } }
// Start is called before the first frame update void Start() { myPictureCamera = FindObjectOfType <PictureCamera>(); }