| 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950 |
- using System.Collections;
- using System.Collections.Generic;
- using UnityEngine;
- namespace ShotSimulator.Target
- {
- public enum HumanoidPartType
- {
- Head,
- Body
- }
- public class HumanoidPartShotTarget : BaseShotTarget
- {
- [SerializeField]
- private HumanoidPartType m_HumanoidPartType;
- [SerializeField]
- private HumanoidShotTarget m_HumanoidShotTarget;
- [SerializeField]
- private SkinnedMeshRenderer skinnedMeshRenderer;
- [SerializeField]
- private int partMaterialIndex;
- public HumanoidShotTarget DependTarget
- {
- get { return m_HumanoidShotTarget; }
- }
- public HumanoidPartType PartType
- {
- get { return m_HumanoidPartType; }
- }
- public override void OnClick()
- {
- if (!IsRunning) return;
- base.OnClick();
- m_HumanoidShotTarget.CauseHumanoidPartReduceHP(this);
- }
- public void SetColor(Color color)
- {
- skinnedMeshRenderer.materials[partMaterialIndex].color = color;
- }
- }
- }
|