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); } }
public void Spawn(string word, Vector3 position, Language language) { Transform newWord = Instantiate(wordPrefab, position, Gravity.GetUpRotationAt(position), transform); newWord.GetComponentInChildren <SpeechBubble>().language = language; }