Пример #1
0
    public static void ActionTargetLocal(ModelNPC.PersonData dataNPC, GameActionPersonController controller)
    {
        string tempID = dataNPC.TargetID;

        GetAlienData(dataNPC).OnTargetCompleted();

        string id = GetAlienData(dataNPC).BaseLockedTargetID;
        bool   isNotBaseLocked = string.IsNullOrEmpty(id);

        //if (controller != null && string.IsNullOrEmpty(controller.TempLockedTargetID))
        if (controller != null && isNotBaseLocked)
        {
            //Save ID
            //controller.TempLockedTargetID = tempID; // dataNPC.TargetID;
            GetAlienData(dataNPC).BaseLockedTargetID = tempID;
        }

        dataNPC.SetTargetPosition();
        ExecuteActionNPC(dataNPC, NameActionsPerson.Move, controller);

        if (controller != null)
        {
            controller.DrawRayTarget(); //TEST
        }
    }
Пример #2
0
    public static void ActionTargetBackToBase(ModelNPC.PersonData dataNPC, GameActionPersonController controller)
    {
        GetAlienData(dataNPC).OnTargetCompleted();

        if (controller != null)
        {
            //dataNPC.TargetID = controller.TempLockedTargetID;
            GetAlienData(dataNPC).ReturnBaseTarget();
            //GetAlienData(dataNPC).BaseLockedTargetID
            GetAlienData(dataNPC).BaseLockedTargetID = string.Empty;
        }
        RequestActionNPC(dataNPC, NameActionsPerson.Move, controller);

        if (controller != null)
        {
            controller.DrawRayTarget(); //TEST
        }
    }
Пример #3
0
    public static void ActionTarget(ModelNPC.PersonData dataNPC, GameActionPersonController controller)
    {
        if (ActionTargetIsLock)
        {
            Debug.Log(Storage.EventsUI.ListLogAdd = ".....ActionTarget is LOCK");
            return;
        }
        ActionTargetIsLock = true;

        //Storage.EventsUI.ListLogAdd = "ActionTarget .... ReaderSceneIsValid=" + Storage.Instance.ReaderSceneIsValid;
        temp_job = null;

        if (!Storage.Instance.ReaderSceneIsValid)// && TimeEndCurrentAction < Time.time)
        {
            ActionTargetLocal(dataNPC, controller);
            ActionTargetIsLock = false;
            return;
        }

        Storage.EventsUI.ListLogAdd = "ActionTarget ....!!!";

        //string tempID = dataNPC.TargetID;
        string indErr = "0";

        try {
            indErr = "1";
            GetAlienData(dataNPC).OnTargetCompleted();
            indErr = "2";
            //m_TargetObject = Storage.Person.GetAlienNextTargetObject(GetAlienData(dataNPC));
            m_TargetObject = null;
            //@JOB@
            temp_job = dataNPC.Job;
            //Storage.Person.GetAlienNextTargetObject(ref m_TargetObject, ref temp_job, GetAlienData(dataNPC));
            AlienJobsManager.GetAlienNextTargetObject(ref m_TargetObject, ref temp_job, GetAlienData(dataNPC));
        }
        catch (Exception ex)
        {
            Storage.EventsUI.ListLogAdd = "##### ActionTarget " + ex.Message;
            ActionTargetIsLock          = false;
            return;
        }

        //test
        if (m_TargetObject == null)
        {
            Storage.EventsUI.ListLogAdd = "*** " + dataNPC.NameObject + " ==> empty";
        }
        else
        {
            Storage.EventsUI.ListLogAdd = "*** " + dataNPC.NameObject + " ==> " + m_TargetObject.NameObject;
        }

        if (m_TargetObject == null)
        {
            GetAlienData(dataNPC).SetTargetPosition();
        }
        else
        {
            var targetPosition = m_TargetObject.Position;
            dataNPC.TargetID = m_TargetObject.Id;
            //FIX base>>ToPortal
            (dataNPC as ModelNPC.GameDataAlien).BaseLockedTargetID = dataNPC.TargetID;
            dataNPC.SetTargetPosition(targetPosition);
            dataNPC.Job = temp_job;//@JOB@
        }

        ExecuteActionNPC(dataNPC, NameActionsPerson.Move, controller);

        if (controller != null)
        {
            controller.DrawRayTarget(); //TEST
        }
        ActionTargetIsLock = false;
    }