YuminekoGame
2/4/2019 - 3:42 AM

GetComponent

GetComponentをParameterContainerで行なう場合

using System.Collections;
using System.Collections.Generic;
using Arbor;
using UnityEngine;

public class Bullet : MonoBehaviour {
  private GameObject player;
  /* ParameterContainerから指定した型のComponentを取得 */
  private Rigidbody PlayerRigid { get { return this.ref_rigid.parameter.objectReferenceValue as Rigidbody; } }

  [SerializeField]
  [ClassExtends (typeof (Rigidbody))]
  private ComponentParameterReference ref_rigid;
  /* 指定した型のComponentを取得 ここまで*/

  void FixedUpdate () {
    PlayerRigid.velocity = Vector3.forward;
  }
}