当前位置: 首页>>代码示例>>C#>>正文


C# OTContainer类代码示例

本文整理汇总了C#中OTContainer的典型用法代码示例。如果您正苦于以下问题:C# OTContainer类的具体用法?C# OTContainer怎么用?C# OTContainer使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


OTContainer类属于命名空间,在下文中一共展示了OTContainer类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: CreateFrameset

    private OTAnimationFrameset CreateFrameset(string name, OTContainer container, int startFrameIndex, int endFrameIndex)
    {
        MZDebug.Log( "Add frameset: " + name );

        OTAnimationFrameset frameset = new OTAnimationFrameset();
        frameset.name = name;
        frameset.container = container;
        frameset.startFrame = startFrameIndex;
        frameset.endFrame = endFrameIndex;

        return frameset;
    }
开发者ID:adahera222,项目名称:MSSTGameProj,代码行数:12,代码来源:MZOTAnimationsManager.cs

示例2: AddAnimations

    private void AddAnimations(OTContainer container)
    {
        if( _spritesheetContainer == null )
            _spritesheetContainer = new Dictionary<string, OTContainer>();

        spritesheetContainer.Add( container.name, container );

        List<OTAnimationFrameset> framesetsList = new List<OTAnimationFrameset>();
        List<string> frameNamesList = new List<string>();

        SetFramesets( ref framesetsList, ref frameNamesList, container );

        if( cloneAniamtion == null )
        {
            cloneAniamtion = MZResources.InstantiateOrthelloSprite( "Animation" );
            ( (OTAnimation)cloneAniamtion.GetComponent( typeof( OTAnimation ) ) ).name = "AnimationsCollection";
        }

        // suck code here, when add new spritesheet, it will re-new again
        OTAnimation animation = (OTAnimation)cloneAniamtion.GetComponent( typeof( OTAnimation ) );
        List<OTAnimationFrameset> newFramesetsList = new List<OTAnimationFrameset>( animation.framesets );
        newFramesetsList.AddRange( framesetsList );
        animation.framesets = newFramesetsList.ToArray();
    }
开发者ID:adahera222,项目名称:MSSTGameProj,代码行数:24,代码来源:MZOTAnimationsManager.cs

示例3: Clean

    protected override void Clean()
    {
        if (!OT.isValid) return;
        base.Clean();

        if (_spriteContainer_ != spriteContainer ||
            _frameIndex_ != frameIndex ||
            _image_ != image ||
            _tintColor_ != tintColor ||
            _alpha_ != alpha ||
            _materialReference_ != _materialReference ||
            isCopy)
        {

            if (spriteContainer != null && spriteContainer.isReady)
            {
                if (frameIndex < 0) _frameIndex = 0;
                if (frameIndex > spriteContainer.frameCount - 1) _frameIndex = spriteContainer.frameCount - 1;
                if (spriteContainer is OTSpriteAtlas)
                {
                    OTContainer.Frame fr = CurrentFrame();
                    if ((spriteContainer as OTSpriteAtlas).offsetSizing)
                    {
                        if (Vector2.Equals(oSize, Vector2.zero))
                        {
                            oSize = fr.size * OT.view.sizeFactor;
                            Vector2 nOffset = fr.offset * OT.view.sizeFactor;
                            if (_baseOffset.x != nOffset.x || _baseOffset.y != nOffset.y)
                            {
                                offset = nOffset;
                                position = _position;
                                imageSize = fr.imageSize * OT.view.sizeFactor;
                            }
                        }
                        if (_frameIndex_ != frameIndex || _spriteContainer_ != spriteContainer)
                        {
                            Vector2 sc = new Vector2((size.x / oSize.x) * fr.size.x * OT.view.sizeFactor, (size.y / oSize.y) * fr.size.y * OT.view.sizeFactor);
                            Vector3 sc3 = new Vector3(sc.x, sc.y, 1);

                            _size = sc;
                            if (!Vector3.Equals(transform.localScale, sc3))
                               transform.localScale = sc3;
                            oSize = fr.size * OT.view.sizeFactor;
                            imageSize = fr.imageSize * OT.view.sizeFactor;
                            Vector2 nOffset = fr.offset * OT.view.sizeFactor;
                            if (_baseOffset.x != nOffset.x || _baseOffset.y != nOffset.y)
                            {
                                offset = nOffset;
                                position = _position;
                            }
                        }
                    }
                    else
                    {
                        Vector3[] verts = fr.vertices.Clone() as Vector3[];
                        verts[0] -= new Vector3(pivotPoint.x, pivotPoint.y, 0);
                        verts[1] -= new Vector3(pivotPoint.x, pivotPoint.y, 0);
                        verts[2] -= new Vector3(pivotPoint.x, pivotPoint.y, 0);
                        verts[3] -= new Vector3(pivotPoint.x, pivotPoint.y, 0);
                        mesh.vertices = verts;

                        _size = fr.size;
                        Vector3 sc3 = new Vector3(_size.x, _size.y, 1);
                        if (!Vector3.Equals(transform.localScale, sc3))
                            transform.localScale = sc3;
                    }
                }
            }

            Material mat = LookupMaterial();
            if (mat == null)
            {
                mat = InitMaterial();
            }
            else
            {
                renderer.material = mat;
                HandleUV(mat);
            }
            OT.MatInc(mat);

            _spriteContainer_ = spriteContainer;
            _materialReference_ = materialReference;
            _frameIndex_ = frameIndex;
            _image_ = image;
            _tintColor_ = tintColor;
            _alpha_ = alpha;
        }

        isDirty = false;
        if (spriteContainer != null && !spriteContainer.isReady)
            isDirty = true;
    }
开发者ID:artalgame,项目名称:mushrooms,代码行数:93,代码来源:OTSprite.cs

示例4: ContainerSprites

	public static List<OTSprite> ContainerSprites(OTContainer container)
	{
		if (isValid)
		{
			List<OTSprite> res = new List<OTSprite>();
			for (int o=0; o<instance.objects.Count; o++)
			{
				if (instance.objects[o] is OTSprite && (instance.objects[o] as OTSprite).spriteContainer == container)
					res.Add(instance.objects[o] as OTSprite);
			}
			return res;
		}
		return null;
	}
开发者ID:KonstantinDavidov,项目名称:hotfix,代码行数:14,代码来源:OT.cs

示例5: FrameOffsetSize

 void FrameOffsetSize(OTContainer.Frame fr)
 {
     float _sx = (size.x / oSize.x);
     float _sy = (size.y / oSize.y);
     Vector2 sc = new Vector2(_sx * fr.size.x * OT.view.sizeFactor, _sy * fr.size.y * OT.view.sizeFactor);
     Vector3 sc3 = new Vector3(sc.x, sc.y, 1);
     _size = sc;
     if (!Vector3.Equals(otTransform.localScale, sc3))
        otTransform.localScale = sc3;
     oSize = fr.size * OT.view.sizeFactor;
     FrameOffset(fr);
 }
开发者ID:Tavrox,项目名称:Lavapools,代码行数:12,代码来源:OTSprite.cs

示例6: RegisterContainerLookup

 public static void RegisterContainerLookup(OTContainer container, string oldName)
 {
     if (isValid)
         instance._RegisterContainerLookup(container, oldName);
 }
开发者ID:KonstantinDavidov,项目名称:hotfix,代码行数:5,代码来源:OT.cs

示例7: RegisterContainer

 public static void RegisterContainer(OTContainer container)
 {
     if (isValid)
         instance._RegisterContainer(container);
 }
开发者ID:KonstantinDavidov,项目名称:hotfix,代码行数:5,代码来源:OT.cs

示例8: _DestroyContainer

 void _DestroyContainer(OTContainer container)
 {
     _RemoveContainer(container);
     if (container.gameObject != null)
         Destroy(container.gameObject);
 }
开发者ID:KonstantinDavidov,项目名称:hotfix,代码行数:6,代码来源:OT.cs

示例9: _RemoveContainer

 void _RemoveContainer(OTContainer container)
 {
     if (containerList.Contains(container))
     {
         string lname = container.name.ToLower();
         if (containers.ContainsKey(lname))
             containers.Remove(lname);
         if (containerList.Contains(container))
             containerList.Remove(container);
     }
 }
开发者ID:KonstantinDavidov,项目名称:hotfix,代码行数:11,代码来源:OT.cs

示例10: _RegisterContainerLookup

 void _RegisterContainerLookup(OTContainer container, string oldName)
 {
     if (containerList.Contains(container))
     {
         if (containers.ContainsKey(oldName.ToLower()) && containers[oldName.ToLower()] == container)
             containers.Remove(oldName.ToLower());
         if (containers.ContainsKey(container.name.ToLower()))
             containers.Remove(container.name.ToLower());
         containers.Add(container.name.ToLower(), container);
     }
 }
开发者ID:KonstantinDavidov,项目名称:hotfix,代码行数:11,代码来源:OT.cs

示例11: _RegisterContainer

    void _RegisterContainer(OTContainer container)
    {
        if (!containerList.Contains(container))
            containerList.Add(container);
        if (!containers.ContainsKey(container.name.ToLower()))
            containers.Add(container.name.ToLower(), container);
        else
        {
            if (containers[container.name.ToLower()] != container)
                Debug.LogError("More than one SpriteContainer with name '" + container.name + "'");
        }
		
		
		foreach (Transform child in transform)
		{
			if (child.name.ToLower() == "containers")
			{
				container.transform.parent = child.transform;
				break;
			}
		}
		
    }
开发者ID:KonstantinDavidov,项目名称:hotfix,代码行数:23,代码来源:OT.cs

示例12: _ResetContainer

	void _ResetContainer(OTContainer container)
	{
		container.Reset();
	}
开发者ID:KonstantinDavidov,项目名称:hotfix,代码行数:4,代码来源:OT.cs

示例13: FrameOffset

    void FrameOffset(OTContainer.Frame fr)
    {
        float _sx = (size.x / oSize.x);
        float _sy = (size.y / oSize.y);
        imageSize = new Vector2(_sx * fr.imageSize.x * OT.view.sizeFactor, _sy * fr.imageSize.y * OT.view.sizeFactor);
        Vector2 nOffset = new Vector2(_sx * fr.offset.x * OT.view.sizeFactor, _sy * fr.offset.y * OT.view.sizeFactor);

        if (flipHorizontal)
            nOffset.x = (((fr.imageSize.x * OT.view.sizeFactor) - oSize.x) * _sx) - nOffset.x;
        if (flipVertical)
            nOffset.y = (((fr.imageSize.y * OT.view.sizeFactor) - oSize.y) * _sy) - nOffset.y;

        offset = nOffset;
        position = _position;
    }
开发者ID:Tavrox,项目名称:Lavapools,代码行数:15,代码来源:OTSprite.cs

示例14: DestroyContainer

 /// <summary>
 /// Destroys an Orthello container
 /// </summary>
 public static void DestroyContainer(OTContainer container)
 {
     if (isValid)
         instance._DestroyContainer(container);
 }
开发者ID:KonstantinDavidov,项目名称:hotfix,代码行数:8,代码来源:OT.cs

示例15: RemoveContainer

 public static void RemoveContainer(OTContainer o)
 {
     if (isValid)
         instance._RemoveContainer(o);
 }
开发者ID:KonstantinDavidov,项目名称:hotfix,代码行数:5,代码来源:OT.cs


注:本文中的OTContainer类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。