コード例 #1
0
 public Message_ObjectiveSync(ulong uid, int objid, ObjSyncType stat)
 {
     UID        = uid;
     this.objID = objid;
     status     = stat;
     type       = MessageType.ObjectiveSync;
 }
コード例 #2
0
    public static void objectiveUpdate(int hashCode, ObjSyncType status)
    {
        Debug.Log($"Doing objective update for id {hashCode}.");

        if (status == ObjSyncType.EVTBegin)
        {
            //VTScenario.current.objectives.GetObjective(hashCode).Dispose();
            VTScenario.current.objectives.GetObjective(hashCode).BeginObjective();
        }

        if (!objectiveHashTable.ContainsKey(hashCode))
        {
            loadObjectives();
        }

        if (!objectiveHashTable.ContainsKey(hashCode))
        {
            Debug.Log("cant find objective in hashTable");
            return;
        }


        MissionObjective obj = objectiveHashTable[hashCode];

        if (obj == null)
        {
            Debug.Log("obj was Null");
            return;
        }


        if (status == ObjSyncType.EMissionCompleted && !obj.completed)
        {
            Debug.Log("Completeing mission complete locally");
            completeNext = true;
            if (!obj.started)
            {
                obj.BeginMission();
            }
            obj.CompleteObjective();
            loadObjectives();
        }

        if (status == ObjSyncType.EMissionFailed && !obj.failed)
        {
            Debug.Log("failing mission complete locally");
            completeNextFailed = true;
            if (!obj.started)
            {
                obj.BeginMission();
            }

            obj.FailObjective();
            loadObjectives();
        }

        if (status == ObjSyncType.EMissionBegin && !obj.started)
        {
            Debug.Log("starting mission begin locally");
            completeNextBegin = true;
            obj.BeginMission();
            loadObjectives();
        }

        if (status == ObjSyncType.EMissionCanceled && !obj.cancelled)
        {
            Debug.Log("starting mission cancel locally");
            completeNextCancel = true;
            if (!obj.started)
            {
                obj.BeginMission();
            }
            obj.CancelObjective();
            loadObjectives();
        }
    }
コード例 #3
0
    public static void objectiveUpdate(int id, ObjSyncType status)
    {
        Debug.Log($"Doing objective update for id {id}.");
        if (mManager == null)
        {
            mManager = MissionManager.instance;
            if (mManager == null)
            {
                Debug.Log("MissionManager manager Null");
                return;
            }
        }
        if (id == -1)
        {
            Debug.Log("Got a -1 ID, not doing it.");
            return;
        }
        MissionObjective obj = mManager.GetObjective(id);

        if (obj == null)
        {
            Debug.Log("obj was Null");
            return;
        }


        if (status == ObjSyncType.EMissionCompleted && !obj.completed)
        {
            Debug.Log("Completeing mission complete locally");
            completeNext = true;
            if (!obj.started)
            {
                obj.BeginMission();
            }
            obj.CompleteObjective();
        }

        if (status == ObjSyncType.EMissionFailed && !obj.failed)
        {
            Debug.Log("failing mission complete locally");
            completeNextFailed = true;
            if (!obj.started)
            {
                obj.BeginMission();
            }
            obj.FailObjective();
        }

        if (status == ObjSyncType.EMissionBegin && !obj.started)
        {
            Debug.Log("starting mission begin locally");
            completeNextBegin = true;
            obj.BeginMission();
        }

        if (status == ObjSyncType.EMissionCanceled && !obj.cancelled)
        {
            Debug.Log("starting mission cancel locally");
            completeNextCancel = true;
            if (!obj.started)
            {
                obj.BeginMission();
            }
            obj.CancelObjective();
        }
    }