Ejemplo n.º 1
0
    public void CheckTaskCompletion() //Made By Simon & Daniel
    {
        if (body == null || body.Head == null || dirtLayerList.Count != maxAmountOfDirtLayers)
        {
            return;
        }

        List <OrnamentType> ornamentType = new List <OrnamentType>();

        foreach (OrnamentPlacement placement in ornamentPlacements)
        {
            Ornament ornament = placement.GetPlacedOrnament();
            if (ornament)
            {
                ornamentType.Add(ornament.GetOrnamentType());
            }
        }

        Head head = body.Head;

        if (head != null)
        {
            foreach (Task task in FindObjectOfType <TaskManager>().tasks)
            {
                if (task.CheckTask(head.GetHeadType(), body.GetBodyType(), ornamentType, body.GetTreatmentType(), head.GetTreatmentType()))
                {
                    Debug.Log("TaskGrave: FINISHED TASK, AWW YEAH");
                    ResetGrave();
                    return;
                }
            }
        }
    }
Ejemplo n.º 2
0
    public static bool ReturnOrnament(Ornament ornament, bool skipRemoveFromList = false)
    {
        if (ornament)
        {
            switch (ornament.GetOrnamentType())
            {
            case OrnamentType.Flower:
                FlowerPool.GetInstance().ReturnToPool(ornament.gameObject, skipRemoveFromList);
                break;

            case OrnamentType.Candle:
                CandlePool.GetInstance().ReturnToPool(ornament.gameObject, skipRemoveFromList);
                break;

            case OrnamentType.Heart:
                HeartPool.GetInstance().ReturnToPool(ornament.gameObject, skipRemoveFromList);
                break;

            case OrnamentType.Statue:;
                StatuePool.GetInstance().ReturnToPool(ornament.gameObject, skipRemoveFromList);
                break;

            default:
                Debug.LogError("Something Went Wrong");
                break;
            }
            return(true);
        }
        else
        {
            return(false);
        }
    }