mirror of
https://github.com/Mukheem/TwinTurbine.git
synced 2025-04-25 05:00:34 +02:00
WT turns only when button the user presses green button
WInd speed is obtained from SHMI and WT turns with that speed
This commit is contained in:
parent
531be1b0eb
commit
92aebe531b
Assets
SharedSpatialAnchors
Prefabs/Resources
Scripts
Wind_Turbine/Scripts
ProjectSettings
@ -1758,6 +1758,10 @@ PrefabInstance:
|
||||
propertyPath: m_Name
|
||||
value: CanvasJsonData
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 6036491612173940071, guid: ebcaad662ef2ae14ca92fbcd7a67ee56, type: 3}
|
||||
propertyPath: m_TagString
|
||||
value: GUIData
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 6036491612173940088, guid: ebcaad662ef2ae14ca92fbcd7a67ee56, type: 3}
|
||||
propertyPath: m_Color.b
|
||||
value: 0
|
||||
|
@ -962,7 +962,7 @@ Transform:
|
||||
m_GameObject: {fileID: 3128949758138181256}
|
||||
m_LocalRotation: {x: 0, y: 1, z: 0, w: 0}
|
||||
m_LocalPosition: {x: 1.42, y: 0, z: 0}
|
||||
m_LocalScale: {x: 1, y: 1, z: 1}
|
||||
m_LocalScale: {x: 1, y: 1.3, z: 1.3}
|
||||
m_ConstrainProportionsScale: 0
|
||||
m_Children:
|
||||
- {fileID: 5280034911807405635}
|
||||
|
@ -14,7 +14,7 @@ GameObject:
|
||||
- component: {fileID: 5204658000653702064}
|
||||
m_Layer: 0
|
||||
m_Name: wind_turbine_0001_rotor
|
||||
m_TagString: Untagged
|
||||
m_TagString: WindTurbine
|
||||
m_Icon: {fileID: 0}
|
||||
m_NavMeshLayer: 0
|
||||
m_StaticEditorFlags: 0
|
||||
@ -96,6 +96,7 @@ MonoBehaviour:
|
||||
m_Script: {fileID: 11500000, guid: fd8e0fba131aaac4caffc43785275be1, type: 3}
|
||||
m_Name:
|
||||
m_EditorClassIdentifier:
|
||||
speed: 0
|
||||
--- !u!1 &382264866490105690
|
||||
GameObject:
|
||||
m_ObjectHideFlags: 0
|
||||
|
@ -45,7 +45,7 @@ public class API : MonoBehaviour
|
||||
public TextMeshProUGUI windSpeedValue;
|
||||
private float LatestT;
|
||||
private float latestWD;
|
||||
private float latestWS;
|
||||
public float latestWS;
|
||||
private String windDirectionInDirectionTerms;
|
||||
private string unit;
|
||||
private GameObject webSocketController;
|
||||
|
@ -384,7 +384,7 @@ public class SharedAnchorControlPanel : MonoBehaviour
|
||||
|
||||
//photonGrabbableGui.TransferOwnershipToLocalPlayer();
|
||||
|
||||
var networkedAvatar = PhotonPun.PhotonNetwork.Instantiate(TwinTurbine_talkingAvatar.name, new Vector3(1f, -0.2f, 1.15f), Quaternion.identity);
|
||||
var networkedAvatar = PhotonPun.PhotonNetwork.Instantiate(TwinTurbine_talkingAvatar.name, new Vector3(1f, -0.2f, 1.15f), Quaternion.Euler(Vector3.up * 120));
|
||||
var photonGrabbableAvatar = networkedAvatar.GetComponent<PhotonGrabbableObject>();
|
||||
}
|
||||
}
|
||||
|
@ -5,19 +5,23 @@ using UnityEngine;
|
||||
public class Windturbine : MonoBehaviour
|
||||
{
|
||||
float angle;
|
||||
float speed;
|
||||
|
||||
public float speed;
|
||||
private API apiScript;
|
||||
private GameObject GUIdataGameObject;
|
||||
// Start is called before the first frame update
|
||||
void Start()
|
||||
{
|
||||
angle = Random.Range(0.0f, 120.0f);
|
||||
speed = Random.Range(75.0f, 86.0f);
|
||||
GUIdataGameObject = GameObject.FindGameObjectWithTag("GUIData");
|
||||
apiScript = GUIdataGameObject.GetComponent<API>();
|
||||
}
|
||||
|
||||
// Update is called once per frame
|
||||
void Update()
|
||||
{
|
||||
Debug.Log("WIND SPEED FROM API SCRIPT:" + apiScript.latestWS);
|
||||
transform.localEulerAngles = new Vector3(0.0f, 0.0f, angle);
|
||||
angle += Time.deltaTime * speed;
|
||||
angle += Time.deltaTime * (apiScript.latestWS*10);
|
||||
}
|
||||
}
|
||||
|
@ -5,6 +5,8 @@ TagManager:
|
||||
serializedVersion: 2
|
||||
tags:
|
||||
- WebController
|
||||
- WindTurbine
|
||||
- GUIData
|
||||
layers:
|
||||
- Default
|
||||
- TransparentFX
|
||||
|
Loading…
x
Reference in New Issue
Block a user