예제 #1
0
 public void setMaskInteraction(SpriteMaskInteraction spriteMaskInteraction)
 {
     for (int i = 0; i < nodeSprites.Length; i++)
     {
         nodeSprites[i].maskInteraction = spriteMaskInteraction;
     }
 }
예제 #2
0
 public void SetMaskInteraction(SpriteMaskInteraction interaction)
 {
     foreach (var part in spriteParts)
     {
         part.maskInteraction = interaction;
     }
 }
예제 #3
0
 /// <summary>
 /// Set the interaction for each mask.
 /// </summary>
 public void SetMaskInteraction(SpriteMaskInteraction layer0, SpriteMaskInteraction layer1, SpriteMaskInteraction layer2, SpriteMaskInteraction layer3)
 {
     m_MaskInteraction = (int)layer0 + ((int)layer1 << 2) + ((int)layer2 << 4) + ((int)layer3 << 6);
     if (graphic)
     {
         graphic.SetMaterialDirty();
     }
 }
예제 #4
0
 public void UpdateMaskInteraction(SpriteMaskInteraction update)
 {
     gameObject.GetComponent <SpriteRenderer>().maskInteraction = update;
     suitObject.GetComponent <SpriteRenderer>().maskInteraction = update;
     if (hologram != null && hologramFood != null)
     {
         hologram.GetComponent <SpriteRenderer>().maskInteraction     = update;
         hologramFood.GetComponent <SpriteRenderer>().maskInteraction = update;
     }
 }
        public void SetMaskEnabled(bool isEnabled)
        {
            SpriteMaskInteraction maskInteraction = isEnabled ? SpriteMaskInteraction.VisibleInsideMask : SpriteMaskInteraction.None;

            SpriteRenderer[] propSprites = go_props.GetComponentsInChildren <SpriteRenderer>();
            foreach (SpriteRenderer sr in propSprites)
            {
                sr.maskInteraction = maskInteraction;
            }
        }
 public SpriteRendererProperties(SpriteRenderer renderer)
 {
     adaptiveModeThreshold = renderer.adaptiveModeThreshold;
     color           = renderer.color;
     drawMode        = renderer.drawMode;
     flipX           = renderer.flipX;
     flipY           = renderer.flipY;
     maskInteraction = renderer.maskInteraction;
     size            = renderer.size;
     tileMode        = renderer.tileMode;
 }
예제 #7
0
 public override void Deserialize(BinaryReader binaryReader)
 {
     base.Deserialize(binaryReader);
     m_Sprite          = SerializerKun.DesirializeObject <SpriteKun>(binaryReader);
     m_Color           = SerializerKun.DesirializeObject <ColorKun>(binaryReader);
     m_FlipX           = binaryReader.ReadBoolean();
     m_FlipY           = binaryReader.ReadBoolean();
     m_DrawMode        = (SpriteDrawMode)binaryReader.ReadInt32();
     m_MaskInteraction = (SpriteMaskInteraction)binaryReader.ReadInt32();
     m_SpriteSortPoint = (SpriteSortPoint)binaryReader.ReadInt32();
 }
예제 #8
0
 public void SetSkinContainerMaskInteraction(SpriteMaskInteraction maskInteraction)
 {
     for (int i = 0; i < transform.childCount; ++i)
     {
         var spriteRenderer = transform.GetChild(i).GetComponent <SpriteRenderer>();
         if (spriteRenderer != null)
         {
             spriteRenderer.maskInteraction = maskInteraction;
         }
     }
 }
 static void EditorDeleteMaskMaterials(SkeletonRenderer component, SpriteMaskInteraction maskType)
 {
     if (component == null)
     {
         return;
     }
     if (!SkeletonDataAssetIsValid(component.SkeletonDataAsset))
     {
         return;
     }
     SpineMaskUtilities.EditorDeleteMaskMaterials(component.maskMaterials, maskType);
 }
        protected override void ReadFromImpl(object obj)
        {
            base.ReadFromImpl(obj);
            SpriteRenderer uo = (SpriteRenderer)obj;

            sprite   = ToID(uo.sprite);
            drawMode = uo.drawMode;
            size     = uo.size;
            adaptiveModeThreshold = uo.adaptiveModeThreshold;
            tileMode        = uo.tileMode;
            color           = uo.color;
            maskInteraction = uo.maskInteraction;
            flipX           = uo.flipX;
            flipY           = uo.flipY;
            spriteSortPoint = uo.spriteSortPoint;
        }
예제 #11
0
    private IEnumerator Connect()
    {
        _portalManager.StartPortalSound();

        yield return(new WaitForSecondsRealtime(2));

        _portalManager.LaunchConnection(this);

        while (_portalManager.Connection != null)
        {
            yield return(null);
        }

        if (Other == null || Exit)
        {
            Deactivate();
            yield break;
        }

        Other.Hero                  = Hero;
        TeleportedRenderer          = Hero.GetComponent <SpriteRenderer>();
        Other.TeleportedLayer       = TeleportedLayer;
        SpriteMaskInteraction       = TeleportedRenderer.maskInteraction;
        Other.SpriteMaskInteraction = SpriteMaskInteraction;

        TeleportedRenderer.maskInteraction = SpriteMaskInteraction.VisibleOutsideMask;

        foreach (var renderer in Hero.GetComponentsInChildren <SpriteRenderer>())
        {
            renderer.maskInteraction = SpriteMaskInteraction.VisibleOutsideMask;
        }

        TeleportedLayer       = Hero.gameObject.layer;
        Hero.gameObject.layer = LayerMask.NameToLayer("Teleported");
        Hero.SetCapeActivation(false);

        _portalManager.StartCoroutine(_portalManager.Teleport(this, Other));
        _connect = null;
    }
예제 #12
0
        protected override void ReadFromImpl(object obj)
        {
            base.ReadFromImpl(obj);
            ParticleSystemRenderer uo = (ParticleSystemRenderer)obj;

            mesh                = ToID(uo.mesh);
            alignment           = uo.alignment;
            renderMode          = uo.renderMode;
            sortMode            = uo.sortMode;
            lengthScale         = uo.lengthScale;
            velocityScale       = uo.velocityScale;
            cameraVelocityScale = uo.cameraVelocityScale;
            normalDirection     = uo.normalDirection;
            sortingFudge        = uo.sortingFudge;
            minParticleSize     = uo.minParticleSize;
            maxParticleSize     = uo.maxParticleSize;
            pivot               = uo.pivot;
            maskInteraction     = uo.maskInteraction;
            trailMaterial       = ToID(uo.trailMaterial);
            enableGPUInstancing = uo.enableGPUInstancing;
            shadowBias          = uo.shadowBias;
            flip                = uo.flip;
            allowRoll           = uo.allowRoll;
        }
예제 #13
0
        public static void EditorDeleteMaskMaterials(SkeletonRenderer.SpriteMaskInteractionMaterials maskMaterials, SpriteMaskInteraction maskType)
        {
            Material[] targetMaterials;
            if (maskType == SpriteMaskInteraction.VisibleInsideMask)
            {
                targetMaterials = maskMaterials.materialsInsideMask;
            }
            else if (maskType == SpriteMaskInteraction.VisibleOutsideMask)
            {
                targetMaterials = maskMaterials.materialsOutsideMask;
            }
            else
            {
                Debug.LogWarning("EditorDeleteMaskMaterials: Normal materials are kept as a reference and shall never be deleted.");
                return;
            }

            for (int i = 0; i < targetMaterials.Length; ++i)
            {
                var material = targetMaterials[i];
                if (material != null)
                {
                    string materialPath = UnityEditor.AssetDatabase.GetAssetPath(material);
                    UnityEditor.AssetDatabase.DeleteAsset(materialPath);
                    Debug.Log(string.Concat("Deleted material '", materialPath, "'"));
                }
            }

            if (maskType == SpriteMaskInteraction.VisibleInsideMask)
            {
                maskMaterials.materialsInsideMask = new Material[0];
            }
            else if (maskType == SpriteMaskInteraction.VisibleOutsideMask)
            {
                maskMaterials.materialsOutsideMask = new Material[0];
            }
        }
예제 #14
0
 /// <summary>
 /// Set the interaction for each mask.
 /// </summary>
 public void SetMaskInteraction(SpriteMaskInteraction intr)
 {
     SetMaskInteraction(intr, intr, intr, intr);
 }
예제 #15
0
 /// <summary>
 /// Sets whether the sprite renderer is affected by SpriteMasks
 /// </summary>
 public void SetMasking(SpriteMaskInteraction interaction)
 {
     _renderer.maskInteraction = interaction;
 }
예제 #16
0
 public void SetAsMasked()
 {
     maskInteraction = SpriteMaskInteraction.VisibleInsideMask;
     SetMaskInteraction();
 }
예제 #17
0
 public void SetMaskInteraction(SpriteMaskInteraction newMaskInteraction)
 {
     maskInteraction = newMaskInteraction;
     SetMaskInteraction();
 }
예제 #18
0
 public static void EditorInitMaskMaterials(SkeletonRenderer skeleton, SkeletonRenderer.SpriteMaskInteractionMaterials maskMaterials, SpriteMaskInteraction maskType)
 {
     if (maskType == SpriteMaskInteraction.None)
     {
         EditorConfirmDisabledMaskMaterialsInit(skeleton);
     }
     else if (maskType == SpriteMaskInteraction.VisibleInsideMask)
     {
         EditorInitSpriteMaskMaterialsInsideMask(skeleton);
     }
     else if (maskType == SpriteMaskInteraction.VisibleOutsideMask)
     {
         EditorInitSpriteMaskMaterialsOutsideMask(skeleton);
     }
 }