-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathGrandmam.cs
More file actions
30 lines (27 loc) · 801 Bytes
/
Grandmam.cs
File metadata and controls
30 lines (27 loc) · 801 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class Grandmam : MonoBehaviour
{
public GameObject taskM;
public bool hasCat;
public GameObject HappyGma;
// Start is called before the first frame update
void Start()
{
taskM = GameObject.Find("TaskManager");
}
// Update is called once per frame
void Update()
{
if (GetComponent<DialogTrigger>().inRange == true && hasCat == true)
{
taskM.GetComponent<Tasks_GameManager>().isGrandmaFinished = true;
Instantiate(HappyGma, transform.position, Quaternion.identity);
Destroy(gameObject);
}
}
private void OnTriggerEnter2D(Collider2D collision)
{
}
}