浏览代码

removed model swap as it has been fully replaced

/main
CGerrits SF 4 年前
当前提交
b2817aec
共有 2 个文件被更改,包括 0 次插入56 次删除
  1. 11
      Assets/BossRoom/Scripts/Client/Game/Character/ModelSwap.cs.meta
  2. 45
      Assets/BossRoom/Scripts/Client/Game/Character/ModelSwap.cs

11
Assets/BossRoom/Scripts/Client/Game/Character/ModelSwap.cs.meta


fileFormatVersion: 2
guid: b39799f0927e785428be8e47072883b2
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

45
Assets/BossRoom/Scripts/Client/Game/Character/ModelSwap.cs


using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.UI;
namespace BossRoom.Viz
{
public class ModelSwap : MonoBehaviour
{
//!! DEBUG SCRIPT!
public GameObject[] modelArray;
public int m_ModelIndex = 0;
//debug; used for changing assets at runtime.
private int m_lastModelIndex = 0;
// Use this for initialization
void Start()
{
SetModel(m_ModelIndex);
}
public void SetModel(int index)
{
index = System.Math.Min(index, modelArray.Length - 1);
m_ModelIndex = index;
for (int x = 0; x < modelArray.Length; x++)
{
modelArray[x].SetActive(x == m_ModelIndex);
}
}
// Update is called once per frame
public void Update()
{
//DEBUG: This allows you to change models at runtime by tweaking the ModelIndex in the editor.
if( m_lastModelIndex != m_ModelIndex )
{
m_lastModelIndex = m_ModelIndex;
SetModel(m_ModelIndex);
}
}
}
}
正在加载...
取消
保存