Наследование: MonoBehaviour
Пример #1
0
    ///////////////////////////////////////////////////////////////////////////////
    // functions
    ///////////////////////////////////////////////////////////////////////////////

    // ------------------------------------------------------------------
    /// Awake functoin inherit from MonoBehaviour.
    ///
    /// \note if you inherit from exPlane, and implement your own Awake function,
    /// you need to override this and call base.Awake() in your Awake block.
    // ------------------------------------------------------------------

    virtual protected void Awake()
    {
        //
        if (camera_ == null)
        {
            camera_ = Camera.main;
        }

        //
        if (camera_ != null)
        {
            spriteMng_ = camera_.GetComponent <exSpriteMng>();
            if (spriteMng_ == null)
            {
                spriteMng_ = camera_.gameObject.AddComponent <exSpriteMng>();
            }
        }

        //
        meshFilter_ = GetComponent <MeshFilter>();

        //
        collisionHelper_ = GetComponent <exCollisionHelper>();
        if (collisionHelper_)
        {
            collisionHelper_.plane = this;
        }
    }
Пример #2
0
    ///////////////////////////////////////////////////////////////////////////////
    // functions
    ///////////////////////////////////////////////////////////////////////////////

    // ------------------------------------------------------------------
    /// Awake functoin inherit from MonoBehaviour.
    ///
    /// \note if you inherit from exPlane, and implement your own Awake function,
    /// you need to override this and call base.Awake() in your Awake block.
    // ------------------------------------------------------------------

    protected void Awake()
    {
        //
        if (camera_ == null)
        {
            camera_ = Camera.main;
        }

        //
        if (camera_ != null)
        {
            spriteMng_ = camera_.GetComponent <exSpriteMng>();
            if (spriteMng_ == null)
            {
                spriteMng_ = camera_.gameObject.AddComponent <exSpriteMng>();
            }
        }

        //
        meshFilter_ = GetComponent <MeshFilter>();

        //
        collisionHelper_ = GetComponent <exCollisionHelper>();
        if (collisionHelper_)
        {
            collisionHelper_.plane = this;
        }

        // DISABLE: no reason to do this {
        // if ( clippingPlane )
        //     clippingPlane.AddPlane(this);
        // } DISABLE end
    }
Пример #3
0
    ///////////////////////////////////////////////////////////////////////////////
    // functions
    ///////////////////////////////////////////////////////////////////////////////

    // ------------------------------------------------------------------ 
    /// Awake functoin inherit from MonoBehaviour.
    /// 
    /// \note if you inherit from exPlane, and implement your own Awake function, 
    /// you need to override this and call base.Awake() in your Awake block.
    // ------------------------------------------------------------------ 

    protected void Awake () {
        //
        if ( camera_ == null )
            camera_ = Camera.main;

        //
        if ( camera_ != null ) {
            spriteMng_ = camera_.GetComponent<exSpriteMng>();
            if ( spriteMng_ == null )
                spriteMng_ = camera_.gameObject.AddComponent<exSpriteMng>();
        }

        //
        meshFilter_ = GetComponent<MeshFilter>();

        //
        collisionHelper_ = GetComponent<exCollisionHelper>();
        if ( collisionHelper_ )
            collisionHelper_.plane = this;
    }
Пример #4
0
    ///////////////////////////////////////////////////////////////////////////////
    // functions
    ///////////////////////////////////////////////////////////////////////////////
    // ------------------------------------------------------------------
    /// Awake functoin inherit from MonoBehaviour.
    /// 
    /// \note if you inherit from exPlane, and implement your own Awake function, 
    /// you need to override this and call base.Awake() in your Awake block.
    // ------------------------------------------------------------------
    protected void Awake()
    {
        //
        if ( camera_ == null )
            camera_ = Camera.main;

        //
        if ( camera_ != null ) {
            spriteMng_ = camera_.GetComponent<exSpriteMng>();
            if ( spriteMng_ == null )
                spriteMng_ = camera_.gameObject.AddComponent<exSpriteMng>();
        }

        //
        meshFilter_ = GetComponent<MeshFilter>();

        //
        collisionHelper_ = GetComponent<exCollisionHelper>();
        if ( collisionHelper_ )
            collisionHelper_.plane = this;

        // DISABLE: no reason to do this {
        // if ( clippingPlane )
        //     clippingPlane.AddPlane(this);
        // } DISABLE end
    }