Example #1
0
    ///<summary>
    /// When called checks if he is the GameObject focused on and revert its material to the previously used.
    ///</summary>
    ///<param name="e">The event's instance</param>
    private void OnUnFocusItem(OnUnFocusEvent e)
    {
        if (e.obj.Equals(gameObject))
        {
            if (isHighlighted)
            {
                SetMaterial(highlightMaterial);
            }
            else if (isSelected)
            {
                SetMaterial(selectedMaterial);
            }
            else
            {
                if (e.obj.GetComponent <OObject>().category.Equals("corridor"))
                {
                    SetMaterial(transparentMaterial);
                }
                else
                {
                    SetMaterial(defaultMaterial);
                }
                transform.GetChild(0).GetComponent <Renderer>().material.color = e.obj.GetComponent <OObject>().color;
            }
            isFocused = false;

            if (GameManager.gm.focus.Count > 0)
            {
                GameObject newFocus = GameManager.gm.focus[GameManager.gm.focus.Count - 1];
                newFocus.GetComponent <CustomRendererOutline>().SetMaterial(focusMaterial);
            }
        }
    }
Example #2
0
 ///<summary>
 /// Called when an OnUnFocusEvent is raised
 ///</summary>
 ///<param name="_e">The raised event</param>
 private void OnUnFocus(OnUnFocusEvent _e)
 {
     if (GameManager.gm.focus.Count == 0)
     {
         transform.position    = labeledTransforms[0].pos;
         transform.eulerAngles = labeledTransforms[0].rot;
         labeledTransforms.Clear();
     }
 }
Example #3
0
 ///<summary>
 /// When called checks if he is the GameObject focused on and if true deactivates all of his child's mesh renderers.
 ///</summary>
 ///<param name="e">The event's instance</param>
 private void OnUnFocusItem(OnUnFocusEvent e)
 {
     if (isDeleted)
     {
         return;
     }
     if (e.obj == gameObject)
     {
         UpdateOtherObjectsMeshRenderers(true);
         isFocused = false;
         ToggleCollider(gameObject, false);
         GetComponent <DisplayObjectData>()?.ToggleLabel(true);
     }
 }
Example #4
0
 ///
 private void OnUnFocusItem(OnUnFocusEvent _e)
 {
     UpdateFocusText();
 }