コード例 #1
0
 // Use this for initialization
 void Start()
 {
     direc         = Direction.LEFT;
     pManager      = GameObject.Find("PlayerStatus").GetComponent <PlayerManager>();
     PotObject     = FindObjectOfType <PotController>().gameObject;
     rig           = gameObject.transform.parent.GetComponent <Rigidbody2D>();
     player_ctr    = GameObject.Find("Controller").GetComponent <PlayerController>();
     bringctr      = gameObject.transform.parent.GetChild(0).GetComponent <BringCollider>();
     alchemyUI_ctr = GameObject.Find("Canvas/Alchemy_UI").GetComponent <AlchemyUIController>();
     miniMap_ctr   = GameObject.Find("Canvas/MiniMap").GetComponent <MiniMapController>();
     anim_ctr      = gameObject.transform.parent.GetComponent <AnimController>();
     leg_col       = gameObject.transform.parent.GetComponentInChildren <LegCollider>();
     crossAxisDown = gameObject.GetComponent <CrossAxisDown>();
 }
コード例 #2
0
    void Start()
    {
        //コンポーネント・オブジェクトの取得
        _rb        = GetComponent <Rigidbody2D>();
        _Anim      = GetComponent <Animator>();
        _LegScr    = GameObject.Find("Leg").gameObject.GetComponent <LegCollider>();
        _cameraObj = GameObject.Find("0-BGCamera");

        //現在位置を保存
        _startPos = transform.position;

        //ページ位置を保存、修正。
        _pagePoses[0]       = _pages[0].position;
        _pagePoses[1]       = _pages[1].position;
        _pagePoses[0].z     = 9.7f;
        _pagePoses[1].z     = 9.7f;
        playerSprite        = this.gameObject.GetComponent <SpriteRenderer>();
        sepiaMaskController = this.gameObject.GetComponent <SepiaMaskController>();
    }