void CaptureSkyrise(SkyriseSection sr) { sr.Capture(); capturedSkyrise = sr; hasSkyriseSection = true; instantTransform = new CopyTransform(transform); skyriseOffset = new CopyTransform( sr.transform.position - instantTransform.position, instantTransform.rotation); sr.transform.SetParent(transform); }
private void SetRoot(Transform root) { this.rootTrs = new GameObject().transform; this.rootTrs.name = root.name; this.copyBoneList.Add(this.rootTrs); this.fromToBoneDic.Add(root, this.rootTrs); this.toFromBoneDic.Add(this.rootTrs, root); this.rootTrs.parent = this.boneRendererRoot; CopyTransform copyTransform = this.rootTrs.gameObject.AddComponent <CopyTransform>(); copyTransform.bScl = false; copyTransform.SetTarget(this.toFromBoneDic[this.rootTrs]); BoneRendererAssist boneRendererAssist = this.rootTrs.gameObject.AddComponent <BoneRendererAssist>(); boneRendererAssist.SetSelectable(this.selectable); boneRendererAssist.SetVisible(this.boneDisplay == BoneDisplay.Visible); boneRendererAssist.SetColor(Setting.normalBoneColor.GetValue()); this.braList.Add(boneRendererAssist); }
void OnEnable() { _aspectRatio = (float)Screen.width / Screen.height; Main.gameObject.SetActive(false); _minimapTexture = Minimap.targetTexture; _minimapTransform = Minimap.transform; _minimapCopyTransform = Minimap.GetComponent <CopyTransform>(); _minimapCopyTransform.enabled = false; _minimapGravityTexture = MinimapGravity.targetTexture; _minimapGravityTransform = MinimapGravity.transform; _minimapGravityCopyTransform = MinimapGravity.GetComponent <CopyTransform>(); _minimapGravityCopyTransform.enabled = false; _gravityRendererTransform = GravityRenderer.transform; _gravityRendererCopyTransform = GravityRenderer.GetComponent <CopyTransform>(); _gravityRendererCopyTransform.enabled = false; _previousGravityRendererScale = _gravityRendererTransform.localScale; _fullscreenGravityTexture = new RenderTexture(Screen.width / 2, Screen.height / 2, 1, RenderTextureFormat.RFloat); GravityRenderer.material.mainTexture = _fullscreenGravityTexture; MinimapGravity.targetTexture = _fullscreenGravityTexture; Minimap.targetTexture = null; SetZoom(); }
private Transform GetOrSetCopyBone(Transform root, Transform fromBone) { Transform result; if (this.fromToBoneDic.ContainsKey(fromBone)) { result = this.fromToBoneDic[fromBone]; } else if (fromBone.parent == null) { result = null; } else { BoneRendererAssist component; if (this.fromToBoneDic.ContainsKey(fromBone.parent)) { component = this.fromToBoneDic[fromBone.parent].GetComponent <BoneRendererAssist>(); if (this.parentChildDic.ContainsKey(fromBone.name)) { string name = this.parentChildDic[fromBone.name]; Transform transform2 = CMT.SearchObjName(root.transform, name, false); if (transform2) { component = this.GetOrSetCopyBone(root, transform2).GetComponent <BoneRendererAssist>(); } } } else { Transform transform3 = this.GetOrSetCopyBone(root, fromBone.parent); if (transform3 == null) { return(null); } component = transform3.GetComponent <BoneRendererAssist>(); } Transform transform4 = new GameObject().transform; transform4.name = fromBone.name; this.copyBoneList.Add(transform4); this.fromToBoneDic.Add(fromBone, transform4); this.toFromBoneDic.Add(transform4, fromBone); transform4.parent = this.boneRendererRoot; CopyTransform copyTransform = transform4.gameObject.AddComponent <CopyTransform>(); copyTransform.bScl = false; copyTransform.SetTarget(this.toFromBoneDic[transform4]); BoneRendererAssist boneRendererAssist = transform4.gameObject.AddComponent <BoneRendererAssist>(); boneRendererAssist.SetSelectable(this.selectable); if (component) { boneRendererAssist.SetParent(component); if (this.firstChildDic.ContainsKey(transform4.name) && this.firstChildDic[transform4.name] == component.transform.name) { component.SetFirstChild(boneRendererAssist); } else { component.SetChild(boneRendererAssist); } } if (this.boneDisplay == BoneDisplay.Visible) { boneRendererAssist.SetVisible(this.JudgeVisibleBone(boneRendererAssist)); } else { boneRendererAssist.SetVisible(false); } boneRendererAssist.SetColor(Setting.normalBoneColor.GetValue()); this.braList.Add(boneRendererAssist); result = transform4; } return(result); }