Пример #1
0
    public void GenerateGrumpsReal(GreatGrand g, int num)
    {
        _Grump [] final = new _Grump[num];
        for (int i = 0; i < num; i++)
        {
            bool has_targ = false;

            GrumpObj targ = null;

            while (!has_targ)
            {
                targ     = GetRandomGG(g);
                has_targ = true;

                for (int x = 0; x < i; x++)
                {
                    if (final[x].Target == targ)
                    {
                        has_targ = false;
                    }
                }
            }
            int  dist = _TableManager.SeatDistance(targ as GreatGrand, g);
            bool like = false;
            if (dist == 1)
            {
                like = true;
            }

            final[i] = new _Grump(like, g, targ);
        }
        g.Grumps = final;
    }
Пример #2
0
 public void GenerateGrumpsPrimitive(GreatGrand g, int num)
 {
     g.Grumps = new _Grump[num];
     for (int i = 0; i < num; i++)
     {
         GrumpObj targ = GetRandomGG(g);
         _Grump   newg = new _Grump(false, g, targ);
         g.Grumps[i] = newg;
     }
 }
Пример #3
0
    public IEnumerator GrumpAlert(_Grump g)
    {
        float time_pause = 0.7F;

        FIRL alert = (FIRL)Instantiate(GrumpAlertObj);

        //GameManager.UI.WorldObjects.AddChild(alert);
        alert.Init(-1, GameManager.UI.FOBJ_World);

        alert.Child[1].AddChild(Instantiate(g.Target.FObject));
        alert.IMG[0].sprite = g.LikesIt ? Alert_Right : Alert_Wrong;

        alert.SetActive(false);
        alert.T.position   = MOB[0][0].T.position;
        alert.T.localScale = Vector3.one * 4.0F;



        //alert[0].T.rotation = g.Parent.Seat.Rotation * Quaternion.Euler(50,0,180);
        alert.TweenActive(true);

        float t = 0.0F;

        while ((t += Time.deltaTime) < time_pause || Target == g.Parent)
        {
            //Vector3 targpos = g.Parent.Position;
            //alert.transform.position = targpos;
            //alert.Child[0].transform.rotation = Quaternion.identity;
            //alert.IMG[0].transform.rotation = Quaternion.identity;
            yield return(null);
        }

        alert.SetActive(false);
        yield return(new WaitForSeconds(0.4F));

        if (alert != null)
        {
            alert.PoolDestroy();
        }
        yield return(null);
    }