IEnumerator ExplosionBarrel() { Instantiate(expEffect, tr.position, Quaternion.identity); Collider[] colls = Physics.OverlapSphere(tr.position, 10.0f); foreach (Collider coll in colls) { if (coll.rigidbody != null) { coll.rigidbody.mass = 5.0f; coll.rigidbody.AddExplosionForce(800.0f, tr.position, 10.0f, 300.0f); } } if (hitCount == 10) { BarrelCount--; score += UnityBridge.BarrelScore(this.tag); guiScore.text = scoreText + score; } barrelCount.text = barrelCountContext + BarrelCount; Destroy(gameObject, 5.0f); yield return(null); }
// Update is called once per frame void Update() { if (Input.GetMouseButtonDown(0)) { Fire(); } bulltCountText.text = bulltCount + count; accurateText.text = accurate + UnityBridge.Accurate(BarrelCtrl.totalHit, count) * 100 + "%"; }
public void RegisterBridge(UnityBridge ub) { // TODO: Cleanup code smell if (_draggingComponent == null) { _draggingComponent = GetComponent <DraggingComponent>(); } if (_draggingComponent != null) { _draggingComponent.OnDragForwardSuccessful += (sender, args) => ub.PlayCardFromHand(InstanceId); _draggingComponent.OnDragBackwardSuccessful += (sender, args) => ub.RerollCard(InstanceId); } }
private void DoSpriteEditorButton() { using (new EditorGUI.DisabledScope(targets.Length != 1)) { GUILayout.BeginHorizontal(); GUILayout.FlexibleSpace(); if (GUILayout.Button(GUITexts.spriteEditorButtonLabel)) { if (HasModified()) { // To ensure Sprite Editor Window to have the latest texture import setting, // We must applied those modified values first. string dialogText = string.Format(GUITexts.unappliedSettingsDialogContent.text, ((AssetImporter)target).assetPath); if (EditorUtility.DisplayDialog(GUITexts.unappliedSettingsDialogTitle.text, dialogText, GUITexts.applyButtonLabel.text, GUITexts.revertButtonLabel.text)) { ApplyAndImport(); UnityBridge.OpenSpriteEditor(this.assetTarget); // showSpriteEditorWindow(); // We reimported the asset which destroyed the editor, so we can't keep running the UI here. GUIUtility.ExitGUI(); } } else { Selection.activeObject = assetTarget; UnityBridge.OpenSpriteEditor(this.assetTarget); //showSpriteEditorWindow(); } } GUILayout.EndHorizontal(); } }
public SimvaBridge(ApiClient apiClient) { unityBridge = new UnityBridge(); this.apiClient = apiClient; }
public GUIText gt; // Use this for initialization void Start() { gt.text = " : " + UnityBridge.Accurate(10, 2); gt.text += UnityBridge.BarrelScore("YELLOBARREL"); }
public static UnityBridge Create() { return(_instance ?? (_instance = new UnityBridge())); }
/// <summary> /// Set the pinball brain to use for the game /// </summary> /// <param name="brain"></param> public void SetUnityBridge(UnityBridge unityBridge) { this.brain = unityBridge.Brain; this.videoPlayer = unityBridge.VideoPlayer; }