exSprite.Awake C# (CSharp) Method

Awake() protected method

protected Awake ( ) : void
return void
    protected new void Awake()
    {
        // DISABLE {
        // #if UNITY_EDITOR
        //         if ( EditorApplication.isPlaying == false &&
        //              string.IsNullOrEmpty(textureGUID) == false &&
        //              exAtlasDBBasic.Initialized() )
        //         {
        //             exAtlasDBBasic.ElementInfo elInfo = exAtlasDBBasic.GetElementInfoNoInit ( textureGUID );
        //             string path = AssetDatabase.GetAssetPath(atlas_);
        //             string guid = AssetDatabase.AssetPathToGUID(path);

        //             //
        //             if ( elInfo != null ) {
        //                 if ( elInfo.indexInAtlas != index_ || elInfo.guidAtlas != guid ) {
        //                     path = AssetDatabase.GUIDToAssetPath(elInfo.guidAtlas);
        //                     SetSprite( (exAtlas)AssetDatabase.LoadAssetAtPath( path, typeof(exAtlas) ),
        //                                elInfo.indexInAtlas );
        //                     Build(null);
        //                 }
        //             }
        //             else {
        //                 Clear();
        //                 path = AssetDatabase.GUIDToAssetPath(textureGUID);
        //                 Texture2D texture = (Texture2D)AssetDatabase.LoadAssetAtPath( path, typeof(Texture2D) );
        //                 Build(texture);
        //             }
        //         }
        // #endif
        // } DISABLE end

        base.Awake();
        spanim = GetComponent<exSpriteAnimation>();

        if ( atlas_ != null ||
             ( renderer.sharedMaterial && renderer.sharedMaterial.mainTexture != null ) )
        {
            if ( meshFilter ) {
                // create mesh ( in editor, this can duplicate mesh to prevent shared mesh for sprite)
                meshFilter_.mesh = new Mesh();
                meshFilter_.sharedMesh.hideFlags = HideFlags.DontSave;
                ForceUpdateMesh( meshFilter_.sharedMesh );

                // check if update mesh collider
                MeshCollider meshCollider = collider as MeshCollider;
                if ( meshCollider && meshCollider.sharedMesh == null ) {
                    this.UpdateColliderSize(0.2f);
                }
            }
        }
    }