Esempio n. 1
0
    public void InitChar(CharaData charaData, AbstractCharacterObject.CharDirection dir = AbstractCharacterObject.CharDirection.RIGHT)
    {
        this.charaData             = charaData;
        this.charaData.charaObject = gameObject;

        //死んでたらお墓表示
        if (charaData.IsDead)
        {
            GameManager.Instance.DeathEffect(charaData);
            return;
        }

        //Animatorオブジェクトを見つける
        _animator = GetComponentInChildren <Animator> ();
        if (_animator == null)
        {
            Debug.LogError("PlayerObject.Skeleton does not have Animator attached!");
            return;
        }
        _animator.Play("stand");

        //weaponオブジェクトを見つける。(ソード持ってる手のweaponオブジェクト)
        if (weaponPosObj == null)
        {
            weaponPosObj = Utils.getChildGameObject(gameObject, "weapon");
        }
        _swordObject = weaponPosObj.GetComponent <SwordObject>();

        //服を着せる
        if (GetComponent <ClothingSystem> () != null)
        {
            GetComponent <ClothingSystem> ().SetClothPartsByStringData(charaData.ClothDataStr);
        }

        //ディフォルトは右向き
        FaceTo(dir);

        //描画順設定
        SetSortingLayer(GetSortingLayerName());
    }
 //sword pickup method
 public void SwordPickedUp()
 {
     Sword = true;
     SwordObject.SetActive(true);
     CharacterAnimator.SetBool("Sword", true);
 }
Esempio n. 3
0
 public int LogicChooser(SwordObject compact)
 {
     byte objSelected = 0;
     if (_objectBarStatus == MenuState.MENU_OPEN)
         objSelected = CheckMenuClick(MENU_TOP);
     if (objSelected == 0)
         objSelected = CheckMenuClick(MENU_BOT);
     if (objSelected != 0)
     {
         compact.logic = Logic.LOGIC_script;
         return 1;
     }
     return 0;
 }
Esempio n. 4
0
 public void FnChooser(SwordObject compact)
 {
     Logic.ScriptVars[(int)ScriptVariableNames.OBJECT_HELD] = 0;
     _mouse.SetLuggage(0, 0);
     BuildSubjects();
     compact.logic = Logic.LOGIC_choose;
     _mouse.ControlPanel(true); // so the mouse cursor will be shown.
     _subjectBarStatus = MenuState.MENU_OPENING;
 }