DeathBook/Assets/Tests/PersonTest.cs
Patrice Vignola d414ed7f6e - Added the links highlighting when hovering on a node and stopping the
sphere rotation when hovering over it
2015-08-12 13:48:16 -04:00

45 lines
843 B
C#

using UnityEngine;
using System.Collections;
using System.Collections.Generic;
[RequireComponent(typeof(Collider))]
public class PersonTest : MonoBehaviour
{
// Temporary, for test
private List<FriendshipLink> _links;
private bool _highlighted = false;
void Awake()
{
_links = new List<FriendshipLink>();
}
public void AddLink(FriendshipLink link)
{
_links.Add(link);
}
void OnMouseOver()
{
if (!_highlighted)
{
_highlighted = true;
foreach (FriendshipLink link in _links)
{
link.Highlight(true, 1f);
}
}
}
void OnMouseExit()
{
_highlighted = false;
foreach (FriendshipLink link in _links)
{
link.Highlight(false, 1f);
}
}
}