public override void OnInspectorGUI() { DrawDefaultInspector(); PersonalityLife persona = (PersonalityLife)target; if (persona.twitteTypeFactor == null) { persona.twitteTypeFactor = new int[TwitteType.Inutile.GetHashCode() + 1]; for (int i = persona.twitteTypeFactor.Length; i-- > 0;) { persona.twitteTypeFactor[i] = 1; } } else if (persona.twitteTypeFactor.Length != TwitteType.Inutile.GetHashCode() + 1) { persona.twitteTypeFactor = new int[TwitteType.Inutile.GetHashCode() + 1]; for (int i = persona.twitteTypeFactor.Length; i-- > 0;) { persona.twitteTypeFactor[i] = 1; } } }
public void SetUpTextBox(PersonalityLife _target, string _pseudo, string _content, int _ego, int _happinesse) { timerDebug = 0f; target = _target; pseudo = _pseudo; content = _content; ego = _ego; happinesse = _happinesse; isLiked = false; isRT = false; isSlow = false; isDeliver = false; ban.sprite = banGris; rT.sprite = rtGris; del.sprite = delGris; like.sprite = likeGris; speudoText.text = pseudo + "\n" + "@" + pseudo; contentText.text = content; System.DateTime theTime = System.DateTime.Now; string month = ""; switch (theTime.Month) { case 1: month = "Jan"; break; case 2: month = "Feb"; break; case 3: month = "Mar"; break; case 4: month = "Apr"; break; case 5: month = "May"; break; case 6: month = "June"; break; case 7: month = "July"; break; case 8: month = "August"; break; case 9: month = "Sep"; break; case 10: month = "Oct"; break; case 11: month = "Nov"; break; case 12: month = "Dec"; break; } if (theTime.Day < 10) { dateText.text = "0" + theTime.Day + " " + month + " " + theTime.Year; } else { dateText.text = theTime.Day + " " + month + " " + theTime.Year; } }
// Start is called before the first frame update void Start() { moodPers = FindObjectOfType <PersonalityLife>(); //text = GetComponent<Text>(); }
public void OnObjectSpawn(PersonalityLife _target, string _pseudo, string _content, int _ego, int _happinesse) { SetUpTextBox(_target, _pseudo, _content, _ego, _happinesse); }
public GameObject SpawnFromPool(string tag, Vector3 position, Quaternion rotation, PersonalityLife _target, string _pseudo, string _content, int _ego, int happinesse) { if (!poolDictionary.ContainsKey(tag)) { Debug.LogWarning("Pool with tag " + tag + " doesn't exist."); return(null); } GameObject objectToSpawn = poolDictionary[tag].Dequeue(); objectToSpawn.SetActive(true); objectToSpawn.transform.position = position; objectToSpawn.transform.rotation = rotation; IPooledObject pooledObject = objectToSpawn.GetComponent <IPooledObject>(); if (pooledObject != null) { pooledObject.OnObjectSpawn(_target, _pseudo, _content, _ego, happinesse); } poolDictionary[tag].Enqueue(objectToSpawn); return(objectToSpawn); }