コード例 #1
0
ファイル: ConversationBar.cs プロジェクト: r2cris/GHC-jam
    //private void Start()
    //{
    //  positiveFeedback = positiveMatchFeedback.GetComponent<Animator>();
    //negativeFeedback = negativeMatchFeedback.GetComponent<Animator>();
    //}

    public void SetConversationBar(ConvoSystem a, ConvoSystem b)
    {
        CharacterA = a;
        CharacterB = b;
        canSelect  = true;
        for (int i = 0; i < CharacterA.chara.likes.Count; i++)
        {
            if (CharacterA.chara.likes[i].like)
            {
                if (CharacterB.chara.likes[i].like)
                {
                    CharacterB.chara.Goods++;
                }
                chALikes.Add(CharacterA.chara.likes[i]);
            }
        }

        for (int j = 0; j < CharacterB.chara.likes.Count; j++)
        {
            if (CharacterB.chara.likes[j].like)
            {
                if (CharacterA.chara.likes[j].like)
                {
                    CharacterA.chara.Goods++;
                }
                chBLikes.Add(CharacterB.chara.likes[j]);
            }
        }

        turn = Random.Range(0, 2);
        StartCoroutine(Conversation());
    }
コード例 #2
0
ファイル: CustomerController.cs プロジェクト: r2cris/GHC-jam
 // Use this for initialization
 void Start()
 {
     cam               = FindObjectOfType <Camera>();
     agent             = this.GetComponent <NavMeshAgent>();
     convsys           = this.GetComponent <ConvoSystem>();
     characterCollider = this.GetComponent <CapsuleCollider>();
     charactergb       = this.GetComponent <Character>();
     initialLook       = transform.forward;
 }
コード例 #3
0
ファイル: BarMode.cs プロジェクト: r2cris/GHC-jam
    void StartNewConversation(ConvoSystem CharacterA, ConvoSystem CharacterB)
    {
        AloneList.Remove(CharacterA);
        AloneList.Remove(CharacterB);
        int idA = LevelManager.instance.Stools.IndexOf(CharacterA.currentStool);
        int idB = LevelManager.instance.Stools.IndexOf(CharacterB.currentStool);

        ConversationBar CB;

        if (idA < idB)
        {
            CB = CurrentConversations[idA];
        }
        else
        {
            CB = CurrentConversations[idB];
        }
        CB.gameObject.SetActive(true);
        CB.SetConversationBar(CharacterA, CharacterB);
        CharacterA.OnFoundPartner(CharacterB);
        CharacterB.OnFoundPartner(CharacterA);
    }
コード例 #4
0
ファイル: ConvoSystem.cs プロジェクト: r2cris/GHC-jam
 public void OnFoundPartner(ConvoSystem p)
 {
     partners.Add(p);
     transform.LookAt(p.transform);
     chara.isAvailable = false;
 }
コード例 #5
0
ファイル: BarMode.cs プロジェクト: r2cris/GHC-jam
    public void FindMatchs()
    {
        Debug.Log(AloneList.Count);
        Debug.Log("Finding Match...");
        eventEmitterRef.Play();
        Queue <ConvoSystem> WaitingCustomers = new Queue <ConvoSystem>();
        int possibleindex;
        int timesForLoop = AloneList.Count;

        for (int i = 0; i < timesForLoop; i++)
        {
            do
            {
                possibleindex = Random.Range(0, timesForLoop);
            } while (WaitingCustomers.Contains(AloneList[possibleindex]));

            WaitingCustomers.Enqueue(AloneList[possibleindex]);
        }

        while (WaitingCustomers.Count > 0)
        {
            // foreach (ConvoSystem currentCS in AloneList) {
            int         i         = Random.Range(0, WaitingCustomers.Count - 1);
            ConvoSystem currentCS = WaitingCustomers.Dequeue();
            if (currentCS.chara.isAvailable)
            {
                int  stoolIndex = LevelManager.instance.Stools.IndexOf(currentCS.currentStool);
                bool right      = LevelManager.instance.CheckCharacterSide(stoolIndex, true);
                bool left       = LevelManager.instance.CheckCharacterSide(stoolIndex, false);
                //if both true
                //Debug.Log("available begin" + currentCS.name);
                if (right && left)
                {
                    //Debug.Log("Both Sides" + currentCS.name);
                    int choosenSide = Random.Range(0, 1);
                    switch (choosenSide)
                    {
                    case 0:
                        left  = true;
                        right = false;
                        break;

                    case 1:
                        left  = false;
                        right = true;
                        break;
                    }
                }

                if (left)
                {
                    // Debug.Log("left Sides" + currentCS.name);
                    ConvoSystem matchPartner = LevelManager.instance.Stools[stoolIndex - 1].convosysAttached;
                    if (!currentCS.partners.Contains(matchPartner))
                    {
                        StartNewConversation(currentCS, LevelManager.instance.Stools[stoolIndex - 1].convosysAttached);
                    }
                }
                else if (right)
                {
                    //Debug.Log("right Sides" + currentCS.name);
                    ConvoSystem matchPartner = LevelManager.instance.Stools[stoolIndex + 1].convosysAttached;
                    if (!currentCS.partners.Contains(matchPartner))
                    {
                        StartNewConversation(currentCS, LevelManager.instance.Stools[stoolIndex + 1].convosysAttached);
                    }
                }
            }
        }
    }
コード例 #6
0
ファイル: BarMode.cs プロジェクト: r2cris/GHC-jam
 public void WaitingList(ConvoSystem cs)
 {
     AloneList.Add(cs);
 }
コード例 #7
0
ファイル: Chair.cs プロジェクト: r2cris/GHC-jam
 public void Occupied(ConvoSystem cvs)
 {
     convosysAttached = cvs;
     isAvailable      = false;
     PosA.GetComponent <SphereCollider>().enabled = false;
 }