2017-10-11 12 views
0

현재 Unity에서 2D 플랫폼을 만들고 있는데이 코드에있는 오류로 인해 캐릭터를 이동할 수 없습니다. 어셈블리 참조를 찾는 방법을 잘 모르겠습니다. 누군가가 설명해 주시면 좋을 것입니다. 여기 어셈블리 참조는 어떻게 찾을 수 있습니까?

오류의 오류 CS0234 네임 스페이스 'UnityEditor.Build'존재하지 않는 'IActiveBuildTargetChanged'형식 또는 네임 스페이스 이름 (? 당신이 어셈블리 참조가 누락)

감사

using System; 
    using UnityEngine; 
    #if UNITY_EDITOR 
using UnityEditor; 
#endif 

namespace UnityStandardAssets.Utility 
{ 
#if UNITY_EDITOR 

    [ExecuteInEditMode] 
#endif 
    public class PlatformSpecificContent : MonoBehaviour 
#if UNITY_EDITOR 
     , UnityEditor.Build.IActiveBuildTargetChanged 
#endif 
    { 
     private enum BuildTargetGroup 
     { 
      Standalone, 
      Mobile 
     } 

     [SerializeField] 
     private BuildTargetGroup m_BuildTargetGroup; 
     [SerializeField] 
     private GameObject[] m_Content = new GameObject[0]; 
     [SerializeField] 
     private MonoBehaviour[] m_MonoBehaviours = new MonoBehaviour[0]; 
     [SerializeField] 
     private bool m_ChildrenOfThisObject; 

#if !UNITY_EDITOR 
    void OnEnable() 
    { 
     CheckEnableContent(); 
    } 
#else 
     public int callbackOrder 
     { 
      get 
      { 
       return 1; 
      } 
     } 
#endif 

#if UNITY_EDITOR 

     private void OnEnable() 
     { 
      EditorApplication.update += Update; 
     } 


     private void OnDisable() 
     { 
      EditorApplication.update -= Update; 
     } 

     public void OnActiveBuildTargetChanged(BuildTarget previousTarget, BuildTarget newTarget) 
     { 
      CheckEnableContent(); 
     } 

     private void Update() 
     { 
      CheckEnableContent(); 
     } 
#endif 


     private void CheckEnableContent() 
     { 
#if (UNITY_IPHONE || UNITY_ANDROID || UNITY_WP8 || UNITY_TIZEN || UNITY_STV) 
     if (m_BuildTargetGroup == BuildTargetGroup.Mobile) 
     { 
      EnableContent(true); 
     } else { 
      EnableContent(false); 
     } 
#endif 

#if !(UNITY_IPHONE || UNITY_ANDROID || UNITY_WP8 || UNITY_TIZEN || UNITY_STV) 
      if (m_BuildTargetGroup == BuildTargetGroup.Mobile) 
      { 
       EnableContent(false); 
      } 
      else 
      { 
       EnableContent(true); 
      } 
#endif 
     } 


     private void EnableContent(bool enabled) 
     { 
      if (m_Content.Length > 0) 
      { 
       foreach (var g in m_Content) 
       { 
        if (g != null) 
        { 
         g.SetActive(enabled); 
        } 
       } 
      } 
      if (m_ChildrenOfThisObject) 
      { 
       foreach (Transform t in transform) 
       { 
        t.gameObject.SetActive(enabled); 
       } 
      } 
      if (m_MonoBehaviours.Length > 0) 
      { 
       foreach (var monoBehaviour in m_MonoBehaviours) 
       { 
        monoBehaviour.enabled = enabled; 
       } 
      } 
     } 
    } 
} 

답변

1

Google을 사용하십시오.

IActiveBuildTargetChanged을 인터넷 검색을하는 것은 우리에게이 인터페이스 버전 2017.1로 시작 UnityEditor.Build에 말한다 first result을 제공합니다.

필요한 경우 해당 어셈블리를 포함하고 필요한 경우 using 문을 파일 맨 위에 추가하십시오.

이 어셈블리를 이미 참조한 경우 버전을 확인하십시오. 이전 버전의 어셈블리를 사용 중일 수 있습니다.