示例#1
0
 public void Init()
 {
     //在TPOS放一个物体到武器点,以后所有武器点都放此点下
     if (!init)
     {
         owner            = GetComponent <MeteorUnitDebug>();
         LP               = new GameObject().transform;
         LP.localPosition = Vector3.zero;
         LP.localScale    = Vector3.one;
         LP.rotation      = Quaternion.identity;
         LP.SetParent(owner.WeaponL);
         LP.localPosition = Vector3.zero;
         LP.localScale    = Vector3.one;
         LP.name          = "WeaponL_TPos";
         RP = new GameObject().transform;
         RP.localPosition = Vector3.zero;
         RP.localScale    = Vector3.one;
         RP.rotation      = Quaternion.identity;
         RP.SetParent(owner.WeaponR);
         RP.localPosition = Vector3.zero;
         RP.localScale    = Vector3.one;
         RP.name          = "WeaponR_TPos";
         init             = true;
     }
 }
示例#2
0
    public override void OnInspectorGUI()
    {
        base.OnInspectorGUI();
        MeteorUnitDebug myTarget = (MeteorUnitDebug)target;

        src    = GUILayout.TextField(src);
        key    = GUILayout.TextField(key);
        action = GUILayout.TextField(action);


        if (GUILayout.Button("SetKeyFrame"))
        {
            keyframe = int.Parse(key);
            source   = int.Parse(src);
            if (!string.IsNullOrEmpty(src))
            {
                myTarget.charLoader.ChangeFrame(source, keyframe);
            }
        }

        if (GUILayout.Button("ChangeAction"))
        {
            int act = int.Parse(action);
            myTarget.posMng.ChangeActionSingle(act);
        }
    }
示例#3
0
    void Init()
    {
        RectTransform rectTran = WndObject.GetComponent <RectTransform>();

        if (rectTran != null)
        {
            rectTran.anchoredPosition = new Vector2((1920f - rectTran.sizeDelta.x) / 2.0f, -(1080f - rectTran.sizeDelta.y) / 2.0f);
        }
        GameObject      obj       = Global.ldaControlX("3DParent", WndObject);
        GameObject      objPlayer = GameObject.Instantiate(Resources.Load("3DUIPlayer")) as GameObject;
        MeteorUnitDebug d         = objPlayer.GetComponent <MeteorUnitDebug>();

        objPlayer.transform.position   = Vector3.zero;
        objPlayer.transform.rotation   = Quaternion.identity;
        objPlayer.transform.localScale = Vector3.one;
        d.gameObject.layer             = obj.gameObject.layer;
        d.Init(0);
        WeaponBase weaponProperty = WeaponMng.Instance.GetItem(MeteorManager.Instance.LocalPlayer.weaponLoader.GetCurrentWeapon().Info().UnitId);

        d.weaponLoader.StrWeaponR = weaponProperty.WeaponR;
        d.weaponLoader.StrWeaponL = weaponProperty.WeaponL;
        d.weaponLoader.EquipWeapon();
        d.transform.SetParent(obj.transform);
        d.transform.localScale    = 8 * Vector3.one;
        d.transform.localPosition = new Vector3(0, 0, -45);
        d.transform.localRotation = Quaternion.identity;
        Global.ldaControlX("Close Button", WndObject).GetComponent <Button>().onClick.AddListener(Close);

        SetStat("Stat Label 1", MeteorManager.Instance.LocalPlayer.Attr.hpCur + "/" + MeteorManager.Instance.LocalPlayer.Attr.HpMax);
        SetStat("Stat Label 2", MeteorManager.Instance.LocalPlayer.AngryValue.ToString());
        SetStat("Stat Label 3", MeteorManager.Instance.LocalPlayer.CalcDamage().ToString());
        SetStat("Stat Label 4", MeteorManager.Instance.LocalPlayer.CalcDef().ToString());
        SetStat("Stat Label 5", MeteorManager.Instance.LocalPlayer.Speed.ToString());
        SetStat("Stat Label 6", string.Format("{0:f2}", MeteorManager.Instance.LocalPlayer.Speed / 1000.0f));

        //处理背包的点击
        UIItemSlot [] slots = Global.ldaControlX("Slots Grid", WndObject).GetComponentsInChildren <UIItemSlot>();
        for (int i = 0; i < slots.Length; i++)
        {
            slots[i].onClick.AddListener(OnClickItem);
        }
    }
 public void Init()
 {
     _Self   = GetComponent <MeteorUnitDebug>();
     load    = GetComponent <CharacterLoaderDebug>();
     UnitId  = _Self == null ? 0 : _Self.UnitId;
     CanMove = CanRotate = CanAttack = CanJump = CanDefence = CanSkill = CanChangeWeapon = true;
     if (!PosFile.ContainsKey(UnitId))
     {
         if (UnitId >= 20)
         {
             PosFile.Add(UnitId, PosFile[0]);
         }
         else
         {
             PosFile.Add(UnitId, Resources.Load <TextAsset>("9.07/" + "P" + UnitId + ".pos"));
         }
         ActionList.Add(UnitId, new List <Pose>());
         ReadPose();
     }
 }