Exemplo n.º 1
0
        void OnMouseClick(Cursor.ClickType type, Rigidbody2D r)
        {
            if (type == Cursor.ClickType.UI && isHovered)
            {
                //listen
                isSelected = true;
                StartCoroutine(ListenToKeyboard());
            }
            else if (isSelected)
            {
                StopAllCoroutines();
                selectedGraphic.SetActive(false);
                isSelected = false;
                GetComponent <SpeechGravity>().enabled = true;
                anim.speed = 1;

                if (language.knownWord.Length > 0)
                {
                    Achievements.EditLanguage();
                    if (Language.defaultWord == "")
                    {
                        Language.defaultWord = language.knownWord;
                    }
                }
            }
        }
Exemplo n.º 2
0
        void OnClick(Cursor.ClickType clickType, Rigidbody2D r)
        {
            if (!Achievements.achievementDic["World"].isDone)
            {
                return;
            }

            if (clickType == Cursor.ClickType.Sky)
            {
                Vector2    spawnPos     = Cursor.Instance.CursorPosition;
                GameObject newCharacter = Instantiate(_characterPrefab, spawnPos, Gravity.GetUpRotationAt(spawnPos), null);
                Instantiate(_starEffect, spawnPos, Quaternion.identity, null);
                characterSpawnedCount++;
                Human h = newCharacter.GetComponent <Human>();

                if (characterSpawnedCount >= firstWomanAt && !Achievements.achievementDic["Women"].isDone)
                {
                    h.ForceWoman();
                }

                else if (characterSpawnedCount >= firstWhiteAt && !Achievements.achievementDic["Race"].isDone)
                {
                    h.ForceWhite();
                }

                else if (Gravity.DistanceFromCenter(spawnPos) > 9)
                {
                    Achievements.AlienCreated();
                    h.SetRace(Human.Race.Alien);
                }

                Achievements.CharacterSpawned(h.sex, h.race);
            }
        }
Exemplo n.º 3
0
 void OnClick(Cursor.ClickType clickType, Rigidbody2D hitR)
 {
     if (clickType == Cursor.ClickType.Character)
     {
         m_heldRigidbody = hitR;
         StartCoroutine(DragRigidbody());
     }
 }
Exemplo n.º 4
0
 void OnClick(Cursor.ClickType clickType, Rigidbody2D r)
 {
     world.SetActive(true);
     Invoke("WorldAchievement", .5f);
     Cursor.onMouseClick.RemoveListener(OnClick);
 }