コード例 #1
0
    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);
    }
コード例 #2
0
    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;
            }
        }
    }
コード例 #3
0
ファイル: CleaningTaskManager.cs プロジェクト: Daniel95/GGJ20
    public override void SetTaskObject(TaskScriptableObject a_taskScriptableObject)
    {
        var task = a_taskScriptableObject as CleaningTaskScriptableObject;

        targetCleanliness = task.TargetCleanliness;
    }
コード例 #4
0
    public override void SetTaskObject(TaskScriptableObject a_taskScriptableObject)
    {
        curTask = Instantiate(a_taskScriptableObject) as SharpeningTaskScriptableObject;

        deformer = sword.GetComponentInChildren <PerlinNoiseDeformer>();
    }
コード例 #5
0
    public override void SetTaskObject(TaskScriptableObject a_taskScriptableObject)
    {
        var task = a_taskScriptableObject as HeatingTaskScriptableObject;

        targetHeat = task.targetHeatPercentage;
    }
コード例 #6
0
 public abstract void SetTaskObject(TaskScriptableObject a_taskScriptableObject);