Exemplo n.º 1
0
 public Node NPCBehavior_Grab(NPCObject obj)
 {
     return(new Sequence(
                NPCBehavior_LookAt(obj.GetMainLookAtPoint(), true),
                NPCBehavior_GoToAtDistance(new Vector3(obj.GetPosition().x, this.transform.position.y, obj.GetPosition().z), 0.8f),
                new LeafInvoke(() => Behavior_GrabRightHand(obj)),
                new LeafWait(1000),
                NPCBehavior_LookAt(obj.GetMainLookAtPoint(), false)
                ));
 }
Exemplo n.º 2
0
    private IEnumerator FadeContextMenu(bool fadeIn, NPCObject obj = null)
    {
        InteractionsPanel.SetActive(fadeIn);
        float alpha = fadeIn ? 0f : 1f;

        if (fadeIn)
        {
            SetContextMenuEnabled(true);
            while (alpha < 0.9f)
            {
                InteractionsPanel.transform.position = Camera.main.WorldToScreenPoint(g_FocusedObject.GetPosition());
                foreach (Image go in InteractionsPanel.GetComponents <Image>())
                {
                    Color c = go.color;
                    c.a     += 0.05f;
                    alpha    = c.a;
                    go.color = c;
                }
                yield return(null);
            }
        }
        else
        {
            while (alpha > 0f)
            {
                foreach (Image go in InteractionsPanel.GetComponents <Image>())
                {
                    Color c = go.color;
                    c.a     -= 0.05f;
                    alpha    = c.a;
                    go.color = c;
                }
                yield return(null);
            }
            SetContextMenuEnabled(false);
        }
    }