public void GenerateSPS() { if (!this._isReady) { return; } for (Int32 i = 0; i < this._spsList.Count; i++) { FieldSPS fieldSPS = this._spsList[i]; if (fieldSPS.spsBin != null && (fieldSPS.attr & 1) != 0) { if (fieldSPS.charTran != (UnityEngine.Object)null && fieldSPS.boneTran != (UnityEngine.Object)null) { FieldMapActor component = fieldSPS.charTran.GetComponent <FieldMapActor>(); if (component != (UnityEngine.Object)null) { component.UpdateGeoAttach(); } fieldSPS.pos = fieldSPS.boneTran.position + fieldSPS.posOffset; } fieldSPS.GenerateSPS(); fieldSPS.lastFrame = fieldSPS.curFrame; fieldSPS.meshRenderer.enabled = true; } } }
public static void geoAttach(GameObject sourceObject, GameObject targetObject, Int32 bone_index) { Transform childByName = targetObject.transform.GetChildByName("bone" + bone_index.ToString("D3")); if (PersistenSingleton <EventEngine> .Instance.gMode == 2 || FF9StateSystem.Battle.isDebug) { sourceObject.transform.parent = childByName; sourceObject.transform.localPosition = Vector3.zero; sourceObject.transform.localRotation = Quaternion.identity; sourceObject.transform.localScale = Vector3.one; } else if (PersistenSingleton <EventEngine> .Instance.gMode == 1) { FieldMapActor component = sourceObject.GetComponent <FieldMapActor>(); FieldMapActor component2 = targetObject.GetComponent <FieldMapActor>(); if (component != (UnityEngine.Object)null && component2 != (UnityEngine.Object)null && childByName != (UnityEngine.Object)null) { component.GeoAttach(component2, childByName); PosObj actor = component.actor; actor.attatchTargetUid = (int)component2.actor.uid; actor.attachTargetBoneIndex = bone_index; } } else if (PersistenSingleton <EventEngine> .Instance.gMode == 3) { } }
public static void geoAttachOffset(GameObject sourceObject, Int32 x, Int32 y, Int32 z) { if (PersistenSingleton <EventEngine> .Instance.gMode == 1) { FieldMapActor component = sourceObject.GetComponent <FieldMapActor>(); component.GeoAttachOffset(new Vector3((Single)(-(Single)x), (Single)(-(Single)y), (Single)(-(Single)z))); } }
public static FieldMapActor CreateFieldMapActor(GameObject gObj, Actor actor) { FieldMapActor fieldMapActor = gObj.AddComponent <FieldMapActor>(); actor.fieldMapActor = fieldMapActor; fieldMapActor.actor = actor; fieldMapActor.CharRadius = (Single)actor.collRad; fieldMapActor.meshRenderer = gObj.GetComponentsInChildren <Renderer>(); fieldMapActor.CreateShadowMesh(); return(fieldMapActor); }
public static void geoDetach(GameObject sourceObject, Boolean restorePosAndScaling) { FieldMapActor component = sourceObject.GetComponent <FieldMapActor>(); if (component != (UnityEngine.Object)null) { component.GeoDetach(restorePosAndScaling); } else { global::Debug.Log("geoDetach() : Cannot get FieldMapActor component."); } }
public void GeoAttach(FieldMapActor parentActor, Transform parentNode) { Transform childByName = base.transform.GetChildByName("bone000"); if (childByName == (UnityEngine.Object)null) { return; } FieldMapActorController component = base.GetComponent <FieldMapActorController>(); component.curPosBeforeAttach = component.curPos; component.localScaleBeforeAttach = base.transform.localScale; Vector3 curPos = component.curPos; component.curPos = Vector3.zero; component.lastPos = Vector3.zero; component.SyncPosToTransform(); component.SetActive(false); if (FF9StateSystem.Common.FF9.fldMapNo >= 1400 && FF9StateSystem.Common.FF9.fldMapNo <= 1425) { if (FF9StateSystem.Common.FF9.fldMapNo == 1412) { if (component.isPlayer) { component.curPos = curPos; } } else if (FF9StateSystem.Common.FF9.fldMapNo != 1410 && component.isPlayer) { component.curPos = parentNode.position; } } this._geoAttachData.parentActor = parentActor; this._geoAttachData.parentNode = parentNode; this._geoAttachData.childNode = childByName; Vector3 attachOffset = this._geoAttachData.attachOffset; bool flag = FF9StateSystem.Common.FF9.fldMapNo == 2954 && PersistenSingleton <EventEngine> .Instance.eBin.getVarManually(EBin.MAP_INDEX_SVR) == 8; this._geoAttachData.attachOffset = parentActor._geoAttachData.attachOffset; if (flag) { this._geoAttachData.attachOffset = new Vector3(30f, 150f, 0f); } base.transform.parent = parentNode.transform; base.transform.localPosition = this._geoAttachData.attachOffset; base.transform.localRotation = Quaternion.identity; base.transform.localScale = Vector3.one; this._geoAttachData.childNode.localPosition = Vector3.zero; this._geoAttachData.childNode.localRotation = Quaternion.identity; this._geoAttachData.childNode.localScale = Vector3.one; }
public ObjList DisposeObj(Obj obj) { ObjList objList1 = null; ObjList objList2 = null; ObjList objList3; for (objList3 = this._context.activeObj; objList3 != null && objList3.obj != obj; objList3 = objList3.next) { objList2 = objList3; } if (obj.cid == 4) { FieldMapActorController mapActorController = ((Actor)obj).fieldMapActorController; mapActorController?.UnregisterHonoBehavior(true); FieldMapActor fieldMapActor = ((Actor)obj).fieldMapActor; if (fieldMapActor != null) { fieldMapActor.DestroySelfShadow(); fieldMapActor.UnregisterHonoBehavior(true); } } if (objList3 != null) { objList1 = objList3.next; if (objList2 != null) { objList2.next = objList1; } if (this._context.activeObjTail == objList3) { this._context.activeObjTail = objList2; } objList3.next = this._context.freeObj; this._context.freeObj = objList3; DeallocObj(obj); if (this._context.controlUID == objList3.obj.uid) { this._context.controlUID = 0; } } return(objList1); }
private void SetActorRadius(Actor actor) { if (_engine.gMode != 1) { return; } FieldMapActorController fieldMapActorController = actor.go.GetComponent <FieldMapActorController>(); if (fieldMapActorController != null) { fieldMapActorController.radius = 20 * 4; } FieldMapActor fieldMapActor = actor.go.GetComponent <FieldMapActor>(); if (fieldMapActor != null) { fieldMapActor.CharRadius = 20 * 4; } }