public override void Awake() { //Debug.Log ("You called me"); base.Awake(); logs = Achievements.Instance; lastNumberShow = 0; activeSlotShow = -1; }
//------------------------------------------------------------------------------ /// <summary> /// Initialize the components /// </summary> public virtual void Awake() { //Debug.Log ("AchievementsLogs Awake"); GameObject obj = null; uiManager = UIManager.Instance; hud = GetChildObject("HUD"); logPanel = GetChildObject("HUD/popup_Achievements"); obj = GetChildObject("HUD/popup_Achievements/txt_Note"); logText = obj.GetComponent<UIText>(); logText.wrapSize = 40; obj = GetChildObject("HUD/popup_Achievements/txt_Time"); logTime = obj.GetComponent<UIText>(); //use Slots class here? slots = new List<AchievementNpc>(); slots.Add(GetChildObject(gBadge+"1").GetComponent<AchievementNpc>()); slots.Add(GetChildObject(gBadge+"2").GetComponent<AchievementNpc>()); slots.Add(GetChildObject(gBadge+"3").GetComponent<AchievementNpc>()); slots.Add(GetChildObject(gBadge+"4").GetComponent<AchievementNpc>()); obj = GetChildObject ("HUD/btn_Arrow_Achievements_left"); leftArrow = obj.GetComponent<Button> (); obj = GetChildObject ("HUD/btn_Arrow_Achievements_right"); rightArrow = obj.GetComponent<Button> (); logs = Achievements.Instance; activeSlot = -1; logPages = 0; activePage = 0; //TODO : The GameManager.Remove(EventHandler); is missing // Where to set? // As the AchievementsLog is only once set in a game it should // not be a serious issue GameManager.Instance.RegisterEventHandler( "ACHIEVEMENT", ProcessAchievementEvent, gameObject); Show(false); achievementSprite = UIManager.LoadSprite ( "Game/Sprites/Achievement/badge_Achievements"); ResetSlots (0); }
// Use this for initialization //void Start () private Z0000_GameObjectives() { Log.Debug("Z0000_GameObjectives initialized."); score = new Score(); scoreSelf = new Score(); scoreSelfAI = new Score(); scoreSelfAIAbsolute = new Score(); scoreSelfAIAbsolute.rangeMax = 100000; scoreSelfAIAbsolute.rangeMin = -100000; namesHotSpotArray = new string[] { "aafa106b-0655-4b2d-9557-16c3ab0272f0", "4d8bd261-0c94-4613-8aa7-6dcdcf9f8dee", "3c5b8ea6-311b-4c31-9443-83e1afef63ca" }; activateCitizenHotspot = new List<string>(namesHotSpotArray); namescollectKnowledgeHotspotArray = new string[] { "50293b47-36bc-47eb-92b8-ce2e79e4c716", "801228da-a84d-46d2-bc17-ffd2e5c7b753", "dcb53ec7-7cb4-453d-b54c-bb17587fe6b3" }; collectKnowledgeHotspot = new List<string>(namescollectKnowledgeHotspotArray); namesraiseInterestHotspotArray = new string[] { "a6f0c811-4c27-449d-ae8a-75334a220bc6", "3045bb58-67b8-4360-8f66-1a497cb4c0ff", "665c0462-6686-401a-888f-c5f14919041f" }; raiseInterestHotspot = new List<string>(namesraiseInterestHotspotArray); GameManager.Instance.RegisterEventHandler("ACHIEVEMENT", AchievementEventHandler); GameManager.Instance.RegisterEventHandler("RESET", ResetEventHandler); achievements = Achievements.Instance; if (achievements.Items.Count < 1) GetAchievements(); // at start init all the values equal to a Game restart/reset Reset(); }