Ejemplo n.º 1
0
    private void UnloadTransformData(List <TransformData> _transforms)
    {
        foreach (TransformData _transform in _transforms)
        {
            RememberTransform saveObject = Serializer.returnComponent <RememberTransform> (_transform.objectID);

            if (saveObject != null)
            {
                saveObject.transform.position    = new Vector3(_transform.LocX, _transform.LocY, _transform.LocZ);
                saveObject.transform.eulerAngles = new Vector3(_transform.RotX, _transform.RotY, _transform.RotZ);
                saveObject.transform.localScale  = new Vector3(_transform.ScaleX, _transform.ScaleY, _transform.ScaleZ);
            }
        }
    }
Ejemplo n.º 2
0
    public override void OnInspectorGUI()
    {
        RememberTransform _target = (RememberTransform)target;

        EditorGUILayout.BeginVertical("Button");
        EditorGUILayout.LabelField("Transform", EditorStyles.boldLabel);
        _target.saveParent        = EditorGUILayout.Toggle("Save change in Parent?", _target.saveParent);
        _target.saveScenePresence = EditorGUILayout.Toggle("Save scene presence?", _target.saveScenePresence);
        if (_target.saveScenePresence)
        {
            EditorGUILayout.HelpBox("This prefab must be placed in a 'Resources' asset folder", MessageType.Info);
        }
        EditorGUILayout.EndVertical();


        SharedGUI();
    }