Skip to content

Commit

Permalink
#7 Lineの素材を別Prefabに分離
Browse files Browse the repository at this point in the history
  • Loading branch information
the6th committed May 7, 2019
1 parent f9c55a7 commit b06a7d7
Show file tree
Hide file tree
Showing 7 changed files with 71 additions and 224 deletions.
121 changes: 2 additions & 119 deletions Assets/HoloMagnet3/Prefabs/BarMagnet/BarMagnet180202.prefab
Original file line number Diff line number Diff line change
Expand Up @@ -132,22 +132,6 @@ GameObject:
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!1 &1988136865035806
GameObject:
m_ObjectHideFlags: 0
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 100100000}
serializedVersion: 5
m_Component:
- component: {fileID: 4293817965191442}
- component: {fileID: 120904044303792982}
m_Layer: 0
m_Name: MagneticForceLine
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 0
--- !u!4 &4163221379759318
Transform:
m_ObjectHideFlags: 1
Expand Down Expand Up @@ -176,19 +160,6 @@ Transform:
m_Father: {fileID: 4628360241764182}
m_RootOrder: 1
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!4 &4293817965191442
Transform:
m_ObjectHideFlags: 1
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 100100000}
m_GameObject: {fileID: 1988136865035806}
m_LocalRotation: {x: 0, y: 0, z: 0.7071068, w: 0.7071068}
m_LocalPosition: {x: 0.0125, y: 0, z: -0.0125}
m_LocalScale: {x: 1, y: 1, z: 1}
m_Children: []
m_Father: {fileID: 4628360241764182}
m_RootOrder: 2
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 90}
--- !u!4 &4388754403228412
Transform:
m_ObjectHideFlags: 1
Expand All @@ -214,7 +185,6 @@ Transform:
m_Children:
- {fileID: 4984482104461526}
- {fileID: 4275080024640404}
- {fileID: 4293817965191442}
m_Father: {fileID: 0}
m_RootOrder: 0
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 90}
Expand Down Expand Up @@ -566,7 +536,8 @@ MonoBehaviour:
m_EditorClassIdentifier:
NorthPoleReference: {fileID: 0}
SouthPoleReference: {fileID: 0}
MagneticForceLineReference: {fileID: 0}
MagneticForceLinePrefab: {fileID: 1256482237385276, guid: 62bc29ccba336ac43931d2e055086335,
type: 2}
IsDrawing: 0
--- !u!114 &114736145909361394
MonoBehaviour:
Expand Down Expand Up @@ -626,91 +597,3 @@ MonoBehaviour:
m_EditorClassIdentifier:
ACMoving: {fileID: 8300000, guid: f7ae472712ee84e4bbf01ec756fdf312, type: 3}
IsMoving: 0
--- !u!120 &120904044303792982
LineRenderer:
m_ObjectHideFlags: 1
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 100100000}
m_GameObject: {fileID: 1988136865035806}
m_Enabled: 1
m_CastShadows: 0
m_ReceiveShadows: 0
m_DynamicOccludee: 1
m_MotionVectors: 0
m_LightProbeUsage: 0
m_ReflectionProbeUsage: 0
m_Materials:
- {fileID: 2100000, guid: c34a939a1dbcf574e82f9045f73518e4, type: 2}
m_StaticBatchInfo:
firstSubMesh: 0
subMeshCount: 0
m_StaticBatchRoot: {fileID: 0}
m_ProbeAnchor: {fileID: 0}
m_LightProbeVolumeOverride: {fileID: 0}
m_ScaleInLightmap: 1
m_PreserveUVs: 0
m_IgnoreNormalsForChartDetection: 0
m_ImportantGI: 0
m_StitchLightmapSeams: 0
m_SelectedEditorRenderState: 3
m_MinimumChartSize: 4
m_AutoUVMaxDistance: 0.5
m_AutoUVMaxAngle: 89
m_LightmapParameters: {fileID: 0}
m_SortingLayerID: 0
m_SortingLayer: 0
m_SortingOrder: 0
m_Positions:
- {x: 0, y: 0, z: 0}
- {x: 0, y: 0, z: 1}
m_Parameters:
serializedVersion: 2
widthMultiplier: 0.001
widthCurve:
serializedVersion: 2
m_Curve:
- serializedVersion: 2
time: 0
value: 1
inSlope: 0
outSlope: 0
tangentMode: 0
m_PreInfinity: 2
m_PostInfinity: 2
m_RotationOrder: 4
colorGradient:
serializedVersion: 2
key0: {r: 1, g: 1, b: 0, a: 1}
key1: {r: 0.37241375, g: 1, b: 0, a: 1}
key2: {r: 0, g: 0, b: 0, a: 0}
key3: {r: 0, g: 0, b: 0, a: 0}
key4: {r: 0, g: 0, b: 0, a: 0}
key5: {r: 0, g: 0, b: 0, a: 0}
key6: {r: 0, g: 0, b: 0, a: 0}
key7: {r: 0, g: 0, b: 0, a: 0}
ctime0: 0
ctime1: 65535
ctime2: 0
ctime3: 0
ctime4: 0
ctime5: 0
ctime6: 0
ctime7: 0
atime0: 0
atime1: 65535
atime2: 0
atime3: 0
atime4: 0
atime5: 0
atime6: 0
atime7: 0
m_Mode: 0
m_NumColorKeys: 2
m_NumAlphaKeys: 2
numCornerVertices: 0
numCapVertices: 0
alignment: 0
textureMode: 0
generateLightingData: 0
m_UseWorldSpace: 0
m_Loop: 0
6 changes: 1 addition & 5 deletions Assets/HoloMagnet3/Prefabs/BarMagnet/BarMagnetInitializer.cs
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,7 @@ void Start () {
transform.Find("North Body/North Pole").gameObject;
gameObject.GetComponent<BarMagnetModel>().SouthPoleReference =
transform.Find("South Body/South Pole").gameObject;
gameObject.GetComponent<BarMagnetModel>().MagneticForceLineReference =
transform.Find("MagneticForceLine").gameObject;
//BarMagnetModel.Instance.NorthPoleReference = transform.Find("North Body/North Pole").gameObject;
//BarMagnetModel.Instance.SouthPoleReference = transform.Find("South Body/South Pole").gameObject;
//BarMagnetModel.Instance.MagneticForceLineReference = transform.Find("MagneticForceLine").gameObject;


//準備出来たらGlobalListenerに追加
if (gameObject.GetComponent<SetGlobalListener>() == null)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,8 @@
public class BarMagnetMagneticForceLinesSimultaneouslyDrawer : MonoBehaviour {

public int Mode = 0; // 0: 2D, 1: 3D Todo: Listを使う
private GameObject magneticForceLine
{
get
{
return BarMagnetModel.Instance.MagneticForceLineReference;
}
}
private GameObject magneticForceLinePrefab;

private bool hasLogged;

static Material lineMaterial;
Expand All @@ -23,7 +18,7 @@ private GameObject magneticForceLine

private void Start()
{
//magneticForceLine = BarMagnetModel.Instance.MagneticForceLineReference;
magneticForceLinePrefab = BarMagnetModel.Instance.MagneticForceLinePrefab;
}

public void Update()
Expand Down Expand Up @@ -74,7 +69,6 @@ public void Draw(int dimension)
{
GameObject myMagnet = gameObject;

magneticForceLine.SetActive(true);
this.DeleteLines();

Vector3 myBarMagnetNorthPoleWorldPosition = BarMagnetModel.Instance.NorthPoleReference.transform.position;
Expand Down Expand Up @@ -128,7 +122,7 @@ public void Draw(int dimension)
for (int indexZ = numStartZ; indexZ <= numEndZ; indexZ += numShiftZ) // y
{
GameObject magneticForceLine =
Instantiate(this.magneticForceLine, transform.position, Quaternion.identity);
Instantiate(magneticForceLinePrefab, transform.position, Quaternion.identity);

// 作成したオブジェクトを子として登録
magneticForceLine.tag = "CloneLine";
Expand Down Expand Up @@ -176,6 +170,6 @@ public void Draw(int dimension)
}
}
}
magneticForceLine.SetActive(false);

}
}
2 changes: 1 addition & 1 deletion Assets/HoloMagnet3/Prefabs/BarMagnet/BarMagnetModel.cs
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,6 @@
public class BarMagnetModel : Singleton<BarMagnetModel> {
public GameObject NorthPoleReference;
public GameObject SouthPoleReference;
public GameObject MagneticForceLineReference;
public GameObject MagneticForceLinePrefab;
public bool IsDrawing;
}
56 changes: 16 additions & 40 deletions Assets/HoloMagnet3/Prefabs/MagneticForceLine.prefab
Original file line number Diff line number Diff line change
Expand Up @@ -9,43 +9,43 @@ Prefab:
m_Modifications: []
m_RemovedComponents: []
m_ParentPrefab: {fileID: 0}
m_RootGameObject: {fileID: 1835690485930130}
m_RootGameObject: {fileID: 1256482237385276}
m_IsPrefabParent: 1
--- !u!1 &1835690485930130
--- !u!1 &1256482237385276
GameObject:
m_ObjectHideFlags: 0
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 100100000}
serializedVersion: 5
m_Component:
- component: {fileID: 4125896551983138}
- component: {fileID: 120763714508251340}
- component: {fileID: 4612625753202338}
- component: {fileID: 120257797561138146}
m_Layer: 0
m_Name: MagneticForceLine
m_TagString: CloneLine
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!4 &4125896551983138
--- !u!4 &4612625753202338
Transform:
m_ObjectHideFlags: 1
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 100100000}
m_GameObject: {fileID: 1835690485930130}
m_LocalRotation: {x: 0, y: 0, z: 0.7071068, w: 0.7071068}
m_LocalPosition: {x: 0.0125, y: 0, z: -0.0125}
m_LocalScale: {x: 1, y: 1, z: 1}
m_GameObject: {fileID: 1256482237385276}
m_LocalRotation: {x: -0, y: -0, z: 1, w: 0}
m_LocalPosition: {x: 0, y: 0.012500002, z: 1.99375}
m_LocalScale: {x: 1, y: 1, z: 0.5}
m_Children: []
m_Father: {fileID: 0}
m_RootOrder: 0
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 90}
--- !u!120 &120763714508251340
--- !u!120 &120257797561138146
LineRenderer:
m_ObjectHideFlags: 1
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 100100000}
m_GameObject: {fileID: 1835690485930130}
m_GameObject: {fileID: 1256482237385276}
m_Enabled: 1
m_CastShadows: 0
m_ReceiveShadows: 0
Expand Down Expand Up @@ -75,26 +75,8 @@ LineRenderer:
m_SortingLayer: 0
m_SortingOrder: 0
m_Positions:
- {x: -0.02250002, y: -0.025000013, z: 2.9875}
- {x: -0.02297839, y: -0.023578336, z: 2.9875}
- {x: -0.023440646, y: -0.02215134, z: 2.9875}
- {x: -0.023885265, y: -0.02071875, z: 2.9875}
- {x: -0.024310675, y: -0.019280339, z: 2.9875}
- {x: -0.024715262, y: -0.017835932, z: 2.9875}
- {x: -0.025097389, y: -0.016385421, z: 2.9875}
- {x: -0.025455408, y: -0.014928774, z: 2.9875}
- {x: -0.02578768, y: -0.013466038, z: 2.9875}
- {x: -0.026092587, y: -0.011997354, z: 2.9875}
- {x: -0.026368568, y: -0.010522962, z: 2.9875}
- {x: -0.026614128, y: -0.009043198, z: 2.9875}
- {x: -0.026827872, y: -0.007558505, z: 2.9875}
- {x: -0.027008528, y: -0.0060694236, z: 2.9875}
- {x: -0.027154969, y: -0.004576589, z: 2.9875}
- {x: -0.027266242, y: -0.003080722, z: 2.9875}
- {x: -0.027341584, y: -0.0015826154, z: 2.9875}
- {x: -0.027361013, y: -0.00083286717, z: 2.9875}
- {x: -0.027371248, y: -0.00008293701, z: 2.9875}
- {x: -0.027372267, y: 0.0006670623, z: 2.9875}
- {x: 0, y: 0, z: 0}
- {x: 0, y: 0, z: 1}
m_Parameters:
serializedVersion: 2
widthMultiplier: 0.001
Expand All @@ -103,13 +85,7 @@ LineRenderer:
m_Curve:
- serializedVersion: 2
time: 0
value: 3
inSlope: 0
outSlope: 0
tangentMode: 0
- serializedVersion: 2
time: 1
value: 3
value: 1
inSlope: 0
outSlope: 0
tangentMode: 0
Expand Down Expand Up @@ -150,5 +126,5 @@ LineRenderer:
alignment: 0
textureMode: 0
generateLightingData: 0
m_UseWorldSpace: 1
m_UseWorldSpace: 0
m_Loop: 0
2 changes: 0 additions & 2 deletions Assets/HoloMagnet3/Prefabs/MagneticForceLine.prefab.meta

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit b06a7d7

Please sign in to comment.