/// <summary> /// 현재 선택된 객체가 레이어로 이미 등록되었는지 체크 /// (LinkType에 따라 다른 객체를 레이어로 넣을 수 있다.) /// </summary> /// <param name="selectedObject"></param> /// <returns>True : 이미 추가가 되었다(또는 추가할 수 없다) / False : 추가되지 않은 상태이다.</returns> public bool IsObjectAddedInLayers(object selectedObject) { bool isTarget = IsTargetObject(selectedObject); if (!isTarget) { //타겟이 아니면 false return true; } switch (_linkType) { case apAnimClip.LINK_TYPE.AnimatedModifier: if (selectedObject is apTransform_Mesh) { apTransform_Mesh meshTransform = selectedObject as apTransform_Mesh; for (int i = 0; i < _layers.Count; i++) { if (meshTransform == _layers[i]._linkedMeshTransform) { return true;//이미 있다. } } //추가되지 않았다. return false; } else if (selectedObject is apTransform_MeshGroup) { apTransform_MeshGroup meshGroupTransform = selectedObject as apTransform_MeshGroup; for (int i = 0; i < _layers.Count; i++) { if (meshGroupTransform == _layers[i]._linkedMeshGroupTransform) { return true;//이미 있다. } } //추가되지 않았다. return false; } else if (selectedObject is apBone) { apBone bone = selectedObject as apBone; for (int i = 0; i < _layers.Count; i++) { if (bone == _layers[i]._linkedBone) { //Bone이 이미 등록되어 있다. return true; } } //등록되지 않았다. return false; } break; //case apAnimClip.LINK_TYPE.Bone: // Debug.LogError("TODO : AnimTimeline에서 Bone은 아직 구현되지 않았다."); // //TODO: // return false; case apAnimClip.LINK_TYPE.ControlParam: if (selectedObject is apControlParam) { apControlParam controlParam = selectedObject as apControlParam; for (int i = 0; i < _layers.Count; i++) { if (controlParam == _layers[i]._linkedControlParam) { return true;//이미 있다. } } //추가되지 않았다. return false; } break; } return true; }
//public Vector3 _value_Vec3 = Vector3.zero; //public Color _value_Color = Color.black; // Init //-------------------------------------------------------------------- public apAnimControlParamResult(apControlParam targetControlParam) { _targetControlParam = targetControlParam; }