Import assets from store
This commit is contained in:
1 parent
a05f2e47a2
commit
376e52e323
875 files changed
+128037
No files matched your search
@@ -0,0 +1,63 @@
|
||||
///
|
||||
// Heavy Rendering Controller
|
||||
//
|
||||
// Author : Alex Tuduran
|
||||
// Copyright : OmniSAR Technologies
|
||||
//
|
||||
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using UnityEngine;
|
||||
using UnityEngine.UI;
|
||||
using OmniSARTechnologies.Helper;
|
||||
|
||||
namespace OmniSARTechnologies.LiteFPSCounter.Examples {
|
||||
public class HeavyRenderingController : MonoBehaviour {
|
||||
public Material heavyRenderingMaterial;
|
||||
|
||||
[Range(0, 1)]
|
||||
public float complexity = 0.05f;
|
||||
|
||||
public Text complexityText;
|
||||
public Slider complexitySlider;
|
||||
public Gradient complexityHeatMap;
|
||||
|
||||
public float GetComplexity() {
|
||||
if (!heavyRenderingMaterial) {
|
||||
return 0.0f;
|
||||
}
|
||||
|
||||
return Mathf.Clamp01(heavyRenderingMaterial.GetFloat("_Complexity"));
|
||||
}
|
||||
|
||||
public void SetComplexity(float value) {
|
||||
complexity = value;
|
||||
|
||||
if (heavyRenderingMaterial) {
|
||||
heavyRenderingMaterial.SetFloat("_Complexity", Mathf.Clamp01(complexity));
|
||||
}
|
||||
|
||||
if (complexityText) {
|
||||
complexityText.text = string.Format(
|
||||
"Material Complexity: {0}",
|
||||
ColorHelper.ColorText(
|
||||
(complexity * 100.0f).ToString("F2") + "%",
|
||||
complexityHeatMap.Evaluate(complexity)
|
||||
)
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
public void UpdateComplexity() {
|
||||
SetComplexity(complexitySlider ? complexitySlider.value : complexity);
|
||||
}
|
||||
|
||||
private void Start() {
|
||||
UpdateComplexity();
|
||||
}
|
||||
|
||||
private void OnValidate() {
|
||||
UpdateComplexity();
|
||||
}
|
||||
}
|
||||
}
|
||||
+20
@@ -0,0 +1,20 @@
|
||||
fileFormatVersion: 2
|
||||
guid: f4dc405f9892c0b4cbe41ce15a8fdc1e
|
||||
timeCreated: 1541083148
|
||||
licenseType: Store
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
AssetOrigin:
|
||||
serializedVersion: 1
|
||||
productId: 132638
|
||||
packageName: Lite FPS Counter - Probably the world's fastest FPS counter
|
||||
packageVersion: 1.0.1
|
||||
assetPath: Assets/OmniSARTechnologies/LiteFPSCounter/Demo/Scripts/HeavyRenderingController.cs
|
||||
uploadId: 739912
|
||||
@@ -0,0 +1,45 @@
|
||||
///
|
||||
// Simple Scene Switcher
|
||||
//
|
||||
// Author : Alex Tuduran
|
||||
// Copyright : OmniSAR Technologies
|
||||
//
|
||||
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using UnityEngine;
|
||||
using UnityEngine.UI;
|
||||
using UnityEngine.SceneManagement;
|
||||
|
||||
namespace OmniSARTechnologies.LiteFPSCounter.Examples {
|
||||
public class SimpleSceneSwitcher : MonoBehaviour {
|
||||
public Text sceneNameText;
|
||||
|
||||
private void Start() {
|
||||
UpdateSceneNameText();
|
||||
}
|
||||
|
||||
public void ChangeActiveScene(int buildIndexOffset) {
|
||||
if (SceneManager.sceneCountInBuildSettings < 1) {
|
||||
return;
|
||||
}
|
||||
|
||||
int newSceneBuildIndex = SceneManager.GetActiveScene().buildIndex;
|
||||
newSceneBuildIndex += buildIndexOffset;
|
||||
newSceneBuildIndex += SceneManager.sceneCountInBuildSettings << 10;
|
||||
newSceneBuildIndex %= SceneManager.sceneCountInBuildSettings;
|
||||
newSceneBuildIndex = Mathf.Clamp(newSceneBuildIndex, 0, SceneManager.sceneCountInBuildSettings - 1);
|
||||
|
||||
SceneManager.LoadScene(newSceneBuildIndex);
|
||||
UpdateSceneNameText();
|
||||
}
|
||||
|
||||
private void UpdateSceneNameText() {
|
||||
if (!sceneNameText) {
|
||||
return;
|
||||
}
|
||||
|
||||
sceneNameText.text = SceneManager.GetActiveScene().name;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,20 @@
|
||||
fileFormatVersion: 2
|
||||
guid: d44d12ad28703d145a8e77243b81a15c
|
||||
timeCreated: 1541090604
|
||||
licenseType: Store
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
AssetOrigin:
|
||||
serializedVersion: 1
|
||||
productId: 132638
|
||||
packageName: Lite FPS Counter - Probably the world's fastest FPS counter
|
||||
packageVersion: 1.0.1
|
||||
assetPath: Assets/OmniSARTechnologies/LiteFPSCounter/Demo/Scripts/SimpleSceneSwitcher.cs
|
||||
uploadId: 739912
|
||||
Reference in new issue
Block a user