浏览代码

Creating actions for the mesh methods.

/4.0
Todd Stinson 4 年前
当前提交
7437ac3f
共有 1 个文件被更改,包括 32 次插入4 次删除
  1. 36
      Assets/Scenes/Meshing/Scripts/MeshClassificationFracking.cs

36
Assets/Scenes/Meshing/Scripts/MeshClassificationFracking.cs


using System;
using System.Collections.Generic;
using Unity.Collections;
using UnityEngine;

/// </summary>
public MeshFilter m_DoorMeshPrefab;
#if UNITY_IOS && !UNITY_EDITOR
/// </summary>
#if UNITY_IOS && !UNITY_EDITOR
/// <summary>
/// The delegate to call to breakup a mesh.
/// </summary>
Action<MeshFilter> m_BreakupMeshAction;
/// <summary>
/// The delegate to call to update a mesh.
/// </summary>
Action<MeshFilter> m_UpdateMeshAction;
/// <summary>
/// The delegate to call to remove a mesh.
/// </summary>
Action<MeshFilter> m_RemoveMeshAction;
/// <summary>
/// On awake, set up the mesh filter delegates.
/// </summary>
void Awake()
{
m_BreakupMeshAction = new Action<MeshFilter>(BreakupMesh);
m_UpdateMeshAction = new Action<MeshFilter>(UpdateMesh);
m_RemoveMeshAction = new Action<MeshFilter>(RemoveMesh);
}
/// <summary>
/// On enable, subscribe to the meshes changed event.
/// </summary>

{
if (args.added != null)
{
args.added.ForEach(meshFilter => BreakupMesh(meshFilter));
args.added.ForEach(m_BreakupMeshAction);
args.updated.ForEach(meshFilter => UpdateMesh(meshFilter));
args.updated.ForEach(m_UpdateMeshAction);
args.removed.ForEach(meshFilter => RemoveMesh(meshFilter));
args.removed.ForEach(m_RemoveMeshAction);
}
}

正在加载...
取消
保存