浏览代码
Merge pull request #257 from Unity-Technologies/Branch_Batching2
Merge pull request #257 from Unity-Technologies/Branch_Batching2
Branch batching2/Branch_Batching2
GitHub
8 年前
当前提交
e608702b
共有 14 个文件被更改,包括 110 次插入 和 21 次删除
-
32Assets/TestScenes/Common/Scripts/MiniProfiler.cs
-
4Assets/TestScenes/HDTest/NewBatcherTest.meta
-
4Assets/TestScenes/HDTest/NewBatcherTest/Prefabs/Capsule.prefab
-
4Assets/TestScenes/HDTest/NewBatcherTest/Prefabs/Cube.prefab
-
4Assets/TestScenes/HDTest/NewBatcherTest/Prefabs/Cylinder.prefab
-
4Assets/TestScenes/HDTest/NewBatcherTest/Prefabs/Sphere.prefab
-
6Assets/TestScenes/HDTest/NewBatcherTest/matbench_2.mat
-
7ProjectSettings/EditorBuildSettings.asset
-
5ProjectSettings/ProjectSettings.asset
-
8Assets/TestScenes/HDTest/NewBatcherBench2.unity.meta
-
41Assets/TestScenes/HDTest/NewBatcherTest/Mover.cs
-
12Assets/TestScenes/HDTest/NewBatcherTest/Mover.cs.meta
|
|||
fileFormatVersion: 2 |
|||
guid: 01a0eae0646089f489a0047dc8afb564 |
|||
guid: 0ce05dc93eb4c90438b867f03422566b |
|||
timeCreated: 1493224766 |
|||
timeCreated: 1493135841 |
|||
licenseType: Pro |
|||
DefaultImporter: |
|||
userData: |
|
|||
fileFormatVersion: 2 |
|||
guid: 1816611d7c1a9bc41bbe1ae56076f699 |
|||
timeCreated: 1493136714 |
|||
licenseType: Pro |
|||
DefaultImporter: |
|||
userData: |
|||
assetBundleName: |
|||
assetBundleVariant: |
|
|||
using System.Collections; |
|||
using System.Collections.Generic; |
|||
using System.Linq; |
|||
using UnityEngine; |
|||
using Object = UnityEngine.Object; |
|||
|
|||
public class Mover : MonoBehaviour { |
|||
|
|||
|
|||
Transform[] m_Transforms; |
|||
float m_Phase0; |
|||
private bool m_Pause = false; |
|||
|
|||
// Use this for initialization
|
|||
void Start () |
|||
{ |
|||
m_Transforms = (Object.FindObjectsOfType(typeof(GameObject)) as GameObject[]).Where(o => o.name.Contains("Cube") || o.name.Contains("Capsule") || o.name.Contains("Cylinder") || o.name.Contains("Sphere")).Select(g=>g.transform).ToArray(); |
|||
} |
|||
|
|||
// Update is called once per frame
|
|||
void Update () |
|||
{ |
|||
if ( !m_Pause ) |
|||
{ |
|||
float innerPhase = m_Phase0; |
|||
foreach (Transform t in m_Transforms) |
|||
{ |
|||
float yd = 2.0f * Mathf.Sin(innerPhase); |
|||
t.localPosition = new Vector3(t.localPosition.x, Mathf.Abs(yd), t.localPosition.z); |
|||
innerPhase += 0.01f; |
|||
} |
|||
m_Phase0 += Time.deltaTime * 2.0f; |
|||
} |
|||
} |
|||
|
|||
void OnGUI() |
|||
{ |
|||
m_Pause = GUI.Toggle(new Rect(10, 10, 200, 20), m_Pause, "Pause"); |
|||
} |
|||
|
|||
} |
|
|||
fileFormatVersion: 2 |
|||
guid: 107ec621874e21b40905bbc627cccb7d |
|||
timeCreated: 1493207732 |
|||
licenseType: Pro |
|||
MonoImporter: |
|||
serializedVersion: 2 |
|||
defaultReferences: [] |
|||
executionOrder: 0 |
|||
icon: {instanceID: 0} |
|||
userData: |
|||
assetBundleName: |
|||
assetBundleVariant: |
部分文件因为文件数量过多而无法显示
撰写
预览
正在加载...
取消
保存
Reference in new issue