Ejemplo n.º 1
0
    /// <summary>
    /// The main BuildersManager contain in person controller will send this greenlight
    /// building to the closest BuilderManager to the building
    /// </summary>
    private void AddBuildingToClosestBuildingOffice(Structure st, Construction construction)
    {
        //if is null is a brdige
        if (st == null || st.StartingStage != H.Done)
        {
            //_greenLight.Add(construction);
            var closest = BuildingController.FindTheClosestOfThisType(H.Masonry, construction.Position,
                                                                      Brain.Maxdistance, true);

            if (closest == null)
            {
                //todo Notify not wheelBarrow close enought to me 3d icon
                Debug.Log("Not Masonry close enought to " + construction.Key + " found");
                return;
            }
            closest.BuildersManager1.GreenLight.Add(construction);
        }
    }
Ejemplo n.º 2
0
    private void UpdateClosestMasonry(Construction construction)
    {
        var closest = BuildingController.FindTheClosestOfThisType(H.Masonry, construction.Position,
                                                                  Brain.Maxdistance, true);

        if (closest == null)
        {
            Debug.Log("Not Masonry close enought to " + construction.Key + " found");
            return;
        }

        if (construction.WasGreenlit)
        {
            var build = Brain.GetBuildingFromKey(construction.Key);
            construction.WasGreenlit = false;

            if (_passedQueue != null)
            {
                _passedQueue.Add(construction.Key);
            }
        }

        closest.BuildersManager1.GreenLight.Remove(construction);
    }