public void setMaskInteraction(SpriteMaskInteraction spriteMaskInteraction) { for (int i = 0; i < nodeSprites.Length; i++) { nodeSprites[i].maskInteraction = spriteMaskInteraction; } }
public void SetMaskInteraction(SpriteMaskInteraction interaction) { foreach (var part in spriteParts) { part.maskInteraction = interaction; } }
/// <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(); } }
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; }
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(); }
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; }
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; }
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; }
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]; } }
/// <summary> /// Set the interaction for each mask. /// </summary> public void SetMaskInteraction(SpriteMaskInteraction intr) { SetMaskInteraction(intr, intr, intr, intr); }
/// <summary> /// Sets whether the sprite renderer is affected by SpriteMasks /// </summary> public void SetMasking(SpriteMaskInteraction interaction) { _renderer.maskInteraction = interaction; }
public void SetAsMasked() { maskInteraction = SpriteMaskInteraction.VisibleInsideMask; SetMaskInteraction(); }
public void SetMaskInteraction(SpriteMaskInteraction newMaskInteraction) { maskInteraction = newMaskInteraction; SetMaskInteraction(); }
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); } }