Horloge basique

This commit is contained in:
Crom (Thibaut CHARLES) 2014-11-09 20:21:28 +01:00
parent 70c8d57c11
commit e8f8a29947
3 changed files with 280 additions and 0 deletions

View File

@ -8992,6 +8992,73 @@ MeshFilter:
m_PrefabInternal: {fileID: 1275117047}
m_GameObject: {fileID: 773271378}
m_Mesh: {fileID: 4300004, guid: 03a364bec8494654387866aab74cf767, type: 3}
--- !u!1 &775520145
GameObject:
m_ObjectHideFlags: 0
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
serializedVersion: 4
m_Component:
- 224: {fileID: 775520146}
- 222: {fileID: 775520148}
- 114: {fileID: 775520147}
m_Layer: 5
m_Name: Text
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!224 &775520146
RectTransform:
m_ObjectHideFlags: 0
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
m_GameObject: {fileID: 775520145}
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
m_LocalPosition: {x: 0, y: 0, z: 0}
m_LocalScale: {x: 1, y: 1, z: 1}
m_Children: []
m_Father: {fileID: 1796539523}
m_RootOrder: 0
m_AnchorMin: {x: .5, y: .5}
m_AnchorMax: {x: .5, y: .5}
m_AnchoredPosition: {x: 0, y: 20}
m_SizeDelta: {x: 36.2000008, y: 19.7000008}
m_Pivot: {x: .5, y: .5}
--- !u!114 &775520147
MonoBehaviour:
m_ObjectHideFlags: 0
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
m_GameObject: {fileID: 775520145}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 708705254, guid: f5f67c52d1564df4a8936ccd202a3bd8, type: 3}
m_Name:
m_EditorClassIdentifier:
m_Material: {fileID: 0}
m_Color: {r: .1953125, g: .1953125, b: .1953125, a: 1}
m_FontData:
m_Font: {fileID: 10102, guid: 0000000000000000e000000000000000, type: 0}
m_FontSize: 14
m_FontStyle: 0
m_BestFit: 0
m_MinSize: 10
m_MaxSize: 40
m_Alignment: 1
m_RichText: 1
m_HorizontalOverflow: 0
m_VerticalOverflow: 0
m_LineSpacing: 1
m_Text: Day
--- !u!222 &775520148
CanvasRenderer:
m_ObjectHideFlags: 0
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
m_GameObject: {fileID: 775520145}
m_HideIfInvisible: 0
--- !u!1 &785428530
GameObject:
m_ObjectHideFlags: 0
@ -18636,6 +18703,82 @@ MeshFilter:
m_PrefabInternal: {fileID: 0}
m_GameObject: {fileID: 1690426312}
m_Mesh: {fileID: 4300012, guid: 027c250b9f20b1e49903b3b4c633cd9d, type: 3}
--- !u!1 &1693405241
GameObject:
m_ObjectHideFlags: 0
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
serializedVersion: 4
m_Component:
- 224: {fileID: 1693405242}
- 222: {fileID: 1693405245}
- 114: {fileID: 1693405244}
- 114: {fileID: 1693405243}
m_Layer: 5
m_Name: Clock
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!224 &1693405242
RectTransform:
m_ObjectHideFlags: 0
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
m_GameObject: {fileID: 1693405241}
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
m_LocalPosition: {x: 0, y: 0, z: 0}
m_LocalScale: {x: 1, y: 1, z: 1}
m_Children:
- {fileID: 1796539523}
m_Father: {fileID: 1981988301}
m_RootOrder: 1
m_AnchorMin: {x: 0, y: 1}
m_AnchorMax: {x: 0, y: 1}
m_AnchoredPosition: {x: 60, y: -60}
m_SizeDelta: {x: 100, y: 100}
m_Pivot: {x: .5, y: .5}
--- !u!114 &1693405243
MonoBehaviour:
m_ObjectHideFlags: 0
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
m_GameObject: {fileID: 1693405241}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: b32107f6f0d5dd74c90cd6de5942634c, type: 3}
m_Name:
m_EditorClassIdentifier:
clock: {fileID: 1796539522}
--- !u!114 &1693405244
MonoBehaviour:
m_ObjectHideFlags: 0
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
m_GameObject: {fileID: 1693405241}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: -765806418, guid: f5f67c52d1564df4a8936ccd202a3bd8, type: 3}
m_Name:
m_EditorClassIdentifier:
m_Material: {fileID: 0}
m_Color: {r: 1, g: 1, b: 1, a: .39199999}
m_Sprite: {fileID: 10907, guid: 0000000000000000f000000000000000, type: 0}
m_Type: 1
m_PreserveAspect: 0
m_FillCenter: 1
m_FillMethod: 4
m_FillAmount: 1
m_FillClockwise: 1
m_FillOrigin: 0
--- !u!222 &1693405245
CanvasRenderer:
m_ObjectHideFlags: 0
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
m_GameObject: {fileID: 1693405241}
m_HideIfInvisible: 0
--- !u!1 &1703524871
GameObject:
m_ObjectHideFlags: 0
@ -19463,6 +19606,40 @@ MeshFilter:
m_PrefabInternal: {fileID: 0}
m_GameObject: {fileID: 1790482484}
m_Mesh: {fileID: 4300278, guid: 027c250b9f20b1e49903b3b4c633cd9d, type: 3}
--- !u!1 &1796539522
GameObject:
m_ObjectHideFlags: 0
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
serializedVersion: 4
m_Component:
- 224: {fileID: 1796539523}
m_Layer: 5
m_Name: RotationClock
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!224 &1796539523
RectTransform:
m_ObjectHideFlags: 0
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
m_GameObject: {fileID: 1796539522}
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
m_LocalPosition: {x: 0, y: 0, z: 0}
m_LocalScale: {x: 1, y: 1, z: 1}
m_Children:
- {fileID: 775520146}
- {fileID: 1905398684}
m_Father: {fileID: 1693405242}
m_RootOrder: 0
m_AnchorMin: {x: .5, y: .5}
m_AnchorMax: {x: .5, y: .5}
m_AnchoredPosition: {x: 0, y: 0}
m_SizeDelta: {x: 100, y: 100}
m_Pivot: {x: .5, y: .5}
--- !u!1 &1800163883
GameObject:
m_ObjectHideFlags: 0
@ -20849,6 +21026,73 @@ MeshFilter:
m_PrefabInternal: {fileID: 0}
m_GameObject: {fileID: 1904848815}
m_Mesh: {fileID: 4300324, guid: 027c250b9f20b1e49903b3b4c633cd9d, type: 3}
--- !u!1 &1905398683
GameObject:
m_ObjectHideFlags: 0
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
serializedVersion: 4
m_Component:
- 224: {fileID: 1905398684}
- 222: {fileID: 1905398686}
- 114: {fileID: 1905398685}
m_Layer: 5
m_Name: Text
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!224 &1905398684
RectTransform:
m_ObjectHideFlags: 0
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
m_GameObject: {fileID: 1905398683}
m_LocalRotation: {x: 0, y: 0, z: 1, w: -4.37113883e-08}
m_LocalPosition: {x: 0, y: 0, z: 0}
m_LocalScale: {x: 1, y: 1, z: 1}
m_Children: []
m_Father: {fileID: 1796539523}
m_RootOrder: 1
m_AnchorMin: {x: .5, y: .5}
m_AnchorMax: {x: .5, y: .5}
m_AnchoredPosition: {x: 0, y: -20}
m_SizeDelta: {x: 36.2000008, y: 19.7000008}
m_Pivot: {x: .5, y: .5}
--- !u!114 &1905398685
MonoBehaviour:
m_ObjectHideFlags: 0
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
m_GameObject: {fileID: 1905398683}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 708705254, guid: f5f67c52d1564df4a8936ccd202a3bd8, type: 3}
m_Name:
m_EditorClassIdentifier:
m_Material: {fileID: 0}
m_Color: {r: .1953125, g: .1953125, b: .1953125, a: 1}
m_FontData:
m_Font: {fileID: 10102, guid: 0000000000000000e000000000000000, type: 0}
m_FontSize: 14
m_FontStyle: 0
m_BestFit: 0
m_MinSize: 10
m_MaxSize: 40
m_Alignment: 1
m_RichText: 1
m_HorizontalOverflow: 0
m_VerticalOverflow: 0
m_LineSpacing: 1
m_Text: Night
--- !u!222 &1905398686
CanvasRenderer:
m_ObjectHideFlags: 0
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
m_GameObject: {fileID: 1905398683}
m_HideIfInvisible: 0
--- !u!1 &1906670295
GameObject:
m_ObjectHideFlags: 0
@ -21802,6 +22046,7 @@ RectTransform:
m_LocalScale: {x: 0, y: 0, z: 0}
m_Children:
- {fileID: 1971934887}
- {fileID: 1693405242}
m_Father: {fileID: 0}
m_RootOrder: 2
m_AnchorMin: {x: 0, y: 0}

27
Assets/scripts/Clock.cs Normal file
View File

@ -0,0 +1,27 @@
using UnityEngine;
using System.Collections;
public class Clock : MonoBehaviour {
public GameObject clock;
// Use this for initialization
void Start () {
}
// Update is called once per frame
void Update () {
//TODO: Sync clock with the server
//TODO: Set var as for day % or hour
float fRot = clock.transform.rotation.z;
if(fRot>=0 && fRot<180){
clock.transform.Rotate(0, 0, (float)(Time.deltaTime * 180.0/150.0));//2.5min
}
else{
clock.transform.Rotate(0, 0, (float)(Time.deltaTime * 180.0/60.0));//1min
}
}
}

View File

@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: b32107f6f0d5dd74c90cd6de5942634c
MonoImporter:
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData: