작업 조건 분석 기능 개발
This commit is contained in:
@@ -0,0 +1,17 @@
|
||||
#define Graph_And_Chart_PRO
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace ChartAndGraph
|
||||
{
|
||||
public enum GapEnum
|
||||
{
|
||||
Day,
|
||||
Week,
|
||||
Month,
|
||||
Year
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 20b8e22c61ee9d64486c51a0b1c19b6c
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,154 @@
|
||||
#define Graph_And_Chart_PRO
|
||||
using ChartAndGraph;
|
||||
using System;
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using UnityEngine;
|
||||
|
||||
public class MonthWeekDayYear : MonoBehaviour
|
||||
{
|
||||
|
||||
public GapEnum Gap;
|
||||
double mStartPosition = 0;
|
||||
double mEndPostion = 0;
|
||||
GapEnum? mCurrent = null;
|
||||
void Start()
|
||||
{
|
||||
|
||||
}
|
||||
private void OnValidate()
|
||||
{
|
||||
|
||||
}
|
||||
void SetConstantGap(int days)
|
||||
{
|
||||
var axis = GetComponent<HorizontalAxis>();
|
||||
if (axis == null)
|
||||
return;
|
||||
if(axis.SubDivisions.Total != 0)
|
||||
axis.SubDivisions.Total = 0;
|
||||
if(axis.MainDivisions.Messure != ChartDivisionInfo.DivisionMessure.DataUnits)
|
||||
axis.MainDivisions.Messure = ChartDivisionInfo.DivisionMessure.DataUnits;
|
||||
float val = (float)(days * TimeSpan.FromDays(1).TotalSeconds);
|
||||
if (axis.MainDivisions.UnitsPerDivision != val)
|
||||
axis.MainDivisions.UnitsPerDivision = val;
|
||||
}
|
||||
void FixDivisions()
|
||||
{
|
||||
|
||||
}
|
||||
void Regenrate()
|
||||
{
|
||||
var chart = GetComponent<ScrollableAxisChart>();
|
||||
var axis = GetComponent<HorizontalAxis>();
|
||||
if (chart == null || axis == null)
|
||||
return;
|
||||
if (axis.SubDivisions.Total != 0)
|
||||
axis.SubDivisions.Total = 0;
|
||||
if (axis.MainDivisions.Messure != ChartDivisionInfo.DivisionMessure.TotalDivisions)
|
||||
axis.MainDivisions.Messure = ChartDivisionInfo.DivisionMessure.TotalDivisions;
|
||||
if (axis.MainDivisions.Total != 1)
|
||||
axis.MainDivisions.Total = 1;
|
||||
chart.ScrollableData.RestoreDataValues(0);
|
||||
double startPosition = chart.ScrollableData.HorizontalViewOrigin + chart.HorizontalScrolling;
|
||||
double endPosition = chart.ScrollableData.HorizontalViewSize + startPosition;
|
||||
|
||||
if (endPosition < startPosition)
|
||||
{
|
||||
double tmp = startPosition;
|
||||
startPosition = endPosition;
|
||||
endPosition = tmp;
|
||||
}
|
||||
double half = Math.Abs(chart.ScrollableData.HorizontalViewSize * 0.5f);
|
||||
mStartPosition = startPosition - half;
|
||||
mEndPostion = endPosition + half;
|
||||
if (Gap == GapEnum.Month)
|
||||
RegenrateMonth();
|
||||
else if (Gap == GapEnum.Year)
|
||||
RegenarateYear();
|
||||
}
|
||||
void RegenarateYear()
|
||||
{
|
||||
var chart = GetComponent<ScrollableAxisChart>();
|
||||
if (chart == null)
|
||||
return;
|
||||
chart.ClearHorizontalCustomDivisions();
|
||||
var startDate = ChartDateUtility.ValueToDate(mStartPosition);
|
||||
var endDate = ChartDateUtility.ValueToDate(mEndPostion);
|
||||
var origin = ChartDateUtility.ValueToDate(chart.ScrollableData.HorizontalViewOrigin);
|
||||
int yearGap = startDate.Year - origin.Year;
|
||||
DateTime current = origin.AddYears(yearGap);
|
||||
while (current < endDate)
|
||||
{
|
||||
chart.AddHorizontalAxisDivision(ChartDateUtility.DateToValue(current));
|
||||
yearGap++;
|
||||
current = origin.AddYears(yearGap);
|
||||
}
|
||||
}
|
||||
void RegenrateMonth()
|
||||
{
|
||||
var chart = GetComponent<ScrollableAxisChart>();
|
||||
if (chart == null)
|
||||
return;
|
||||
|
||||
chart.ClearHorizontalCustomDivisions();
|
||||
var startDate = ChartDateUtility.ValueToDate(mStartPosition);
|
||||
var endDate = ChartDateUtility.ValueToDate(mEndPostion);
|
||||
var origin = ChartDateUtility.ValueToDate(chart.ScrollableData.HorizontalViewOrigin);
|
||||
int yearGap = startDate.Year - origin.Year;
|
||||
int monthGap = startDate.AddYears(yearGap).Month - origin.Month;
|
||||
DateTime current = origin.AddYears(yearGap).AddMonths(monthGap);
|
||||
while(current < endDate)
|
||||
{
|
||||
chart.AddHorizontalAxisDivision(ChartDateUtility.DateToValue(current));
|
||||
monthGap++;
|
||||
current = origin.AddYears(yearGap).AddMonths(monthGap);
|
||||
}
|
||||
}
|
||||
bool IsViewInside()
|
||||
{
|
||||
var chart = GetComponent<ScrollableAxisChart>();
|
||||
if (chart == null)
|
||||
return false;
|
||||
double startPosition = chart.ScrollableData.HorizontalViewOrigin + chart.HorizontalScrolling;
|
||||
double endPosition = chart.ScrollableData.HorizontalViewSize + startPosition;
|
||||
|
||||
if (endPosition < startPosition)
|
||||
{
|
||||
double tmp = startPosition;
|
||||
startPosition = endPosition;
|
||||
endPosition = tmp;
|
||||
}
|
||||
if (startPosition < mStartPosition)
|
||||
return false;
|
||||
if (endPosition > mEndPostion)
|
||||
return false;
|
||||
return true;
|
||||
|
||||
}
|
||||
void CheckGenerate()
|
||||
{
|
||||
switch(Gap)
|
||||
{
|
||||
case GapEnum.Day:
|
||||
SetConstantGap(1);
|
||||
break;
|
||||
case GapEnum.Week:
|
||||
SetConstantGap(7);
|
||||
break;
|
||||
case GapEnum.Month:
|
||||
if(IsViewInside() == false || mCurrent.HasValue == false || mCurrent.Value != GapEnum.Month)
|
||||
Regenrate();
|
||||
break;
|
||||
case GapEnum.Year:
|
||||
if (IsViewInside() == false || mCurrent.HasValue == false || mCurrent.Value != GapEnum.Year)
|
||||
Regenrate();
|
||||
break;
|
||||
}
|
||||
mCurrent = Gap;
|
||||
}
|
||||
void Update()
|
||||
{
|
||||
CheckGenerate();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: dfed5cd626b38c644b9571ce46639998
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,8 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 66c18eee9efc394448e485fd72d64083
|
||||
timeCreated: 1560587944
|
||||
licenseType: Store
|
||||
DefaultImporter:
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,66 @@
|
||||
%YAML 1.1
|
||||
%TAG !u! tag:unity3d.com,2011:
|
||||
--- !u!850595691 &4890085278179872738
|
||||
LightingSettings:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_Name: MonthYearSettings
|
||||
serializedVersion: 6
|
||||
m_GIWorkflowMode: 0
|
||||
m_EnableBakedLightmaps: 1
|
||||
m_EnableRealtimeLightmaps: 1
|
||||
m_RealtimeEnvironmentLighting: 1
|
||||
m_BounceScale: 1
|
||||
m_AlbedoBoost: 1
|
||||
m_IndirectOutputScale: 1
|
||||
m_UsingShadowmask: 0
|
||||
m_BakeBackend: 0
|
||||
m_LightmapMaxSize: 1024
|
||||
m_BakeResolution: 40
|
||||
m_Padding: 2
|
||||
m_LightmapCompression: 3
|
||||
m_AO: 1
|
||||
m_AOMaxDistance: 1
|
||||
m_CompAOExponent: 1
|
||||
m_CompAOExponentDirect: 0
|
||||
m_ExtractAO: 0
|
||||
m_MixedBakeMode: 1
|
||||
m_LightmapsBakeMode: 1
|
||||
m_FilterMode: 1
|
||||
m_LightmapParameters: {fileID: 15204, guid: 0000000000000000f000000000000000, type: 0}
|
||||
m_ExportTrainingData: 0
|
||||
m_TrainingDataDestination: TrainingData
|
||||
m_RealtimeResolution: 2
|
||||
m_ForceWhiteAlbedo: 0
|
||||
m_ForceUpdates: 0
|
||||
m_FinalGather: 0
|
||||
m_FinalGatherRayCount: 256
|
||||
m_FinalGatherFiltering: 1
|
||||
m_PVRCulling: 1
|
||||
m_PVRSampling: 1
|
||||
m_PVRDirectSampleCount: 32
|
||||
m_PVRSampleCount: 512
|
||||
m_PVREnvironmentSampleCount: 512
|
||||
m_PVREnvironmentReferencePointCount: 2048
|
||||
m_LightProbeSampleCountMultiplier: 4
|
||||
m_PVRBounces: 2
|
||||
m_PVRMinBounces: 2
|
||||
m_PVREnvironmentImportanceSampling: 0
|
||||
m_PVRFilteringMode: 0
|
||||
m_PVRDenoiserTypeDirect: 0
|
||||
m_PVRDenoiserTypeIndirect: 0
|
||||
m_PVRDenoiserTypeAO: 0
|
||||
m_PVRFilterTypeDirect: 0
|
||||
m_PVRFilterTypeIndirect: 0
|
||||
m_PVRFilterTypeAO: 0
|
||||
m_PVRFilteringGaussRadiusDirect: 1
|
||||
m_PVRFilteringGaussRadiusIndirect: 5
|
||||
m_PVRFilteringGaussRadiusAO: 2
|
||||
m_PVRFilteringAtrousPositionSigmaDirect: 0.5
|
||||
m_PVRFilteringAtrousPositionSigmaIndirect: 2
|
||||
m_PVRFilteringAtrousPositionSigmaAO: 1
|
||||
m_PVRTiledBaking: 0
|
||||
m_NumRaysToShootPerTexel: -1
|
||||
m_RespectSceneVisibilityWhenBakingGI: 0
|
||||
@@ -0,0 +1,8 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 1ee9feb547663ce49a92f0e5b59da053
|
||||
NativeFormatImporter:
|
||||
externalObjects: {}
|
||||
mainObjectFileID: 4890085278179872738
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,26 @@
|
||||
#define Graph_And_Chart_PRO
|
||||
using ChartAndGraph;
|
||||
using System;
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using UnityEngine;
|
||||
|
||||
public class TestMonthWeek : MonoBehaviour
|
||||
{
|
||||
public GraphChart chart;
|
||||
|
||||
// Start is called before the first frame update
|
||||
void Start()
|
||||
{
|
||||
chart.DataSource.ClearCategory("Player 1");
|
||||
var now = DateTime.Now;
|
||||
for(int i=0; i<60; i++)
|
||||
chart.DataSource.AddPointToCategory("Player 1", now.AddMonths(i), UnityEngine.Random.Range(0f, 10f));
|
||||
}
|
||||
|
||||
// Update is called once per frame
|
||||
void Update()
|
||||
{
|
||||
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: d8568d9e048df9143991ca0e861dceae
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,33 @@
|
||||
#define Graph_And_Chart_PRO
|
||||
using ChartAndGraph;
|
||||
using System;
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using UnityEngine;
|
||||
|
||||
public class customAxisDivisions : MonoBehaviour
|
||||
{
|
||||
public GraphChart chart;
|
||||
// Start is called before the first frame update
|
||||
void Start()
|
||||
{
|
||||
chart.DataSource.ClearCategory("Player 1");
|
||||
DateTime now = DateTime.Now;
|
||||
for (int i = 0; i < 36; i++)
|
||||
chart.DataSource.AddPointToCategory("Player 1", now + TimeSpan.FromDays(i * 10), UnityEngine.Random.Range(0f, 10f));
|
||||
DateTime month = now;
|
||||
chart.ClearHorizontalCustomDivisions();
|
||||
for (int i = 0; i < 12; i++)
|
||||
{
|
||||
chart.AddHorizontalAxisDivision(ChartDateUtility.DateToValue(month));
|
||||
chart.AddHorizontalAxisDivision(ChartDateUtility.DateToValue(month.AddDays(15)),true);
|
||||
month = month.AddMonths(1);
|
||||
}
|
||||
}
|
||||
|
||||
// Update is called once per frame
|
||||
void Update()
|
||||
{
|
||||
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: a7f161f9ce255eb4e8cae1e8799eb7b6
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,8 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 52d4ad810c0e17f4cbeb30a85661253d
|
||||
timeCreated: 1560587944
|
||||
licenseType: Store
|
||||
DefaultImporter:
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,66 @@
|
||||
%YAML 1.1
|
||||
%TAG !u! tag:unity3d.com,2011:
|
||||
--- !u!850595691 &4890085278179872738
|
||||
LightingSettings:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_Name: customAxisDivisionsSettings
|
||||
serializedVersion: 6
|
||||
m_GIWorkflowMode: 0
|
||||
m_EnableBakedLightmaps: 1
|
||||
m_EnableRealtimeLightmaps: 1
|
||||
m_RealtimeEnvironmentLighting: 1
|
||||
m_BounceScale: 1
|
||||
m_AlbedoBoost: 1
|
||||
m_IndirectOutputScale: 1
|
||||
m_UsingShadowmask: 0
|
||||
m_BakeBackend: 0
|
||||
m_LightmapMaxSize: 1024
|
||||
m_BakeResolution: 40
|
||||
m_Padding: 2
|
||||
m_LightmapCompression: 3
|
||||
m_AO: 1
|
||||
m_AOMaxDistance: 1
|
||||
m_CompAOExponent: 1
|
||||
m_CompAOExponentDirect: 0
|
||||
m_ExtractAO: 0
|
||||
m_MixedBakeMode: 1
|
||||
m_LightmapsBakeMode: 1
|
||||
m_FilterMode: 1
|
||||
m_LightmapParameters: {fileID: 15204, guid: 0000000000000000f000000000000000, type: 0}
|
||||
m_ExportTrainingData: 0
|
||||
m_TrainingDataDestination: TrainingData
|
||||
m_RealtimeResolution: 2
|
||||
m_ForceWhiteAlbedo: 0
|
||||
m_ForceUpdates: 0
|
||||
m_FinalGather: 0
|
||||
m_FinalGatherRayCount: 256
|
||||
m_FinalGatherFiltering: 1
|
||||
m_PVRCulling: 1
|
||||
m_PVRSampling: 1
|
||||
m_PVRDirectSampleCount: 32
|
||||
m_PVRSampleCount: 512
|
||||
m_PVREnvironmentSampleCount: 512
|
||||
m_PVREnvironmentReferencePointCount: 2048
|
||||
m_LightProbeSampleCountMultiplier: 4
|
||||
m_PVRBounces: 2
|
||||
m_PVRMinBounces: 2
|
||||
m_PVREnvironmentImportanceSampling: 0
|
||||
m_PVRFilteringMode: 0
|
||||
m_PVRDenoiserTypeDirect: 0
|
||||
m_PVRDenoiserTypeIndirect: 0
|
||||
m_PVRDenoiserTypeAO: 0
|
||||
m_PVRFilterTypeDirect: 0
|
||||
m_PVRFilterTypeIndirect: 0
|
||||
m_PVRFilterTypeAO: 0
|
||||
m_PVRFilteringGaussRadiusDirect: 1
|
||||
m_PVRFilteringGaussRadiusIndirect: 5
|
||||
m_PVRFilteringGaussRadiusAO: 2
|
||||
m_PVRFilteringAtrousPositionSigmaDirect: 0.5
|
||||
m_PVRFilteringAtrousPositionSigmaIndirect: 2
|
||||
m_PVRFilteringAtrousPositionSigmaAO: 1
|
||||
m_PVRTiledBaking: 0
|
||||
m_NumRaysToShootPerTexel: -1
|
||||
m_RespectSceneVisibilityWhenBakingGI: 0
|
||||
@@ -0,0 +1,8 @@
|
||||
fileFormatVersion: 2
|
||||
guid: f3aad559868b2c345ada96e260073860
|
||||
NativeFormatImporter:
|
||||
externalObjects: {}
|
||||
mainObjectFileID: 4890085278179872738
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
Reference in New Issue
Block a user