浏览代码

tweaks to line up with intended functionality

/main
CGerrits SF 4 年前
当前提交
10777a5f
共有 5 个文件被更改,包括 120 次插入94 次删除
  1. 4
      Assets/BossRoom/Prefabs/Player.prefab
  2. 28
      Assets/BossRoom/Scenes/DungeonTest.unity
  3. 88
      Assets/BossRoom/Scripts/Client/Game/Character/CharacterSwap.cs
  4. 94
      Assets/BossRoom/Scripts/Development/dgtest/CharacterSwap.cs
  5. 0
      /Assets/BossRoom/Scripts/Client/Game/Character/CharacterSwap.cs.meta

4
Assets/BossRoom/Prefabs/Player.prefab


propertyPath: modelIndex
value: 0
objectReference: {fileID: 0}
- target: {fileID: 4654558647929214568, guid: d396ab139e993ee43b2eb29978bba8ff, type: 3}
propertyPath: m_ModelIndex
value: 0
objectReference: {fileID: 0}
- target: {fileID: 7943089997373843793, guid: d396ab139e993ee43b2eb29978bba8ff, type: 3}
propertyPath: m_Enabled
value: 1

28
Assets/BossRoom/Scenes/DungeonTest.unity


propertyPath: modelIndex
value: 7
objectReference: {fileID: 0}
- target: {fileID: 4654558647929214568, guid: d396ab139e993ee43b2eb29978bba8ff, type: 3}
propertyPath: m_ModelIndex
value: 7
objectReference: {fileID: 0}
- target: {fileID: 4659130856917116551, guid: d396ab139e993ee43b2eb29978bba8ff, type: 3}
propertyPath: m_Mesh
value:

propertyPath: modelIndex
value: 5
objectReference: {fileID: 0}
- target: {fileID: 4654558647929214568, guid: d396ab139e993ee43b2eb29978bba8ff, type: 3}
propertyPath: m_ModelIndex
value: 5
objectReference: {fileID: 0}
- target: {fileID: 4659130856917116551, guid: d396ab139e993ee43b2eb29978bba8ff, type: 3}
propertyPath: m_Mesh
value:

propertyPath: modelIndex
value: 1
objectReference: {fileID: 0}
- target: {fileID: 4654558647929214568, guid: d396ab139e993ee43b2eb29978bba8ff, type: 3}
propertyPath: m_ModelIndex
value: 1
objectReference: {fileID: 0}
- target: {fileID: 4659130856917116551, guid: d396ab139e993ee43b2eb29978bba8ff, type: 3}
propertyPath: m_Mesh
value:

propertyPath: modelIndex
value: 6
objectReference: {fileID: 0}
- target: {fileID: 4654558647929214568, guid: d396ab139e993ee43b2eb29978bba8ff, type: 3}
propertyPath: m_ModelIndex
value: 6
objectReference: {fileID: 0}
- target: {fileID: 4659130856917116551, guid: d396ab139e993ee43b2eb29978bba8ff, type: 3}
propertyPath: m_Mesh
value:

objectReference: {fileID: 0}
- target: {fileID: 4654558647929214568, guid: d396ab139e993ee43b2eb29978bba8ff, type: 3}
propertyPath: modelIndex
value: 3
objectReference: {fileID: 0}
- target: {fileID: 4654558647929214568, guid: d396ab139e993ee43b2eb29978bba8ff, type: 3}
propertyPath: m_ModelIndex
value: 3
objectReference: {fileID: 0}
- target: {fileID: 4659130856917116551, guid: d396ab139e993ee43b2eb29978bba8ff, type: 3}

objectReference: {fileID: 0}
- target: {fileID: 4654558647929214568, guid: d396ab139e993ee43b2eb29978bba8ff, type: 3}
propertyPath: modelIndex
value: 4
objectReference: {fileID: 0}
- target: {fileID: 4654558647929214568, guid: d396ab139e993ee43b2eb29978bba8ff, type: 3}
propertyPath: m_ModelIndex
value: 4
objectReference: {fileID: 0}
- target: {fileID: 4659130856917116551, guid: d396ab139e993ee43b2eb29978bba8ff, type: 3}

objectReference: {fileID: 0}
- target: {fileID: 4654558647929214568, guid: d396ab139e993ee43b2eb29978bba8ff, type: 3}
propertyPath: modelIndex
value: 2
objectReference: {fileID: 0}
- target: {fileID: 4654558647929214568, guid: d396ab139e993ee43b2eb29978bba8ff, type: 3}
propertyPath: m_ModelIndex
value: 2
objectReference: {fileID: 0}
- target: {fileID: 4659130856917116551, guid: d396ab139e993ee43b2eb29978bba8ff, type: 3}

88
Assets/BossRoom/Scripts/Client/Game/Character/CharacterSwap.cs


using System.Collections;
using System.Collections.Generic;
using System.Reflection;
using UnityEngine;
namespace BossRoom.Client
{
//DEBUG SCRIPT: Meant to serve as a placeholder to allow artists to quickly cycle through player models.
public class CharacterSwap : MonoBehaviour
{
[System.SerializableAttribute]
public class CharacterModelSet
{
public GameObject ears;
public GameObject head;
public GameObject mouth;
public GameObject hair;
public GameObject eyes;
public GameObject torso;
public GameObject gear_right_hand;
public GameObject gear_left_hand;
public GameObject hand_right;
public GameObject hand_left;
public GameObject shoulder_right;
public GameObject shoulder_left;
public void setFullActive(bool isActive)
{
ears.SetActive(isActive);
head.SetActive(isActive);
mouth.SetActive(isActive);
hair.SetActive(isActive);
eyes.SetActive(isActive);
torso.SetActive(isActive);
gear_left_hand.SetActive(isActive);
hand_right.SetActive(isActive);
hand_left.SetActive(isActive);
shoulder_right.SetActive(isActive);
shoulder_left.SetActive(isActive);
gear_left_hand.SetActive(isActive);
gear_right_hand.SetActive(isActive);
}
}
[SerializeField]
int m_ModelIndex;
int m_lastModelIndex;
public CharacterModelSet[] characterModels;
void Awake()
{
if (m_ModelIndex >= characterModels.Length)
{
m_ModelIndex = 0;
}
SwapToModel(m_ModelIndex);
}
public void SwapToModel(int idx)
{
if (idx >= characterModels.Length)
{
print("Index out of bounds");
return;
}
for (int x = 0; x < characterModels.Length; x++)
{
characterModels[x].setFullActive(x == idx);
}
}
// Update is called once per frame
void Update()
{
if (m_lastModelIndex != m_ModelIndex)
{
m_lastModelIndex = m_ModelIndex;
SwapToModel(m_ModelIndex);
}
}
}
}

94
Assets/BossRoom/Scripts/Development/dgtest/CharacterSwap.cs


using System.Collections;
using System.Collections.Generic;
using System.Reflection;
using UnityEngine;
namespace BossRoom.Client
{
//DEBUG SCRIPT: Meant to serve as a placeholder to allow artists to quickly cycle through player models.
public class CharacterSwap : MonoBehaviour
{
[System.SerializableAttribute]
public class CharacterModelSet
{
public GameObject ears;
public GameObject head;
public GameObject mouth;
public GameObject hair;
public GameObject eyes;
public GameObject torso;
public GameObject gear_right_hand;
public GameObject gear_left_hand;
public GameObject hand_right;
public GameObject hand_left;
public GameObject shoulder_right;
public GameObject shoulder_left;
public void setFullActive(bool isActive)
{
ears.SetActive(isActive);
head.SetActive(isActive);
mouth.SetActive(isActive);
hair.SetActive(isActive);
eyes.SetActive(isActive);
torso.SetActive(isActive);
gear_left_hand.SetActive(isActive);
hand_right.SetActive(isActive);
hand_left.SetActive(isActive);
shoulder_right.SetActive(isActive);
shoulder_left.SetActive(isActive);
gear_left_hand.SetActive(isActive);
gear_right_hand.SetActive(isActive);
}
}
[SerializeField]
KeyCode hotswapKey;
[SerializeField]
public int modelIndex;
public CharacterModelSet[] characterModels;
void Awake()
{
if (modelIndex >= characterModels.Length)
{
modelIndex = 0;
}
swapToModel(modelIndex);
}
void cycleModel()
{
if (modelIndex == characterModels.Length - 1)
{
modelIndex = 0;
}
else
{
modelIndex += 1;
}
swapToModel(modelIndex);
}
public void swapToModel(int idx)
{
for (int x = 0; x < characterModels.Length; x++)
{
characterModels[x].setFullActive(x == idx);
}
}
// Update is called once per frame
void Update()
{
if (Input.GetKeyDown(hotswapKey))
{
cycleModel();
}
}
}
}

/Assets/BossRoom/Scripts/Development/dgtest/CharacterSwap.cs.meta → /Assets/BossRoom/Scripts/Client/Game/Character/CharacterSwap.cs.meta

正在加载...
取消
保存