private void StartTask(int taskIndex) { TaskScriptableObject taskData = job.Tasks[taskIndex]; currentTaskType = taskData.GetTaskType(); if (StartTaskEvent != null) { StartTaskEvent(currentTaskType); } if (!taskManagers.Exists(x => x.GetTaskType() == currentTaskType)) { Debug.LogError("VERY BAD"); return; } taskManagerBase = taskManagers.Find(x => x.GetTaskType() == currentTaskType); if (!taskManagerBase.sword) { taskManagerBase.sword = sword; taskManagerBase.swordDetails = sword.GetComponent <Sword>(); } taskManagerBase.Activate(); Transform currentCamTrans = GetCamPoint(currentTaskType); Transform currentWeaponTrans = GetSwordTeleportPoint(currentTaskType); SlerpCameraAndSword(currentCamTrans, currentWeaponTrans); taskManagerBase.SetTaskObject(taskData); }
public override void SetTaskObject(TaskScriptableObject a_taskScriptableObject) { curTask = Instantiate(a_taskScriptableObject) as UnBumpTaskScriptableObject; RippleDeformer[] rippleDeformers = sword.GetComponentsInChildren <RippleDeformer>(); foreach (RippleDeformer rd in rippleDeformers) { if (rd.TryGetComponent <Collider>(out Collider c)) { c.enabled = true; } } }
public override void SetTaskObject(TaskScriptableObject a_taskScriptableObject) { var task = a_taskScriptableObject as CleaningTaskScriptableObject; targetCleanliness = task.TargetCleanliness; }
public override void SetTaskObject(TaskScriptableObject a_taskScriptableObject) { curTask = Instantiate(a_taskScriptableObject) as SharpeningTaskScriptableObject; deformer = sword.GetComponentInChildren <PerlinNoiseDeformer>(); }
public override void SetTaskObject(TaskScriptableObject a_taskScriptableObject) { var task = a_taskScriptableObject as HeatingTaskScriptableObject; targetHeat = task.targetHeatPercentage; }
public abstract void SetTaskObject(TaskScriptableObject a_taskScriptableObject);