protected void FindVariables() { // transform variables m_valEnabled = CanDisableGameObject() ? m_entity.GetValue_Boolean(EntityValue.ENABLED) : null; m_valPosition = DoTrans() ? m_entity.GetValue_Vector3D(EntityValue.POSITION) : null; m_valRotation = DoRot() ? m_entity.GetValue_Quaternion(EntityValue.ROTATION) : null; m_valScale = DoScale() ? m_entity.GetValue_Vector3D(EntityValue.SCALE) : null; // parameter variables List <ParameterBase> parameters = FindParameters(); foreach (ParameterBase param in parameters) { ParameterProxy proxy = CreateParameterProxy(param, m_entity); if (proxy != null) { if (proxy.IsValid()) { m_proxies.Add(proxy); } else { Debug.LogWarningFormat("Could not find entity value '{0}' of type {1} in entity '{2}'", param.Name, proxy.GetTypeName(), m_entity.Name); } } else { Debug.LogWarningFormat("Could not create proxy for type of parameter '{0}'", param.Name); } } }
protected override void FindVariables() { ParameterBase[] parameters = FindParameters(); foreach (ParameterBase param in parameters) { ParameterProxy proxy = CreateParameterProxy(param, Entity); if (proxy != null) { if (proxy.IsValid()) { m_proxies.Add(proxy); } else { Debug.LogWarningFormat("Could not find entity value '{0}' of type {1} in entity '{2}'", param.Name, proxy.GetTypeName(), Entity.Name); } } else { Debug.LogWarningFormat("Could not create proxy for type of parameter '{0}'", param.Name); } } }
protected void CreateVariables(EntityData _entity) { // transform variables if (CanDisableGameObject()) { _entity.AddValue_Boolean(EntityValue.ENABLED, gameObject.activeSelf); } if (DoTrans()) { _entity.AddValue_Vector3D(EntityValue.POSITION, transform.localPosition); } if (DoRot()) { _entity.AddValue_Quaternion(EntityValue.ROTATION, transform.localRotation); } if (DoScale() && GetComponent <Camera>() == null) { // no scale in cameras _entity.AddValue_Vector3D(EntityValue.SCALE, transform.localScale); } // parameter variables List <ParameterBase> parameters = FindParameters(); foreach (ParameterBase param in parameters) { ParameterProxy proxy = CreateParameterProxy(param, _entity); if (proxy != null) { if (proxy.IsValid()) { m_proxies.Add(proxy); } else { Debug.LogWarningFormat("Could not create entity value '{0}' of type {1} in entity '{2}'", param.Name, proxy.GetTypeName(), _entity.Name); } } else { Debug.LogWarningFormat("Could not create proxy for type of parameter '{0}'", param.Name); } } }