예제 #1
0
    internal void Show()
    {
        if (UPerson.IsThisPersonTheSelectedOne(_person))
        {
            var a = 1;
        }

        if (_current != null && _current.Renderer1 == null)
        {
            var gO = General.FindGameObjectInHierarchy("Geometry", _current.gameObject);
            if (gO != null)
            {
                _current.Renderer1 = gO.GetComponent <Renderer>();
            }
        }

        if (_current != null
            //&&  _current.Renderer1 != null
            )
        {
            SetScaleOfCurrent();
            //so its shown at first close to the person
            _current.UpdatePosition();
            _current.gameObject.SetActive(true);

            //_current.Renderer1.enabled = true;
        }
    }
예제 #2
0
    /// <summary>
    /// When at 10x, and over 100ppl may take a while for the agent get the requested path
    /// </summary>
    private void CheckIfPathPending()
    {
        if (UPerson.IsThisPersonTheSelectedOne(_person))
        {
            var a = 1;
        }

        //if is waiting for a path and suppose to be movung already, then will be promt to Iddle
        if (_savedAniPathPending == "" && _agent.pathPending && _person.Body.IAmShown())
        {
            _savedAniPathPending = _person.Body.CurrentAni;
            _person.Body.TurnCurrentAniAndStartNew("isIdle");
            _startDate = null;
        }
        //once is ready will retake its ani
        else if (_savedAniPathPending != "" && !_agent.pathPending)
        {
            if (UPerson.IsThisPersonTheSelectedOne(_person))
            {
                var a = 1;
            }

            _person.Body.TurnCurrentAniAndStartNew(_savedAniPathPending);
            _savedAniPathPending = "";
            _startDate = Program.gameScene.GameTime1.CurrentDate();
        }
    }
예제 #3
0
파일: Docker.cs 프로젝트: naaturaz/SM
    private void Execute()
    {
        if (UPerson.IsThisPersonTheSelectedOne(_person))
        {
            var a = 1;
        }

        _export = _order != null && _order.SourceBuildInfo != "Ship";
        _import = _order != null && _order.SourceBuildInfo == "Ship";
    }
예제 #4
0
    /// <summary>
    /// Used to loading
    /// </summary>
    /// <param name="person"></param>
    /// <param name="currAni"></param>
    public PersonalObject(Person person, string currAni, bool hide)
    {
        if (UPerson.IsThisPersonTheSelectedOne(_person))
        {
            var a = 1;
        }

        _person = person;
        Init();
        AddressNewAni(currAni, hide);
    }
예제 #5
0
파일: Docker.cs 프로젝트: naaturaz/SM
    private void CheckIfCanPickUpNewOrder()
    {
        if (UPerson.IsThisPersonTheSelectedOne(_person))
        {
            var a = 1;
        }

        if (Order1 == null || Order1.IsCompleted)
        {
            PickUpOrder();
        }
    }
예제 #6
0
파일: Docker.cs 프로젝트: naaturaz/SM
    private void ImportIfPossible()
    {
        if (UPerson.IsThisPersonTheSelectedOne(_person))
        {
            var a = 1;
        }

        Execute();
        if (_import)
        {
            HandleInventoriesAndOrder();
        }
    }
예제 #7
0
    public void AddressNewAni(string newAni, bool hide)
    {
        if (UPerson.IsThisPersonTheSelectedOne(_person))
        {
            var a = 1;
        }

        Hide();//will hide current

        _currentAni = newAni;
        SetNewPersonalObject();
        AddressNewCurrentRoot(hide);
    }
예제 #8
0
    // Update is called once per frame
    public void Update()
    {
        if (UPerson.IsThisPersonTheSelectedOne(_person))
        {
            var a = 1;
        }

        //correcting bug where kids stay in front of storage with path completed
        if ((_destWasSet && _agent.isOnNavMesh && _agent.enabled && !_person.IsMajor
            && !UMath.nearEqualByDistance(_agent.destination, Destiny, 0.1f) &&
            _agent.pathStatus == NavMeshPathStatus.PathComplete)
            ||
            (_agent.pathStatus == NavMeshPathStatus.PathInvalid && _agent.enabled && _agent.isOnNavMesh)
            )
        {
            if (UPerson.IsThisPersonTheSelectedOne(_person))
            {
                //UVisHelp.CreateHelpers(Destiny, Root.yellowSphereHelp);
                var a = 1;
            }

            //so i set the destination again to the real one so they move towards it
            _agent.SetDestination(Destiny);
        }

        if (_nextDest != new Vector3() && !_destWasSet && _agent.isOnNavMesh && _agent.enabled)
        {
            if (UPerson.IsThisPersonTheSelectedOne(_person))
            {
                //UVisHelp.CreateHelpers(Destiny, Root.redSphereHelp);
                var a = 1;
            }

            _destWasSet = true;
            _agent.SetDestination(Destiny);
            _startDate = Program.gameScene.GameTime1.CurrentDate();
        }
        CheckIfGoingIntoBuild();
        RadiusForHeavyLoaders();

        CheckVelocity();
        CheckIfTempSpeed();
        CheckIfPathPending();

        CheckIfStuck();
    }
예제 #9
0
    internal void Walk(Vector3 point, Vector3 afterDest, Vector3 moveNowTo, HPers goingTo)
    {
        _agent.enabled = false;
        _person.transform.position = moveNowTo;

        _destWasSet = false;
        Destiny = point;
        _afterDestiny = afterDest;
        _nextDest = point;
        _agent.enabled = true;

        //Debugg(point);

        //if person is:
        //hidden
        //close enough to the destiny spawnpoint
        //destiny is a:
        //Dock
        //Library
        //Dont show
        if (_person.Body != null)
        {
            if (UPerson.IsThisPersonTheSelectedOne(_person))
            {
                var a = 1;
            }

            if (_person.Body.IsHidden() && _person.Body.IsNearBySpawnPointOfInitStructure() &&
                (_person.Body.IsDestinyOrOrigin(H.Library) || _person.Body.IsDestinyOrOrigin(H.Dock)))
            {
            }
            else
                _person.Body.Show();
        }

        if (goingTo == HPers.InWork && _person.ProfessionProp != null
            && _person.ProfessionProp.ProfDescription == Job.Builder)
        {
            _agent.obstacleAvoidanceType = ObstacleAvoidanceType.HighQualityObstacleAvoidance;
        }
        else
        {
            _agent.obstacleAvoidanceType = ObstacleAvoidanceType.LowQualityObstacleAvoidance;//low
        }
    }
예제 #10
0
파일: Docker.cs 프로젝트: naaturaz/SM
    private void GetMeOrderIfAny(H type)
    {
        if (UPerson.IsThisPersonTheSelectedOne(_person))
        {
            var a = 1;
        }

        if (_person.Work == null || _person.Work.HType != H.Dock)
        {
            return;
        }

        var ord = _person.Work.Dispatch1.GiveMeOrderIfAny(_person, type);

        if (ord != null)
        {
            Order1            = ord;
            _person.PrevOrder = Order1;
        }
    }
예제 #11
0
파일: WheelBarrow.cs 프로젝트: naaturaz/SM
    /// <summary>
    /// This Init is for Loading since the other was ReWriting loaded Values such as Order1
    /// </summary>
    private void InitForLoading()
    {
        if (UPerson.IsThisPersonTheSelectedOne(_person))
        {
            var a = 1;
        }

        //if did not load a order will return, and take a break now
        if (Order1 == null// || _destinyBuild == null
            )
        {
            _takeABreakNow = true;
            return;
        }

        _destinyBuild     = Brain.GetStructureFromKey(Order1.DestinyBuild);
        _sourceBuild      = Brain.GetStructureFromKey(Order1.SourceBuild);
        _person.PrevOrder = Order1;

        InitRoute();
    }