상속: UnityEngine.MonoBehaviour
예제 #1
0
        /// <summary>
        /// 初期化
        /// </summary>
        /// <param name="root"></param>
        /// <param name="material"></param>
        public void Setup(SpriteRoot root, types.NodeType nodeType, Material material)
        {
            root_ = root;
            root.AddPart(this);

            isNull_ = nodeType == types.NodeType.kNull;
            if (!isNull_)
            {
                // NULLノードでなければレンダラ生成
                var r = new GameObject(name, typeof(SpritePartRenderer));
                renderer_          = r.GetComponent <SpritePartRenderer>();
                renderer_.material = material;
                root.AddSprite(renderer_);
                renderer_.Setup(this);
                SetupVertices();
            }

            keyFrames_ = new KeyFrame[root_.TotalFrames];
            for (int i = 0; i < root_.TotalFrames; ++i)
            {
                keyFrames_[i] = KeyFrame.Create();
            }
        }
        /// <summary>
        /// 初期化
        /// </summary>
        /// <param name="root"></param>
        /// <param name="material"></param>
        public void Setup( SpriteRoot root, types.NodeType nodeType, Material material )
        {
            root_ = root;
            root.AddPart( this );

            isNull_ = nodeType == types.NodeType.kNull;
            if ( !isNull_ ) {
                // NULLノードでなければレンダラ生成
                var r = new GameObject( name, typeof( SpritePartRenderer ) );
                renderer_ = r.GetComponent<SpritePartRenderer>();
                renderer_.material = material;
                root.AddSprite( renderer_ );
                renderer_.Setup( this );
                SetupVertices();
            }

            keyFrames_ = new KeyFrame[root_.TotalFrames];
            for ( int i = 0; i < root_.TotalFrames; ++i ) {
                keyFrames_[i] = KeyFrame.Create();
            }
        }