Beispiel #1
0
 private void CheckNullGobj()
 {
     if (null == mTLPlayer)
     {
         GameObject go = GameObject.Find("ATimelinePlayer");
         if (go != null)
         {
             mTLPlayer = go.GetComponent <ATimelineProcesser>();
         }
         else
         {
             go        = new GameObject("ATimelinePlayer");
             mTLPlayer = go.AddComponent <ATimelineProcesser>();
         }
     }
     if (null == mData)
     {
         mData = mTLPlayer.m_TimelineData;
         if (!mData)
         {
             mData      = ScriptableObject.CreateInstance <ATimeLine>();
             mData.name = "A New Timeline";
             AssetDatabase.CreateAsset(mData, AssetPaths.TEMP_TL_ASSET_PATH);
             mTLPlayer.m_TimelineData = mData;
         }
         if (!string.IsNullOrEmpty(mData.name))
         {
             mCurrentTLAssetName = mData.name;
         }
     }
 }
Beispiel #2
0
        private void OnEnable()
        {
            //titile
            this.titleContent = new GUIContent("TL Editor");
            InitAssets();

            mCurrentTLAssetName = string.Empty;
            GameObject go = GameObject.Find("ATimelinePlayer");

            if (go != null)
            {
                mTLPlayer = go.GetComponent <ATimelineProcesser>();
                if (mTLPlayer)
                {
                    mData = mTLPlayer.m_TimelineData;
                    if (mData)
                    {
                        if (!string.IsNullOrEmpty(mData.name))
                        {
                            mCurrentTLAssetName = mData.name;
                        }
                    }
                }
            }
            buildAddTrackMenu();
        }