Ejemplo n.º 1
0
        public GameObject SetAlertAndReturnObj(PlayerController sensingTarget)
        {
            GameObject newAlertObj = Instantiate(sensingAlertPrefab);

            newAlertObj.transform.SetParent(transform);
            newAlertObj.transform.position = transform.position;

            AlertSign newAlert = newAlertObj.GetComponent <AlertSign>();

            newAlert.SetTarget(sensingTarget);

            return(newAlertObj);
        }
Ejemplo n.º 2
0
        public void SetAlertDuringSeconds(PlayerController sensingTarget, float seconds)
        {
            GameObject newAlertObj = Instantiate(sensingAlertPrefab);

            newAlertObj.transform.SetParent(transform);
            newAlertObj.transform.position = transform.position;

            AlertSign newAlert = newAlertObj.GetComponent <AlertSign>();

            newAlert.SetTarget(sensingTarget);

            StartCoroutine(RemoveAlertAfterSeconds(newAlertObj, seconds));
        }