コード例 #1
0
    void Start()
    {
        instance = this;

        /*linkBox = link.GetComponent<BoxCollider2D>();
         * shieldBox = Shield.GetComponent<BoxCollider2D>();
         * swordBox = Sword.GetComponent<BoxCollider2D>();  */
        rb2d    = GetComponent <Rigidbody2D>();
        myStats = GetComponent <CharacterStats>();

        lift = FindObjectOfType <LiftScript>();
        if (lift != null)
        {
            liftCollider = lift.GetComponent <Collider2D>();
        }
    }
コード例 #2
0
    void Start()
    {
        liftscript = lift.GetComponent <LiftScript>();
        userInput  = player.GetComponent <UserInput>();

        liftCome1 = basementDoor.GetComponent <LiftCome>();
        liftCome2 = level1Door.GetComponent <LiftCome>();
        liftCome3 = level2Door.GetComponent <LiftCome>();
        liftCome4 = roofDoor.GetComponent <LiftCome>();

        notHereRenderer = notHereLight.GetComponent <Renderer>();
        hereRenderer    = hereLight.GetComponent <Renderer>();

        notHereRenderer.material.color = redStop;
        hereRenderer.material.color    = greenDim;
    }
コード例 #3
0
 void Start()
 {
     anim         = lift.GetComponent <Animator>();
     liftScript   = lift.GetComponent <LiftScript>();
     batteryTower = batTower.GetComponent <BPGscript> ();
 }