// upoffset } public override void SetProperties(SimpleJSON.JSONClass N) { base.SetProperties(N); if (cannon && N.GetKeys().Contains(ConveyerWhoosherSpeeder.speedKey)) { GetComponentInChildren <ConveyerWhoosherSpeeder>().speed = N[ConveyerWhoosherSpeeder.speedKey].AsInt; } /* * Format of properties for the NumberModifiers may differ, look in NumberHoop for the actual implementation of this method. * */ // // commented Debug.Log("props:"+props); // SimpleJSON.JSONNode n = SimpleJSON.JSON.Parse(props); // // commented Debug.Log("set prop received:"+N.ToString()); if (textTrigger && N.GetKeys().Contains(PlayerNowMessageTrigger.textTriggerKey)) { PlayerNowMessageTrigger tt = GetComponentInChildren <PlayerNowMessageTrigger>(); if (tt) { tt.thingToSay = Utils.FakeToRealQuotes(N[PlayerNowMessageTrigger.textTriggerKey].Value); } else { // commented Debug.LogError("Set prop fail, no speech, couldn't say '"+N[PlayerNowMessageTrigger.textTriggerKey].Value+"' on "+myName); } } }
public string ueo_notes; // strictly for my reference later in editor -- lets me know something unique about this prefab object #region UserEditable public override SimpleJSON.JSONClass GetProperties() { SimpleJSON.JSONClass N = base.GetProperties(); // new SimpleJSON.JSONClass(); // Debug.Log("gettin prop...:"+N.ToString()); if (cannon) { N[ConveyerWhoosherSpeeder.speedKey].AsInt = Mathf.RoundToInt(GetComponentInChildren <ConveyerWhoosherSpeeder>().speed); } if (textTrigger) { // Todo : factor this into all UserEditableObject so you can add text triggers to any UEO. PlayerNowMessageTrigger tt = GetComponentInChildren <PlayerNowMessageTrigger>(); if (tt) { N[PlayerNowMessageTrigger.textTriggerKey] = Utils.RealToFakeQuotes(tt.thingToSay); } else { // commented Debug.LogError("Getprop UEO: No text script is a child of "+myName+", but it's labeled as text trigger."); } } return(N); }