public void Awake() { m_animator = base.gameObject.GetComponent <Animator>(); mg_if_Variables variables = MinigameManager.GetActive <mg_IceFishing>().Resources.Variables; m_blinkMin = variables.BlinkTimeMin; m_blinkMax = variables.BlinkTimeMax; OnAnimationFinished(); }
private void LoadGameVariables() { TextAsset textAsset = Resources.Load("IceFishing/mg_if_Variables") as TextAsset; XmlDocument xmlDocument = new XmlDocument(); xmlDocument.LoadXml(textAsset.text); m_variables = new mg_if_Variables(); Type type = m_variables.GetType(); XmlNode xmlNode = xmlDocument.SelectSingleNode("/variables"); foreach (XmlElement item in xmlNode.ChildNodes.OfType <XmlElement>()) { PropertyInfo property = type.GetProperty(item.Name); property?.SetValue(m_variables, Convert.ChangeType(item.InnerText, property.PropertyType, CultureInfo.InvariantCulture), null); } }
public void Awake() { m_variables = MinigameManager.GetActive <mg_IceFishing>().Resources.Variables; TopZone = base.transform.Find("mg_if_ZoneTop"); BottomZone = base.transform.Find("mg_if_ZoneBottom"); AlphaLeft = base.transform.Find("mg_if_AlphaLeft"); AlphaRight = base.transform.Find("mg_if_AlphaRight"); CrabStopLeft = base.transform.Find("mg_if_CrabStop_Left").gameObject; CrabStopRight = base.transform.Find("mg_if_CrabStop_Right").gameObject; GameObject gameObject = base.transform.Find("mg_if_GameBG").gameObject; Vector3 localScale = gameObject.transform.localScale; MinigameSpriteHelper.FitSpriteToScreen(MinigameManager.GetActive <mg_IceFishing>().MainCamera, gameObject, _preserveAspect: false); base.transform.localScale = gameObject.transform.localScale; gameObject.transform.localScale = localScale; mouseInputObserver = base.gameObject.AddComponent <MouseInputObserver>(); }
public void UnloadGameResources() { m_variables = null; UnloadResource(mg_if_EResourceList.GAME_LOGIC); UnloadResource(mg_if_EResourceList.GAME_PUFFLE); UnloadResource(mg_if_EResourceList.GAME_YELLOWFISH); UnloadResource(mg_if_EResourceList.GAME_BARREL); UnloadResource(mg_if_EResourceList.GAME_BOOT); UnloadResource(mg_if_EResourceList.GAME_JELLYFISH); UnloadResource(mg_if_EResourceList.GAME_SHARK_NEAR); UnloadResource(mg_if_EResourceList.GAME_SHARK_FAR); UnloadResource(mg_if_EResourceList.GAME_CRAB); UnloadResource(mg_if_EResourceList.GAME_FREE_LIFE); UnloadResource(mg_if_EResourceList.GAME_SOUNDS); UnloadResource(mg_if_EResourceList.GAME_SOUNDS_SINGLE); UnloadGameSounds(); m_hasLoadedGame = false; }
protected virtual void Awake() { m_variables = MinigameManager.GetActive <mg_IceFishing>().Resources.Variables; m_renderers = GetComponentsInChildren <SpriteRenderer>(); }