protected void SpawnFace(Vector3 position, Emotion eyesEmotion, Emotion mouthEmotion, bool correct, float scaling, bool iconNeeded) { GameSessionSettings gameSessionSettings = gameManager.gameSessionSettings; GameObject face = Instantiate(Resources.Load <GameObject>("Prefab/AvatarFaceUI"), position, Quaternion.identity); face.transform.localScale = new Vector3(scaling, scaling); face.GetComponent <Avatar>().CreateCompleteFace(mouthEmotion, eyesEmotion, gameSessionSettings.avatarSettings.gender, gameSessionSettings.avatarSettings.skinColor, gameSessionSettings.avatarSettings.hairStyle, gameSessionSettings.avatarSettings.hairColor, gameSessionSettings.avatarSettings.eyesColor); if (iconNeeded) { if (correct) { face.transform.Find("Correct").GetComponent <SpriteRenderer>().sprite = Resources.Load <Sprite>("Sprite/UI/OkIcon"); } else { face.transform.Find("Correct").gameObject.SetActive(true); face.transform.Find("Correct").GetComponent <SpriteRenderer>().sprite = Resources.Load <Sprite>("Sprite/UI/NotOkIcon"); face.GetComponent <Avatar>().ChangeFaceOpacity(150); } } else { face.transform.Find("Correct").GetComponent <SpriteRenderer>().color = new Color(1, 1, 1, 0); } gameManager.endRoundObjectSpawned.Add(face); }
// Use this for initialization void Start() { topText.text = UIEndRoundManager.ChangeTextToRandomColors("Scopri le emozioni"); SelectableObject.objectSelectedEvent += ShowTutorialEmotion; if (GameObject.FindObjectOfType <GameSessionSettings>() == null) { gameSessionSettings = Instantiate(new GameObject(), transform.position, Quaternion.identity).AddComponent <GameSessionSettings>(); } else { gameSessionSettings = GameObject.FindObjectOfType <GameSessionSettings>(); } //istanzia la mano Instantiate(Resources.Load <GameObject>("Prefab/HandSelection"), Vector2.zero, Quaternion.identity); //istanzia le 5 facce int i = 0; foreach (string e in emotions) { Vector3 position = new Vector3(-6 + (i * 3), 0, 0); CreateFace("main", e, position, 1, facesPanel.transform, true); i++; } }
// Token: 0x06000683 RID: 1667 public bool InitializeRecordingSession(string sessionName, int randomSeed, NetworkPlayerID localPlayerID, CommanderManager commanderManager, GameModeBase gameMode) { ReplayHelpers.MostRecentReplayFile = string.Empty; if (this.mReplayMode == ReplayMode.ReplaysDisabled) { return(false); } string locationForReplay = ReplayHelpers.GetLocationForReplay(sessionName); if (BBI.Core.IO.File.Exists(locationForReplay)) { BBI.Core.IO.File.Delete(locationForReplay); // MOD: load replay files BBI.Core.IO.File.Delete(locationForReplay + "x"); } List <byte> bytes = new List <byte>(); byte[] layout = Encoding.UTF8.GetBytes(MapModManager.GetLayoutData()); byte[] patch = Encoding.UTF8.GetBytes(Subsystem.AttributeLoader.GetPatchData()); bytes.AddRange(new byte[] { (byte)((layout.Length >> 0) & 0xff), (byte)((layout.Length >> 8) & 0xff), (byte)((layout.Length >> 16) & 0xff), (byte)((layout.Length >> 24) & 0xff) }); bytes.AddRange(new byte[] { (byte)((patch.Length >> 0) & 0xff), (byte)((patch.Length >> 8) & 0xff), (byte)((patch.Length >> 16) & 0xff), (byte)((patch.Length >> 24) & 0xff) }); bytes.AddRange(new byte[] { 0x00, 0x00, 0x00, 0x00 }); bytes.AddRange(new byte[] { 0x00, 0x00, 0x00, 0x00 }); bytes.AddRange(layout); bytes.AddRange(patch); System.IO.File.WriteAllBytes(locationForReplay + "x", bytes.ToArray()); // MOD GameSessionSettings gameSessionSettings = (gameMode != null) ? gameMode.GameSessionSettings : null; this.mGameSession = new ReplayableGameSession(sessionName, this.mCurrentGameVersion, BBI.Core.IO.File.CreateText(locationForReplay, true), localPlayerID, commanderManager, randomSeed, gameSessionSettings); this.mReplayMode = ReplayMode.RecordingGame; ReplayHelpers.MostRecentReplayFile = locationForReplay; return(true); }
void Start() { gameSessionSettings = GameObject.Find("GameSessionSettings").GetComponent <GameSessionSettings>(); //istanziazione della mano Instantiate(Resources.Load <GameObject>("Prefab/HandSelection"), Vector2.zero, Quaternion.identity); //inizializzo i pannelli che serviranno nella lista InitialzePanels(); //inizializza i messaggi da dire quando cambi pannello InitializeDictionary(); //inizializza la faccia avatar a uno stato di default CreateAvatarFaceAndDefaultIt(); }
//protected abstract void CheckIfMinigameCompleted(); protected virtual void Start() { gameObject.AddComponent <AudioSource>(); if (GameObject.FindObjectOfType <GameSessionSettings>() == null) { gameSessionSettings = Instantiate(new GameObject(), transform.position, Quaternion.identity).AddComponent <GameSessionSettings>(); } else { gameSessionSettings = GameObject.FindObjectOfType <GameSessionSettings>(); } }
private void Awake() { if (instance == null) { instance = this; } else { Destroy(this.gameObject); } if (avatarSettings.skinColor == null) { AssignDefaultAvatarSettings(); } }