Example #1
0
    public void GeoDetach(Boolean restorePosAndScale)
    {
        FieldMapActorController component = base.GetComponent <FieldMapActorController>();

        component.SetActive(true);
        if (this._geoAttachData.parentActor != (UnityEngine.Object)null)
        {
            base.transform.parent = this._geoAttachData.parentActor.transform.parent;
        }
        this.actor.go.transform.localRotation = Quaternion.AngleAxis(this.actor.rotAngle[2], Vector3.back) * Quaternion.AngleAxis(this.actor.rotAngle[1], Vector3.up) * Quaternion.AngleAxis(this.actor.rotAngle[0], Vector3.left);
        if (restorePosAndScale)
        {
            component.curPos             = component.curPosBeforeAttach;
            base.transform.localPosition = component.curPos;
            base.transform.localScale    = component.localScaleBeforeAttach;
        }
        else
        {
            base.transform.localScale = new Vector3(-1f, -1f, 1f);
        }
        this._geoAttachData.parentActor = (FieldMapActor)null;
        this._geoAttachData.parentNode  = (Transform)null;
        if (FF9StateSystem.Common.FF9.fldMapNo == 3002 && component.originalActor.sid == 2 && component.originalActor.anim == 11022)
        {
            HonoBehaviorSystem.ExtraLoopCount = 1;
        }
    }
Example #2
0
    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;
    }