Beispiel #1
0
 public void SimpleMove(float speedfactor)
 {
     if (null != CharaController)
     {
         CharaController.SimpleMove(CacheModel.forward * Time.deltaTime * Attribute.BaseSpeed * speedfactor);
     }
 }
 // Start is called before the first frame update
 void Start()
 {
     GameTime.PlayerTimeScale = 1f;
     Init();
     anim.SetBool("dead", false);
     instance = this;
 }
    //ボタンイベント
    private void SetBtnEvent(GameObject player)
    {
        CharaController cont = player.GetComponent <CharaController>();

        btns[0].GetComponent <Button>().onClick.AddListener(cont.MoveUp);
        btns[1].GetComponent <Button>().onClick.AddListener(cont.MoveRight);
        btns[2].GetComponent <Button>().onClick.AddListener(cont.MoveDown);
        btns[3].GetComponent <Button>().onClick.AddListener(cont.MoveLeft);
    }
Beispiel #4
0
    ///<summary>
    ///player移動・歩数管理コルーチン
    ///引数に移動するplayerを当てて外部から呼び出す
    ///</summary>
    //MainFlowManagerからコルーチンで呼び出している
    public IEnumerator MoveCountCoroutine(GameObject player)
    {
        //コントローラー取得
        CharaController controller = player.GetComponent <CharaController>();

        Debug.Log("start:" + num);
        while (num <= 0)
        {
            yield return(null);
        }

        //移動ボタン表示
        StartCoroutine(mbManager.EnableMoveBtn(player));

        // while(num > 0)
        // {
        //     num -= controller.MoveInput();
        //     yield return null;
        // }
        yield return(StartCoroutine(controller.MoveInput()));

        Debug.Log(num + ":fin");
    }
    public CharaConfiguration(Configuration config, Rigidbody body_root, 
        List<GameObject[]> body_list,
        List<GameObject[]> limbs_list,
        bool debug = false)
    {
        _config = config;
        root = body_root;
        _body_list = body_list;
        _limbs_list = limbs_list;
        _debug = debug;

        controllers = new List<CharaController>();

        foreach (GameObject[] limbs in _limbs_list) {
            LimbsController limbs_ctrl = new LimbsController(this, _config, limbs, _debug);
            controllers.Add(limbs_ctrl);
        }

        foreach(GameObject[] body in body_list) {
            CharaController body_ctrl = new CharaController(this, _config, body, _debug);
            controllers.Add(body_ctrl);
        }
    }
 private void OnDisable()
 {
     instance = null;
 }
 private void OnEnable()
 {
     instance = this;
 }
Beispiel #8
0
 private void Start()
 {
     // cache
     charaController = GetComponent <CharaController>();
 }
 private void Awake()
 {
     m_controller = GetComponent <CharaController>();
 }