パーツ
Inheritance: UnityEngine.UI.Graphic
Exemplo n.º 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();
            }
        }
 /// <summary>
 /// レンダラ追加
 /// </summary>
 /// <param name="renderer"></param>
 public void AddSprite( SpritePartRenderer renderer )
 {
     renderer.transform.SetParent( SpriteHolder );
     renderers_.Add( renderer );
 }
Exemplo n.º 4
0
 /// <summary>
 /// レンダラ追加
 /// </summary>
 /// <param name="renderer"></param>
 public void AddSprite(SpritePartRenderer renderer)
 {
     renderer.transform.SetParent(SpriteHolder);
     renderers_.Add(renderer);
 }