예제 #1
0
    public void PlaceBarricade()
    {
        _CanBePickedUp   = false;
        transform.parent = null;
        isPlaced         = true;
        GetComponent <NavMeshObstacle>().enabled = true;
        GetComponent <NavMeshObstacle>().carving = true;
        Tutorial2 tutorial2 = GameObject.FindObjectOfType <Tutorial2>();

        if (tutorial2)
        {
            tutorial2.barricadePlaced = true;
        }
        StartCoroutine(characterSound.BarricadeSound(0));
    }
예제 #2
0
    public void SpawnBarricade()
    {
        if (coolTimeImage.fillAmount >= 1.0f && !lockCoolTimeImage.gameObject.activeInHierarchy)
        {
            GameObject barricade = GetBarricade();
            if (barricade)
            {
                //barricade.transform.position = barricadeSpawnPosition.position;
                barricade.SetActive(false);

                GameObject trashImg = Instantiate(trashImgPrefab);
                trashImg.transform.position = new Vector2(Input.mousePosition.x, Input.mousePosition.y);
                trashImg.transform.SetParent(GameObject.FindGameObjectWithTag("Canvas").transform, false);
                trashImg.GetComponent <DragDrop>().isDragging     = true;
                trashImg.GetComponent <DragDrop>().itemToBeDroped = barricade;
                StartCoroutine(characterSound.BarricadeSound(0));
            }
            coolTimeImage.fillAmount = 0;
        }
    }