예제 #1
0
 // 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>();
 }
예제 #2
0
    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>();
        }
    }
예제 #3
0
 // Start is called before the first frame update
 void Start()
 {
     myPictureCamera = FindObjectOfType <PictureCamera>();
 }