コード例 #1
0
ファイル: CIattachmentPoint.cs プロジェクト: xysverma/mcs
 /// <summary>
 /// Removes a CIprop from the current attachment list.
 /// </summary>
 /// <param name="_prop">The CIprop.</param>
 /// <param name="_destroy">Boolean flag denoting whether or not to destroy the removed prop.</param>
 public void RemoveProp(CIprop _prop, bool _destroy)
 {
     if (attachedList.Contains(_prop))
     {
         RemoveProp(attachedList.IndexOf(_prop), _destroy);
     }
 }
コード例 #2
0
ファイル: CIattachmentPoint.cs プロジェクト: xysverma/mcs
        /// <summary>
        /// Adds the given CIprop to the attachment array, with optional cloning of the prop.
        /// </summary>
        /// <param name="_prop">The CIprop to add.</param>
        /// <param name="_cloneGameobject">boolean flag denoting whether or not to clone the prop.</param>
        public void AddProp(CIprop _prop, bool _cloneGameobject)
        {
            CIprop cloneProp = _prop;

            if (_cloneGameobject)
            {
                GameObject clone = Instantiate(_prop.gameObject);
                clone.name = clone.name.Replace("(Clone)", "(Attached)");
                cloneProp  = clone.GetComponentInChildren <CIprop> ();
                attachedList.Add(clone.GetComponentInChildren <CIprop>());
                //printAPList ();
            }
            else
            {
                attachedList.Add(_prop);
            }

            cloneProp.transform.SetParent(transform);
            cloneProp.transform.localPosition    = cloneProp.basePosition;          // Vector3.zero;
            cloneProp.transform.localEulerAngles = cloneProp.baseRotation;          // Quaternion.identity;

            if (attachedList.Count > MaxVisibleItems)
            {
                RemoveProp();
            }

            invalidateLayout();
        }
コード例 #3
0
ファイル: CIattachmentPoint.cs プロジェクト: xysverma/mcs
 /// <summary>
 /// Moves a CIprop to another attachment point.
 /// </summary>
 /// <param name="_prop">The CIprop to move.</param>
 /// <param name="_ap">The target CIattachmentPoint.</param>
 public void MoveProp(CIprop _prop, CIattachmentPoint _ap)
 {
     printAPList();
     if (attachedList.Contains(_prop))
     {
         _ap.AddProp(_prop, false);
         RemoveProp(_prop, false);
     }
 }
コード例 #4
0
ファイル: CIattachmentPoint.cs プロジェクト: xysverma/mcs
        /// <summary>
        /// Removes a CIprop from the current attachment list.
        /// </summary>
        /// <param name="_prop">The string prop name.</param>
        /// <param name="_destroy">Boolean flag denoting whether or not to destroy the removed prop.</param>
        public void RemoveProp(string _prop, bool _destroy)
        {
            CIprop prop = GetPropByName(_prop);

            if (prop != null)
            {
                RemoveProp(attachedList.IndexOf(prop), _destroy);
            }
        }
コード例 #5
0
        protected bool DisplayProp(MCS.COSTUMING.CIprop prop)
        {
            bool result;

            EditorGUILayout.BeginHorizontal();
            EditorGUILayout.LabelField(prop.dazName, GUILayout.Width(180));
            GUILayout.Space(60);
            result = GUILayout.Button("Disable", GUILayout.Width(60));
            EditorGUILayout.EndHorizontal();

            return(result);
        }
コード例 #6
0
ファイル: CIattachmentPoint.cs プロジェクト: xysverma/mcs
 /// <summary>
 /// Attaches the given CIprop to the attachment point. Returns true on success.
 /// </summary>
 /// <returns><c>true</c>, if property was attached, <c>false</c> otherwise.</returns>
 /// <param name="prop">The CIprop to attach.</param>
 public bool AttachProp(CIprop prop)
 {
     if (!attachedList.Contains(prop))
     {
         prop.transform.SetParent(transform);
         prop.transform.localPosition = Vector3.zero;
         prop.transform.localRotation = Quaternion.identity;
         attachedList.Add(prop);
         return(true);
     }
     return(false);
 }
コード例 #7
0
ファイル: CIattachmentPoint.cs プロジェクト: xysverma/mcs
 /// <summary>
 /// Adds the given CIprop to the attachment array, with explicit cloning of the prop.
 /// </summary>
 /// <param name="_prop">Property.</param>
 public void AddProp(CIprop _prop)
 {
     AddProp(_prop, true);
 }