Arnaud Carre
8 年前
当前提交
e81123d0
共有 10 个文件被更改,包括 255 次插入 和 8 次删除
-
51Assets/BasicRenderBatching/BasicBatching.unity
-
42ProjectSettings/ProjectSettings.asset
-
9Assets/BasicRenderBatching/Prefabs.meta
-
9Assets/BasicRenderBatching/Scripts.meta
-
82Assets/BasicRenderBatching/Prefabs/Capsule.prefab
-
8Assets/BasicRenderBatching/Prefabs/Capsule.prefab.meta
-
50Assets/BasicRenderBatching/Scripts/PopulateScene.cs
-
12Assets/BasicRenderBatching/Scripts/PopulateScene.cs.meta
|
|||
fileFormatVersion: 2 |
|||
guid: 1bc64cc5d7e1dc84793a00cf950d5dbd |
|||
folderAsset: yes |
|||
timeCreated: 1481128088 |
|||
licenseType: Pro |
|||
DefaultImporter: |
|||
userData: |
|||
assetBundleName: |
|||
assetBundleVariant: |
|
|||
fileFormatVersion: 2 |
|||
guid: 97a08e566e8f5c14c80ceecb48f9d409 |
|||
folderAsset: yes |
|||
timeCreated: 1481128135 |
|||
licenseType: Pro |
|||
DefaultImporter: |
|||
userData: |
|||
assetBundleName: |
|||
assetBundleVariant: |
|
|||
%YAML 1.1 |
|||
%TAG !u! tag:unity3d.com,2011: |
|||
--- !u!1001 &100100000 |
|||
Prefab: |
|||
m_ObjectHideFlags: 1 |
|||
serializedVersion: 2 |
|||
m_Modification: |
|||
m_TransformParent: {fileID: 0} |
|||
m_Modifications: [] |
|||
m_RemovedComponents: [] |
|||
m_ParentPrefab: {fileID: 0} |
|||
m_RootGameObject: {fileID: 1877103646185790} |
|||
m_IsPrefabParent: 1 |
|||
--- !u!1 &1877103646185790 |
|||
GameObject: |
|||
m_ObjectHideFlags: 0 |
|||
m_PrefabParentObject: {fileID: 0} |
|||
m_PrefabInternal: {fileID: 100100000} |
|||
serializedVersion: 5 |
|||
m_Component: |
|||
- component: {fileID: 4091326064044868} |
|||
- component: {fileID: 33444527381260124} |
|||
- component: {fileID: 23341644023392824} |
|||
m_Layer: 0 |
|||
m_Name: Capsule |
|||
m_TagString: Untagged |
|||
m_Icon: {fileID: 0} |
|||
m_NavMeshLayer: 0 |
|||
m_StaticEditorFlags: 0 |
|||
m_IsActive: 1 |
|||
--- !u!4 &4091326064044868 |
|||
Transform: |
|||
m_ObjectHideFlags: 1 |
|||
m_PrefabParentObject: {fileID: 0} |
|||
m_PrefabInternal: {fileID: 100100000} |
|||
m_GameObject: {fileID: 1877103646185790} |
|||
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} |
|||
m_LocalPosition: {x: -2.0520718, y: 0.3634019, z: 1.7976766} |
|||
m_LocalScale: {x: 1, y: 1, z: 1} |
|||
m_Children: [] |
|||
m_Father: {fileID: 0} |
|||
m_RootOrder: 0 |
|||
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} |
|||
--- !u!23 &23341644023392824 |
|||
MeshRenderer: |
|||
m_ObjectHideFlags: 1 |
|||
m_PrefabParentObject: {fileID: 0} |
|||
m_PrefabInternal: {fileID: 100100000} |
|||
m_GameObject: {fileID: 1877103646185790} |
|||
m_Enabled: 1 |
|||
m_CastShadows: 0 |
|||
m_ReceiveShadows: 0 |
|||
m_MotionVectors: 1 |
|||
m_LightProbeUsage: 0 |
|||
m_ReflectionProbeUsage: 0 |
|||
m_Materials: |
|||
- {fileID: 2100000, guid: de48705454e39554fb09f6cd7f8e9cdf, type: 2} |
|||
m_StaticBatchInfo: |
|||
firstSubMesh: 0 |
|||
subMeshCount: 0 |
|||
m_StaticBatchRoot: {fileID: 0} |
|||
m_ProbeAnchor: {fileID: 0} |
|||
m_LightProbeVolumeOverride: {fileID: 0} |
|||
m_ScaleInLightmap: 1 |
|||
m_PreserveUVs: 1 |
|||
m_IgnoreNormalsForChartDetection: 0 |
|||
m_ImportantGI: 0 |
|||
m_SelectedEditorRenderState: 3 |
|||
m_MinimumChartSize: 4 |
|||
m_AutoUVMaxDistance: 0.5 |
|||
m_AutoUVMaxAngle: 89 |
|||
m_LightmapParameters: {fileID: 0} |
|||
m_SortingLayerID: 0 |
|||
m_SortingLayer: 0 |
|||
m_SortingOrder: 0 |
|||
--- !u!33 &33444527381260124 |
|||
MeshFilter: |
|||
m_ObjectHideFlags: 1 |
|||
m_PrefabParentObject: {fileID: 0} |
|||
m_PrefabInternal: {fileID: 100100000} |
|||
m_GameObject: {fileID: 1877103646185790} |
|||
m_Mesh: {fileID: 10208, guid: 0000000000000000e000000000000000, type: 0} |
|
|||
fileFormatVersion: 2 |
|||
guid: b764b667902787f459cc591ec15679db |
|||
timeCreated: 1481128093 |
|||
licenseType: Pro |
|||
NativeFormatImporter: |
|||
userData: |
|||
assetBundleName: |
|||
assetBundleVariant: |
|
|||
using System.Collections; |
|||
using System.Collections.Generic; |
|||
using UnityEngine; |
|||
|
|||
public class PopulateScene : MonoBehaviour { |
|||
|
|||
|
|||
public GameObject m_ObjectPrefab; //
|
|||
public Transform m_CenterPoint; |
|||
public int m_GridWidth = 16; |
|||
public float m_Spacing = 0.6f; |
|||
|
|||
|
|||
private GameObject[] m_Objects; //
|
|||
|
|||
// Use this for initialization
|
|||
void Start() |
|||
{ |
|||
|
|||
|
|||
m_Objects = new GameObject[m_GridWidth * m_GridWidth]; |
|||
|
|||
int iIndex = 0; |
|||
for (int z = 0; z < m_GridWidth; z++) |
|||
{ |
|||
for (int x = 0; x < m_GridWidth; x++) |
|||
{ |
|||
// int i = z * m_CubesRow + x;
|
|||
|
|||
float fX = (x - (m_GridWidth / 2)) * 2; |
|||
float fY = 0.0f; |
|||
float fZ = (z - (m_GridWidth / 2)) * 2; |
|||
|
|||
Vector3 vPos = new Vector3(fX * m_Spacing, fY, fZ * m_Spacing); |
|||
vPos += m_CenterPoint.position; |
|||
|
|||
m_Objects[iIndex] = Instantiate(m_ObjectPrefab, vPos, m_CenterPoint.rotation) as GameObject; |
|||
iIndex++; |
|||
|
|||
} |
|||
} |
|||
} |
|||
|
|||
// Update is called once per frame
|
|||
void Update () |
|||
{ |
|||
|
|||
} |
|||
|
|||
} |
|
|||
fileFormatVersion: 2 |
|||
guid: 9dcd15e6e67bc6e44a4583f4d53cdcf8 |
|||
timeCreated: 1481128119 |
|||
licenseType: Pro |
|||
MonoImporter: |
|||
serializedVersion: 2 |
|||
defaultReferences: [] |
|||
executionOrder: 0 |
|||
icon: {instanceID: 0} |
|||
userData: |
|||
assetBundleName: |
|||
assetBundleVariant: |
撰写
预览
正在加载...
取消
保存
Reference in new issue