Пример #1
0
    public void ShowBoatSizeTutorial(int num_slots, FMWorker worker)
    {
        if (num_slots > 0)
        {
            GameObject worker_go = worker?.gameObject;
            if (!worker_go)
            {
                worker_go = this.WorkerBob;
            }

            switch (Random.Range(0, 4))
            {
            case 0:
                DialogManager.singleton.Say_3D("Woah, this is a big boat...", worker_go);
                DialogManager.singleton.Say_3D("... I Cod do with another pair of fins to help out.", worker_go);
                break;

            case 1:
                DialogManager.singleton.Say_3D("I could live in here!", worker_go);
                DialogManager.singleton.Say_3D("... I think I'll need a skipper to drive this thing.", worker_go);
                break;

            case 2:
                DialogManager.singleton.Say_3D("Oh my! I could get lost below decks.", worker_go);
                DialogManager.singleton.Say_3D("... Any chance I could get a bit of help with this thing?", worker_go);
                break;

            case 3:
                DialogManager.singleton.Say_3D("Nope! I nearly got caught in the propeller!", worker_go);
                DialogManager.singleton.Say_3D("... I'm not going back down there again, I need a safety buddy!", worker_go);
                break;
            }
        }
    }
Пример #2
0
 public override bool RemoveWorker(FMWorker worker)
 {
     base.RemoveWorker(worker);
     m_TaskProcessing       = m_AssignedWorkers.Count >= m_NumberOfWorkersRequired;
     m_TimeSinceLastTrigger = 0f;
     m_BoatSlots.UnassignWorker(worker);
     return(m_TaskProcessing);
 }
Пример #3
0
 public virtual bool RemoveWorker(FMWorker worker)
 {
     if (m_AssignedWorkers.Contains(worker))
     {
         m_AssignedWorkers.Remove(worker);
         return(true);
     }
     return(false);
 }
Пример #4
0
 // Returns if true if task is now processing
 public virtual bool AssignWorker(FMWorker worker)
 {
     if (!m_AssignedWorkers.Contains(worker))
     {
         m_AssignedWorkers.Add(worker);
         return(true);
     }
     return(false);
 }
Пример #5
0
 public void UnassignWorker(FMWorker worker)
 {
     for (int i = 0; i < m_WorkerSlots.Count; i++)
     {
         var slot = m_WorkerSlots[i];
         if (slot.m_AssignedObject == worker.gameObject)
         {
             slot.m_AssignedObject = null;
             var canvas = GetComponentInParent <Canvas>();
             worker.transform.SetParent(canvas.transform, true);
         }
     }
 }
Пример #6
0
    public override bool AssignWorker(FMWorker worker)
    {
        base.AssignWorker(worker);
        m_BoatSlots.AssignWorker(worker);

        Tutorial.GetOrCreateInstance().HasAssignedWorkerToBoat = true;
        Tutorial.GetOrCreateInstance().ShowBoatSizeTutorial(m_NumberOfWorkersRequired - m_BoatSlots.NumSlotsOccupied, worker);

        if (!Tutorial.GetOrCreateInstance().HasAssignedEquipmentToBoat)
        {
            Tutorial.GetOrCreateInstance().ShowBoatEquipmentTutorial(worker);
        }
        return(CheckProcessing());
    }
Пример #7
0
 public void AssignWorker(FMWorker worker)
 {
     for (int i = 0; i < m_WorkerSlots.Count; i++)
     {
         var slot = m_WorkerSlots[i];
         if (slot.m_AssignedObject == null)
         {
             slot.m_AssignedObject = worker.gameObject;
             worker.transform.SetParent(slot.m_Transform, false);
             worker.transform.localPosition = Vector3.zero;
             return;
         }
     }
 }
Пример #8
0
    public void ShowProcessFishTutorial(FMWorker worker)
    {
        GameObject worker_go = worker?.gameObject;

        if (!worker_go)
        {
            worker_go = this.WorkerBob;
        }

        DialogManager.singleton.Say_3D("Woo, we made it!", worker_go);
        DialogManager.singleton.Say_3D("... But that fish isn't going to process itself.", worker_go);
        DialogManager.singleton.Say_3D("Drag a worker over to the processing plant.", worker_go);

        StartCoroutine(ProcessingReminderTimer(worker_go));
    }
Пример #9
0
    public void ShowBoatEquipmentTutorial(FMWorker worker)
    {
        if (!has_shown_equipment_tutorial &&
            !has_assigned_equipment_to_boat)
        {
            GameObject worker_go = worker?.gameObject;
            if (!worker_go)
            {
                worker_go = this.WorkerBob;
            }

            DialogManager.singleton.Say_3D("Now to get fishing...", worker_go);
            DialogManager.singleton.Say_3D("... But first I'm going to need some bait.", worker_go);
            DialogManager.singleton.Say_3D("Drag over one of those fishing lures.", worker_go);
            DialogManager.singleton.Say_3D("Each one is for a different catch.", worker_go);
            has_shown_equipment_tutorial = true;
        }
    }
Пример #10
0
 // sinks don't take on workers
 public override bool AssignWorker(FMWorker worker)
 {
     return(false);
 }
Пример #11
0
    void OnEnable()
    {
        worker = GetComponent <FMWorker>();

        StartCoroutine(UpdateAnimation());
    }