コード例 #1
0
    // Start is called just before any of the Update methods is called the first time
    public void Start()
    {
        if (!m_engine)
        {
            m_engine = GetComponent <Abstract2DPlatformEngine> ();
#if UNITY_EDITOR
            if (!m_engine)
            {
                Debug.LogError(NoMovementEngineError);
            }
#endif
        }
        if (!m_anim)
        {
            m_anim = GetComponent <Animator> ();
#if UNITY_EDITOR
            if (!m_anim)
            {
                Debug.LogError(NoAnimatorError);
            }
#endif
        }
        m_health = (int)m_maxHealth;
    }
コード例 #2
0
 // Start is called just before any of the Update methods is called the first time
 public void Start()
 {
     if (!m_engine) {
         m_engine = GetComponent<Abstract2DPlatformEngine> ();
     #if UNITY_EDITOR
         if (!m_engine)
             Debug.LogError (NoMovementEngineError);
     #endif
     }
     if (!m_anim) {
         m_anim = GetComponent<Animator> ();
     #if UNITY_EDITOR
         if (!m_anim)
             Debug.LogError (NoAnimatorError);
     #endif
     }
     m_health = (int) m_maxHealth;
 }