Advertisement
Guest User

Untitled

a guest
Nov 14th, 2019
123
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.51 KB | None | 0 0
  1. using UnityEngine;
  2.  
  3. public class Machine : MonoBehaviour
  4. {
  5.     [Tooltip("On/Off state of the machine.")]
  6.     [SerializeField] protected bool m_State;
  7.     [SerializeField] protected float m_PowerConsumption;
  8.    
  9.     [SerializeField] Animator[] m_Animators;
  10.  
  11.     void Update()
  12.     {
  13.         ToggleState();
  14.     }
  15.  
  16.     void ToggleState()
  17.     {
  18.         //m_State = !m_State;
  19.         foreach (Animator _anim in m_Animators)
  20.         {
  21.             _anim.SetBool("state", m_State);
  22.         }
  23.     }
  24.  
  25. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement